Jenkins 构建失败
构建步骤“调用顶级 Maven 目标”将构建标记为失败
我是 Jenkins 的新手,不确定为什么构建失败。
请看日志:
[INFO] yarn install v0.27.5
[INFO] [1/4] Resolving packages...
[INFO] [2/4] Fetching packages...
[WARNING] warning fsevents@1.1.1: The platform "linux" is incompatible with this module.
[INFO] info "fsevents@1.1.1" is an optional dependency and failed compatibility check. Excluding it from installation.
[INFO] [3/4] Linking dependencies...
[INFO] [4/4] Building fresh packages...
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE
我的 pom.xml 有以下配置:
<properties>
<project.frontend.nodeVersion>v6.10.0</project.frontend.nodeVersion>
<project.frontend.yarnVersion>v0.27.5</project.frontend.yarnVersion>
<skipGulp>false</skipGulp>
<build.args>publish:dev:all</build.args>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.3</version>
<configuration>
<skip>${skipGulp}</skip>
</configuration>
<executions>
<execution>
<id>install node and yarn</id>
<goals>
<goal>install-node-and-yarn</goal>
</goals>
<configuration>
<nodeVersion>${project.frontend.nodeVersion}</nodeVersion>
<yarnVersion>${project.frontend.yarnVersion}</yarnVersion>
</configuration>
</execution>
<execution>
<id>yarn install</id>
<goals>
<goal>yarn</goal>
</goals>
<configuration>
<failOnError>false</failOnError>
</configuration>
</execution>
<execution>
<id>fix node-sass package</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>rebuild node-sass</arguments>
</configuration>
</execution>
<execution>
<id>yarn</id>
<goals>
<goal>yarn</goal>
</goals>
<configuration>
<arguments>run ${build.args}</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
我真的很感激这方面的任何帮助。
谢谢。
请您参考如下方法:
Jenkins中的一些maven版本似乎有问题,
另一个合适的解决方案是在 Jenkins 上添加另一个 maven 安装。
配置,并查找向下滚动的 Maven 部分。
安装。
see the image "Maven installation button"
那个新安装。例如。 “Apache Maven 3.3.9”。
see the image "New maven installation"
如果您看到构建 #? 的输出控制台,Jenkins 将下载新的 maven 版本并将其安装在您的机器上并执行构建。
如果一切正常,您应该看到:[INFO] BUILD SUCCESS...
这将帮助您了解该版本的 Maven 是否正常工作。然后你可以在你的系统上安装第二个 maven 版本。
Once you have it installed the other maven version on your machine, re-config it on:
Manage Jenkins > Global Tool Configuration and set the path of the maven source (src) folder, but this time uncheck the "install automatically option" see image "Set maven path installation" now you can build all your jobs in Jenkins.
最后重复步骤“7、8 和 9”将您的新配置设置为默认值!
祝你好运!