Answer the question
In order to leave comments, you need to log in
Why, when building mavens, npm opens Karmu and then does nothing?
I generated a project using the Angular CLI. Added there pom.xml
.
It uses a special maven plugin .
pom code:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.slandshow</groupId>
<artifactId>vtdairy</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>VaultTecDairyPage</name>
<description>VaultTecDairyPage</description>
<build>
<resources>
<resource>
<directory>dist</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<!--<version>1.6</version>-->
<version>1.0</version>
<configuration>
<npmInheritsProxyConfigFromMaven>false</npmInheritsProxyConfigFromMaven>
<!--<nodeVersion>v8.9.0</nodeVersion>-->
<!--<yarnVersion>v1.3.2</yarnVersion>-->
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<nodeVersion>v8.9.0</nodeVersion>
<npmVersion>3.10.10</npmVersion>
<!--<installDirectory>ui</installDirectory>-->
</configuration>
</execution>
<execution>
<id>npm clean cache</id>
<goals>
<goal>npm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>cache clean</arguments>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>npm run test</id>
<goals>
<goal>npm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>run test</arguments>
</configuration>
</execution>
<!--<execution>-->
<!--<id>yarn test</id>-->
<!--<goals>-->
<!--<goal>yarn</goal>-->
<!--</goals>-->
<!--<phase>test</phase>-->
<!--<configuration>-->
<!--<arguments>test --watch false</arguments>-->
<!--<failOnError>true</failOnError>-->
<!--</configuration>-->
<!--</execution>-->
<execution>
<id>npm run-script prod-aot</id>
<phase>generate-resources</phase>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run-script build</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
mvn clean install
. At the beginning, everything goes as it should, the cache is cleared, npm install is performed, tests are run. Log:[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ vtdairy ---
[INFO]
[INFO] --- frontend-maven-plugin:1.0:install-node-and-npm (install node and npm) @ vtdairy ---
[INFO] Found proxies: [maven-global{protocol='http', host='proxy.my.ru', port=3128}]
[INFO] Node v8.9.0 is already installed.
[INFO] NPM 3.10.10 is already installed.
[INFO]
[INFO] --- frontend-maven-plugin:1.0:npm (npm clean cache) @ vtdairy ---
[INFO] npm not inheriting proxy config from Maven
[INFO] Running 'npm cache clean' in C:\Users\Github\VaultTecDairyPage
[INFO]
[INFO] --- frontend-maven-plugin:1.0:npm (npm install) @ vtdairy ---
[INFO] npm not inheriting proxy config from Maven
[INFO] Running 'npm install' in C:\Users\Github\VaultTecDairyPage
[WARNING] npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.2.2 (node_modules\chokidar\node_modules\fsevents):
[WARNING] npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
[WARNING] npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.0.0 (node_modules\@angular\compiler-cli\node_modules\chokidar\node_modules\fsevents):
[WARNING] npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
[INFO]
[INFO] --- frontend-maven-plugin:1.0:npm (npm run test) @ vtdairy ---
[INFO] npm not inheriting proxy config from Maven
[INFO] Running 'npm run test' in C:\Users\Github\VaultTecDairyPage
[INFO]
[INFO] > [email protected] test C:\Users\Github\VaultTecDairyPage
[INFO] > ng test
[INFO]
[INFO] 07 02 2019 15:41:48.176:WARN [karma]: No captured browser, open http://localhost:9876/
[INFO] 07 02 2019 15:41:48.184:INFO [karma]: Karma v3.0.0 server started at http://0.0.0.0:9876/
[INFO] 07 02 2019 15:41:48.184:INFO [launcher]: Launching browser Chrome with unlimited concurrency
[INFO] 07 02 2019 15:41:48.230:INFO [launcher]: Starting browser Chrome
[INFO] 07 02 2019 15:41:56.384:WARN [karma]: No captured browser, open http://localhost:9876/
[INFO] 07 02 2019 15:41:57.038:INFO [Chrome 71.0.3578 (Windows 10 0.0.0)]: Connected on socket esv6BZNBS4LtvijmAAAA with id 81290853
[INFO] Chrome 71.0.3578 (Windows 10 0.0.0): Executed 0 of 3 SUCCESS (0 secs / 0 secs)
[INFO] Chrome 71.0.3578 (Windows 10 0.0.0): Executed 1 of 3 SUCCESS (0 secs / 0.151 secs)
[INFO] Chrome 71.0.3578 (Windows 10 0.0.0): Executed 2 of 3 SUCCESS (0 secs / 0.219 secs)
[INFO] Chrome 71.0.3578 (Windows 10 0.0.0): Executed 3 of 3 SUCCESS (0 secs / 0.28 secs)
[INFO] Chrome 71.0.3578 (Windows 10 0.0.0): Executed 3 of 3 SUCCESS (0.301 secs / 0.28 secs)
[INFO] TOTAL: 3 SUCCESS
[INFO] TOTAL: 3 SUCCESS
BUILD SUCCESS
. Answer the question
In order to leave comments, you need to log in
Forgot --single-run
?
And don't call mvn install
if you don't want to install the built artifacts in ~./m2/repository
. Enough mvn verify
.
PS By the way, why do you run tests in the generate-resources phase, and not in the test phase?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question