1
Angle 2アプリケーションのインストールとビルドを自動化しようとしているときに、以下のエラーが表示されます。アプリケーションはGITにあり、その部分は問題ありません。私は2番目の目標に到達するまで、nodeModulesをうまくインストールできますが、角度アプリケーションをdistフォルダに構築しようとしている2番目のステップで失敗します。基本的には、mavenでng build --environment = sysと同等の処理をしたいと考えています。JenkinsビルドエラーMaven Angular2
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:exec (ng build) on project consumer-dashboard: Command execution failed. Cannot run program "ng" (in directory "D:\Jenkins\PFS Jobs\consumer-dashboard\workspace\consumer-dashboard\src"): CreateProcess error=2, The system cannot find the file specified -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[JENKINS] Archiving D:\Jenkins\PFS Jobs\consumer-dashboard\workspace\consumer-dashboard\pom.xml to consumer-dashboard/consumer-dashboard/1.0.0-SNAPSHOT/consumer-dashboard-1.0.0-SNAPSHOT.pom
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
channel stopped
Jenkinsを使用してビルドサーバーでpomで実行します。
<build>
<plugins>
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<version>1.4.0</version>
<executions>
<execution>
<id>npm install</id>
<goals>
<goal>exec</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<executable>npm</executable>
<arguments>
<argument>install</argument>
<argument>-g angular-cli</argument>
</arguments>
<workingDirectory>./src</workingDirectory>
<target>
<echo message="npm install" />
</target>
</configuration>
</execution>
<execution>
<id>ng build</id>
<goals>
<goal>exec</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<executable>ng</executable>
<arguments>
<argument>build</argument>
<argument>--environment=sys</argument>
</arguments>
<workingDirectory>./src</workingDirectory>
<target>
<echo message="ng build" />
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
なぜngが見つかりませんか。
角度アプリを構築するためにMavenを使用することを再考したいと思います... – khmarbaise
もっとうまくいくと思いますか? –
'ng build ...'を使うのはどうですか? – khmarbaise