Jenkins build issue - java

I got the following error while running a Jenkins job
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project mosm-ui: Error unpacking file [/var/lib/jenkins/.m2/repository/com/cisco/xmp/wap/xmpweb/2.0.5/xmpweb-2.0.5.war]to [/var/lib/jenkins/jobs/MOS_2.3/workspace/target/war/work/com.cisco.xmp.wap/xmpweb]: chmod exit code was: 127 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project mosm-ui: Error unpacking file [/var/lib/jenkins/.m2/repository/com/cisco/xmp/wap/xmpweb/2.0.5/xmpweb-2.0.5.war]to [/var/lib/jenkins/jobs/MOS_2.3/workspace/target/war/work/com.cisco.xmp.wap/xmpweb]
Caused by: org.apache.maven.plugin.MojoExecutionException: Error unpacking file [/var/lib/jenkins/.m2/repository/com/cisco/xmp/wap/xmpweb/2.0.5/xmpweb-2.0.5.war]to [/var/lib/jenkins/jobs/MOS_2.3/workspace/target/war/work/com.cisco.xmp.wap/xmpweb]
The size of the xmpweb-2.0.5.war file is 209MB.
JDK - 1.7.0_55 , Maven version - 3.2.1.
OS - RHEL 6.4
Appreciate your help in advance.

You might not be passing your PATH variable correctly. Look for something that looks like :PATH and make it :$PATH
see this similar issue here and stop thinking of it as a maven failure, but rather a bad call to chmod.

Related

mvn spring-boot:run build failure

When i try to run mvn spring-boot:run to launch this project that has worked for others in the past I'm met with this error after the build fails:
terminal screenshot
Would love help from someone who has encountered this before. Error reads:
failed to execute goal
org.springframework.boot:spring-boot-maven-plugin:2.3.4.RELEASE:run
(default-cli) on project resource-profile-repo: Application finished
with exit code: 1 -> [Help 1]
Thanks for the help! Turns out I didn't have the proper log in information in my .env for the Database so it was failing the build. User error

Maven build fail: "invalid target release" only in GitLab CI

Part of my GitLab CI pipeline uses Maven ( mvn test ). Maven fails to build my test project with the following error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (default-testCompile) on project GenericTests: Fatal error compiling: invalid target release: 13 -> [Help 1]
I did some research and apparently setting JAVA_HOME to the location of JDK 13 would work, and it does, but only when I do it by hand locally via SSH.
In my pipeline, even if I export JAVA_HOME right before running mvn test I still get the same error.
script:
- export JAVA_HOME=/usr/java/jdk-13.0.2
- mvn test
Why does this work differently between GitLab CI and SSH? Could it have to do with the fact that GitLab CI is a non-interactive shell? What can I do to remedy this?
EDIT: I also tried to add a release tag in pom.xml like so:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>13</release>
</configuration>
</plugin>
but this only resulted in another error during build time:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (default-testCompile) on project GenericTests: Fatal error compiling: invalid flag: --release -> [Help 1]
It turned out to be a mess-up on my part: mvn test was being executed by means of an alias, which was actually sudo mvn test. Hence why the environment variable wasn't being used and why I got Mojo permission denied errors locally when I tried to rerun tests.

When running sonarqube java dockerised app it get error sonarqube url not reachable

I am running sonarqube from docker and it's working great for local projects, but when running it manually on a dockerized app it gives
[ERROR] SonarQube server [http://my-external-server-url:9000] can not be reached.
I ran it with maven in DEBUG mode and I got that
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project MY-PROJECT: Unable to execute SonarQube: Fail to get bootstrap index from server: No route to host (Host unreachable) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project MY-PROJECT: Unable to execute SonarQube
Am I missing something here ??
P.S. It's a dockerized java project so I'm running from inside the docker, unlike other php projects

Maven testCompile works with Java 9 Build 166, but fails with Build 167

When compiling JUnit tests with Maven 3.5.0 and Java 9 build 167, I get the error message:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:testCompile (default-testCompile) on project ...: Fatal error compiling: invalid flag: -Xmodule:...
The reason is: -Xmodule has been removed in Java 9 build 167 and later builds.
Is there any workaround?
The problem has already been reported on Maven Issue Tracker: https://issues.apache.org/jira/browse/MCOMPILER-294. You can still ask for a workaround there.
As quickly viewing code, you can add a test module descriptor

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:java (default-cli)

I'm working on datastax cassandra java driver project using Maven. I've tried to build it successfully in local machine with maven and Eclipse.
However, when I deployed the project in Amazon AWS. Every time, I ran the exec:java -Dexec.mainClass=”com.example.cassandra.App”, which is a simple Hello World java file. However, I got an error:
[ec2-user#ip-172-31-18-93 simple-client]$ mvn exec:exec
-Dexec.mainClass=”com.example.cassandra.App”
Error:
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:exec (default-cli) on project simple-client: The parameters 'executable' for goal org.codehaus.mojo:exec-maven-plugin:1.4.0:exec are missing or invalid -> [Help 1]
However, sometime when i went into the target/classes and run java com.example.cassandra.App, it can show hello world! successfully. But when I add new java file like SimpleClient.java and compile it and run, it shows the error above.

Categories