SlandShow
@SlandShow
70% of my body is made of movies.

Почему при билде мавенов npm открывает Karmu и дальше ничего не делает?

Сгенерил проект с помощью Angular CLI. Добавил туда pom.xml.

Там используется специальный maven плагин.

Код pom-ника:
<?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 &#45;&#45;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. В начале всё идёт как надо, очищается кэш, выполняется npm install, запускаются тесты. Лог:
[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: fsevents@^1.2.2 (node_modules\chokidar\node_modules\fsevents):
[WARNING] npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
[WARNING] npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\@angular\compiler-cli\node_modules\chokidar\node_modules\fsevents):
[WARNING] npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: 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] > vault-tec-dairy-page@0.0.0 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


И открывается вкладочка в браузере с Karma. И всё, дальше ничего не происходит, я не вижу долгожданного BUILD SUCCESS.
5c5c2b1d12e7a038133198.png

Как это починить?
  • Вопрос задан
  • 198 просмотров
Пригласить эксперта
Ответы на вопрос 1
Забыли --single-run?

<arguments>run test -- --single-run</arguments>

И не вызывайте mvn install, если не хотите устанавливать собранные артефакты в ~./m2/repository. Достаточно mvn verify.

P.S. Кстати, а почему у вас запуск тестов в фазе generate-resources, а не в фазе test?
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы