Jenkins build is failing with
Build step 'Invoke top-level Maven targets' marked build as failure
I am new to Jenkins and not sure why build is failing. Please see the log:
[INFO] yarn install v0.27.5
[INFO] [1/4] Resolving packages...
[INFO] [2/4] Fetching packages...
[WARNING] warning [email protected]: The platform "linux" is incompatible with this module.
[INFO] info "[email protected]" 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
My pom.xml has below configurations:
<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>
I will really appreciate any help on this. Thanks.
In Jenkins, in the pipeline where the failure occurred, in the navigation pane, click Rebuild. In the Rebuild page, select the ReRun check box , and click Rebuild.
Your error occurs due to lack of major settings in the jenkins-project, Jenkins don't know where find compiler.
That is the goal of the Maven plugin for Jenkins. The central feature of the Maven plugin for Jenkins is the Maven 2/3 project type. Thanks to the Maven project object model (POM), this project type can automatically provide the following features: Archive artifacts produced by a build.
It seems there is a problem with some maven versions in Jenkins, Another suitable solution is to add another maven installation on Jenkins.
Press the button "Maven Installations" and config a new maven installation. see the image "Maven installation button"
In the text box called "Name" Type the name you want to identify that new installation. eg. "Apache Maven 3.3.9".
In the select menu choose the version 3.3.9. see the image "New maven installation"
Below hit the save button.
if you see the output console of your build #?, Jenkins will download the new maven version and install it on your machine and execute the build as well.
If all is fine you should see: [INFO] BUILD SUCCESS...
This will help you to know if that version of maven works fine. Then you can install a second maven version on your system.
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.
Finally repeat steps "7, 8 and 9" to set your new config as the default!
good luck!
Follow below steps to solve problem. Its work for me.
Uninstall you maven from running environment.
Install Maven form :
wget http://www-eu.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
Extract tar file using:
tar -zxvf apache-maven-3.3.9-bin.tar.gz
Now set M2_HOME in environment. Open vi /etc/profile
End of file add below lines and save file.
export M2_HOME=/opt/apache-maven-3.3.9/
export M2="$M2_HOME"bin
export PATH=$PATH:$M2
Compile this file using source /etc/profile
Your Maven home path is set. Yo can check using echo $M2_HOME
command.
Run your project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With