Jenkins build error for a maven test project on ubuntu 16.04 - maven

I am encountering the error below while running a maven test project on Ubuntu 16.04. When I run the project from the terminal it works fine. But I need to run it through Jenkins now.
I have given all permissions for jenkins user. I cannot seem to understand the reason for this error so that I can troubleshoot further. Can someone please help as I am new to Devops and learning?
Console Output
`EnvInject] - Loading node environment variables.
Building in workspace /var/lib/jenkins/workspace/Maven Test Parsing POMs Established TCP socket on 43944 [IceScrum] $ /usr/lib/jvm/java-8-oracle //bin/java -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven33-agent-1.12-alpha-1.jar:/usr/share/maven/boot/plexus-classworlds-2.x.jar:/usr/share/maven/conf/logging jenkins.maven3.agent.Maven33Main /usr/share/maven/ /var/cache/jenkins/war/WEB-INF/lib/remoting-3.10.2.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven33-interceptor-1.12-alpha-1.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.12-alpha-1.jar 43944 <===[JENKINS REMOTING CAPACITY]===>channel started Executing Maven: -B -f /opt/IceScrum/pom.xml verify [INFO] Scanning for projects...`
`[WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-io:commons-io:jar:1.3.2 [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) # cxm7 --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /opt/IceScrum/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) # cxm7 --- [INFO] No sources to compile [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # cxm7 --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /opt/IceScrum/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) # cxm7 --- [INFO] No sources to compile [INFO] [INFO] --- maven-surefire-plugin:2.17:test (default-test) # cxm7 --- [INFO] No tests to run.
[INFO] Surefire report directory: /opt/IceScrum/target/surefire-reports`
`[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test (default-test) on project cxm7: Error creating properties files for forking: Permission denied -> [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.
[JENKINS] Archiving /opt/IceScrum/pom.xml to cxm/cxm7/0.0.1-SNAPSHOT/cxm7-0.0.1-SNAPSHOT.pom
/opt/IceScrum/pom.xml is not inside /var/lib/jenkins/workspace/Maven Test/opt/IceScrum/; will archive in a separate pass [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
channel stopped
Finished: FAILURE`
After I ran the script with -X switch. I got the following results.
Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_151, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-8-oracle/jre Default locale: en_IN, platform encoding: UTF-8 OS name: "linux", version: "4.4.0-101-generic", arch: "amd64", family: "unix"
[DEBUG] Populating class realm maven.api [INFO] Error stacktraces are turned on.[DEBUG] Reading global settings from /usr/share/maven/conf/settings.xml
[DEBUG] Reading user settings from /root/.m2/settings.xml [DEBUG] Reading global toolchains from /usr/share/maven/conf/toolchains.xml[DEBUG] Reading user toolchains from /root/.m2/toolchains.xml [DEBUG] Using local repository at /root/.m2/repository [DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /root/.m2/repository [INFO] Scanning for projects
[DEBUG] Extension realms for project org.apache.maven:standalone-pom:pom:1: (none) [DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.core, parent: null] [INFO]``[INFO] BUILD FAILURE``[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/home/cyberadmin). Please verify you invoked Maven from the correct directory. -> [Help 1]org.apache.maven.lifecycle.MissingProjectException: The goal you specified requires a project to execute but there is no POM in this directory (/home/cyberadmin). Please verify you invoked Maven from the correct directory.
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:84)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException

Related

Cannot run "mvn jetty:run" in my fhir project

Im new at fhir server.
My code mainly from repo https://github.com/hapifhir/hapi-fhir-jpaserver-starter
I tried to install fhir server on my ubuntu 20.04(lts) and stuck with this problem.
my mvn version
Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 17.0.5, vendor: Private Build, runtime: /usr/lib/jvm/java-17-openjdk-amd64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.15.0-50-generic", arch: "amd64", family: "unix"
ERROR
[INFO] Scanning for projects...
[WARNING] The project ca.uhn.hapi.fhir:hapi-fhir-jpaserver-starter:war:6.2.1 uses prerequisites which is only intended for maven-plugin projects but not for non maven-plugin projects. For such purposes you should use the maven-enforcer-plugin. See https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
[INFO]
[INFO] ------------< ca.uhn.hapi.fhir:hapi-fhir-jpaserver-starter >------------
[INFO] Building HAPI FHIR JPA Server - Starter Project 6.2.1
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] >>> jetty-maven-plugin:9.4.48.v20220622:run (default-cli) > test-compile # hapi-fhir-jpaserver-starter >>>
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0:enforce (enforce-maven) # hapi-fhir-jpaserver-starter ---
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.8:prepare-agent (default-prepare-agent) #
hapi-fhir-jpaserver-starter ---
[INFO] argLine set to -javaagent:/root/.m2/repository/org/jacoco/org.jacoco.agent/0.8.8/org.jacoco.agent-0.8.8-runtime.jar=destfile=/root/hapi-fhir-jpaserver-starter/target/jacoco.exec,excludes=ca/uhn/fhir/model/dstu2/**/*.class:ca/uhn/fhir/jpa/rp/r5/*.class:ca/uhn/fhir/jpa/rp/r4/*.class:ca/uhn/fhir/jpa/rp/r4b/*.class:ca/uhn/fhir/jpa/rp/dstu3/*.class:ca/uhn/fhir/jpa/rp/dstu2/*.class,dumponexit=true
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # hapi-fhir-jpaserver-starter ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # hapi-fhir-jpaserver-starter ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 31 source files to /root/hapi-fhir-jpaserver-starter/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.158 s
[INFO] Finished at: 2022-11-21T15:39:38Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project hapi-fhir-jpaserver-starter: Compilation failure -> [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:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

How to force Maven to download all test plugins without running any test?

Problem:
We have an internal company Artifactory server for our Maven dependencies. We have a dedicated Maven project with test cases and some of our internal libraries are used in this project. The Artifactory server is reachable from our CI so all the artifacts can be pulled during build process.
Our goal is to run the tests from that project in Docker container in a private cluster without access to internal repository - for practical purposes, we can assume that mvn test is invoked offline.
That means that as part of the build process, I want to package test project and all required dependencies into an Docker image so that I can run tests safely in offline environment without need to pull anything.
My approach:
The current approach is to make sure that .m2 repo is part of the image and then invoke this command in Dockerfile:
mvn clean install -DskipTests
The command downloads many Maven plugins (so that they are in .m2/repository now).
Then in the test environment I invoke:
mvn test -o
However, the latter command produces error when running the container:
[INFO] Scanning for projects...
(...)
[INFO]
[INFO] Building test-project 1.0.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # test-project ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /workspace/test-project/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # test-project ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # test-project ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # test-project ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) # test-project ---
[WARNING] Missing POM for org.apache.maven.surefire:surefire-junit-platform:jar:2.22.2
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.908 s
[INFO] Finished at: 2019-12-12T07:43:40Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project test-project: Unable to generate classpath: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException: Missing:
[ERROR] ----------
[ERROR] 1) org.apache.maven.surefire:surefire-junit-platform:jar:2.22.2
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.apache.maven.surefire -DartifactId=surefire-junit-platform -Dversion=2.22.2 -Dpackaging=jar -Dfile=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=org.apache.maven.surefire -DartifactId=surefire-junit-platform -Dversion=2.22.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR]
[ERROR] Path to dependency:
[ERROR] 1) dummy:dummy:jar:1.0
[ERROR] 2) org.apache.maven.surefire:surefire-junit-platform:jar:2.22.2
[ERROR]
[ERROR] ----------
[ERROR] 1 required artifact is missing.
[ERROR]
[ERROR] for artifact:
[ERROR] dummy:dummy:jar:1.0
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] central (http://company-repo.org/artifactory/plugins-release, releases=true, snapshots=false),
[ERROR] snapshots (http://company-repo.org.org/artifactory/plugins-snapshot, releases=true, snapshots=true)
[ERROR]
[ERROR] -> [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:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
I'm not sure if dummy.jar is part of my project setup but I think that error can be ignored.
It seems to me that org.apache.maven.surefire:surefire-junit-platform plugin is not available. And when I looked at the build command output I confirmed that it succeeds without ever invoking this plugin (and so without ever pulling it to local repository):
mvn clean install -DskipTests
(...)
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) # test-project ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # test-project ---
(...)
So the problem is: how do I prepare Maven to run tests in "offline" mode without actually running the tests?
I could run all the tests in the build command, but it would waste a lot of time and results are useless anyway (tests only produce meaningful results in isolated cluster)
I tried to use option -Dtest with "match-nothing" pattern but the plugin wasn't pulled (apparently it activates only if there are some tests to run)
I tried mvn dependency:go-offline which pulled in hundreds of dependencies but not those for test
I could add explicit dependency to all test plugins in my pom.xml but it would become maintenance burden (difficult version upgrade, possibly multiple plugins required etc.)
Have a look to https://github.com/qaware/go-offline-maven-plugin, maybe it can help. It has been developed to fix some issues of the maven-dependency-plugin.

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project daily-installer:

I am getting permission denied error. I have given permission to the folder as well. I have checked all over in Stack Overflow and nothing seems to be working. When I close and open Eclipse it works on Eclipse. The environment that I am using is Ubuntu 18.
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building daily-installer 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-io:commons-io:jar:1.3.2
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # daily-installer ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/yellowfin/Downloads/story-master/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) # daily-installer ---
[WARNING] Attempt to (de-)serialize anonymous class hudson.maven.reporters.MavenArtifactArchiver$2; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[WARNING] Attempt to (de-)serialize anonymous class hudson.maven.reporters.MavenFingerprinter$1; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.964 s
[INFO] Finished at: 2018-10-03T12:30:58+10:00
[INFO] Final Memory: 18M/399M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project daily-installer: Error while storing the mojo status: /home/yellowfin/Downloads/story-master/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst (Permission denied) -> [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.
[JENKINS] Archiving /home/yellowfin/Downloads/story-master/pom.xml to com.yellowfin.installer/daily-installer/0.0.1-SNAPSHOT/daily-installer-0.0.1-SNAPSHOT.pom
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
/home/yellowfin/Downloads/story-master/pom.xml is not inside /var/lib/jenkins/workspace/Story Regression Automation/home/yellowfin/Downloads/story-master/; will archive in a separate pass
channel stopped
ERROR: Failed to parse POMs
java.nio.file.NoSuchFileException: /var/lib/jenkins/workspace/Story Regression Automation/home/yellowfin/Downloads/story-master/pom.xml
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at hudson.FilePath.read(FilePath.java:1973)
at jenkins.plugins.maveninfo.extractor.properties.PomPropertiesFinder.findProperties(PomPropertiesFinder.java:50)
at jenkins.plugins.maveninfo.extractor.MavenInfoExtractor.extract(MavenInfoExtractor.java:58)
at jenkins.plugins.maveninfo.extractor.MavenInfoEnvironment.tearDown(MavenInfoEnvironment.java:42)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:908)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
at hudson.model.Run.execute(Run.java:1815)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE
Update
I have given permission again and now I am getting the following error
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building daily-installer 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-io:commons-io:jar:1.3.2
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # daily-installer ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/yellowfin/Downloads/story-master/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) # daily-installer ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 10 source files to /home/yellowfin/Downloads/story-master/target/classes
[WARNING] Attempt to (de-)serialize anonymous class hudson.maven.reporters.MavenArtifactArchiver$2; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[WARNING] Attempt to (de-)serialize anonymous class hudson.maven.reporters.MavenFingerprinter$1; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.915 s
[INFO] Finished at: 2018-10-03T13:59:12+10:00
[INFO] Final Memory: 18M/398M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project daily-installer: Compilation failure -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[JENKINS] Archiving /home/yellowfin/Downloads/story-master/pom.xml to com.yellowfin.installer/daily-installer/0.0.1-SNAPSHOT/daily-installer-0.0.1-SNAPSHOT.pom
/home/yellowfin/Downloads/story-master/pom.xml is not inside /var/lib/jenkins/workspace/Story Regression Automation/home/yellowfin/Downloads/story-master/; will archive in a separate pass
[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:
ERROR: Failed to parse POMs
java.nio.file.NoSuchFileException: /var/lib/jenkins/workspace/Story Regression Automation/home/yellowfin/Downloads/story-master/pom.xml
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at hudson.FilePath.read(FilePath.java:1973)
at jenkins.plugins.maveninfo.extractor.properties.PomPropertiesFinder.findProperties(PomPropertiesFinder.java:50)
at jenkins.plugins.maveninfo.extractor.MavenInfoExtractor.extract(MavenInfoExtractor.java:58)
at jenkins.plugins.maveninfo.extractor.MavenInfoEnvironment.tearDown(MavenInfoEnvironment.java:42)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:908)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
at hudson.model.Run.execute(Run.java:1815)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
channel stopped
Finished: FAILURE
when I run mvn clean it is displaying permission error again. I am not sure how to address this problem.
Please see the folder structure below
Here is my Jenkins screenshot. Thanks
Now I am getting the following error
[INFO] ------------------------------------------------------------------------
[WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-io:commons-io:jar:1.3.2
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # daily-installer ---
[INFO] Deleting /home/yellowfin/Downloads/story-master/target
[WARNING] Attempt to (de-)serialize anonymous class hudson.maven.reporters.MavenArtifactArchiver$2; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[WARNING] Attempt to (de-)serialize anonymous class hudson.maven.reporters.MavenFingerprinter$1; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.570 s
[INFO] Finished at: 2018-10-04T08:49:09+10:00
[INFO] Final Memory: 17M/399M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project daily-installer: Failed to clean project: Failed to delete /home/yellowfin/Downloads/story-master/target/test-classes/Yellowfin/bi/qa/testcases/TimelinePageTest.class -> [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]
[JENKINS] Archiving /home/yellowfin/Downloads/story-master/pom.xml to com.yellowfin.installer/daily-installer/0.0.1-SNAPSHOT/daily-installer-0.0.1-SNAPSHOT.pom
/home/yellowfin/Downloads/story-master/pom.xml is not inside /var/lib/jenkins/workspace/Story Regression Automation/home/yellowfin/Downloads/story-master/; will archive in a separate pass
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
ERROR: Failed to parse POMs
java.nio.file.NoSuchFileException: /var/lib/jenkins/workspace/Story Regression Automation/home/yellowfin/Downloads/story-master/pom.xml
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at hudson.FilePath.read(FilePath.java:1973)
at jenkins.plugins.maveninfo.extractor.properties.PomPropertiesFinder.findProperties(PomPropertiesFinder.java:50)
at jenkins.plugins.maveninfo.extractor.MavenInfoExtractor.extract(MavenInfoExtractor.java:58)
at jenkins.plugins.maveninfo.extractor.MavenInfoEnvironment.tearDown(MavenInfoEnvironment.java:42)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:908)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
at hudson.model.Run.execute(Run.java:1815)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
channel stopped
Finished: FAILURE
Assuming Story Regression Automation is the name of a Jenkins Job which builds Story-Automation project picking it either from Disk or and any Version Control tool, Root POM location of the Build step should be pom.xml and not /home/yellowfin/Downloads/story-master/pom.xml

Cannot find class and SurefireBooterForkException while executing from command prompt

While running from command prompt using mvn clean install command getting above error.
Cannot find class in classpath: com.test.selenium.TestHello
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
Complete stack trace:
enter code here
Skip to content
titletitle
search
6
Manage
Dismiss
You have data stored in an older format and/or unreadable data.
Disable CLI over Remoting
Dismiss
Allowing Jenkins CLI to work in -remoting mode is considered dangerous and usually unnecessary. You are advised to disable this mode. Please refer to the CLI documentation for details.
Setup Security
Dismiss
Jenkins is currently unsecured and allows anyone on the network to launch processes on your behalf. It is recommended to set up security and to limit anonymous access even on private networks.
Go to plugin manager
Configure which of these warnings are shown
Warnings have been published for the following currently installed components.
Matrix Authorization Strategy Plugin 1.1
Dangerous permissions can be configured independently of Administer permission
Subversion Plug-in 1.54
CSRF vulnerability and insufficient permission checks allow capturing credentials
Users without Overall/Read are able to access lists of user names and node names
SSH Slaves plugin 1.9
Man-in-the-middle vulnerability due to missing host key verification
Ant Plugin 1.2
Cross-site scripting (XSS) vulnerability
Translation Assistance plugin 1.10
Cross-site request forgery (CSRF) vulnerability
Dismiss
You have not configured the CSRF issuer. This could be a security issue. For more information, please refer to this page.
You can change the current configuration using the Security section CSRF Protection.
This Jenkins instance uses deprecated protocols: CLI-connect,CLI2-connect,JNLP-connect,JNLP2-connect. It may impact stability of the instance. If newer protocol versions are supported by all system components (agents, CLI and other clients), it is highly recommended to disable the deprecated protocols. See Protocol Configuration.
Manage Jenkins
Jenkins
TestMaven
#11
Back to Project
Status
Changes
Console Output
View as plain text
Edit Build Information
Delete Build
Git Build Data
No Tags
Redeploy Artifacts
See Fingerprints
Previous Build
SuccessConsole Output
Started by user unknown or anonymous
Building in workspace /Users/i339884/.jenkins/jobs/TestMaven/workspace
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/sreekumarthesun/selenium # timeout=10
Fetching upstream changes from https://github.com/sreekumarthesun/selenium
> git --version # timeout=10
> git fetch --tags --progress https://github.com/sreekumarthesun/selenium +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision d0cde4d90c2accf2574411d0d46d5dd1ba0d6e07 (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f d0cde4d90c2accf2574411d0d46d5dd1ba0d6e07
Commit message: "first checkin"
> git rev-list --no-walk d0cde4d90c2accf2574411d0d46d5dd1ba0d6e07 # timeout=10
Parsing POMs
Established TCP socket on 59031
[com.ariba.selenium] $ /ariba/s6053/ariba/3rdParty/jdk/Darwin/1.8.0/bin/java -cp /Users/i339884/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.12-alpha-1.jar:/Users/i339884/Desktop/selenium/Selenium/softwares/apache-maven-3.5.2/boot/plexus-classworlds-2.5.2.jar:/Users/i339884/Desktop/selenium/Selenium/softwares/apache-maven-3.5.2/conf/logging jenkins.maven3.agent.Maven35Main /Users/i339884/Desktop/selenium/Selenium/softwares/apache-maven-3.5.2 /Users/i339884/.jenkins/war/WEB-INF/lib/remoting-3.20.jar /Users/i339884/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-interceptor-1.12-alpha-1.jar /Users/i339884/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.12-alpha-1.jar 59031
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f /Users/i339884/Documents/maven/com.ariba.selenium/pom.xml clean install
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.ariba.selenium:com.ariba.selenium:jar:1.0.0
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. # line 40, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building com.ariba.selenium 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # com.ariba.selenium ---
[INFO] Deleting /Users/i339884/Documents/maven/com.ariba.selenium/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # com.ariba.selenium ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/i339884/Documents/maven/com.ariba.selenium/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # com.ariba.selenium ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # com.ariba.selenium ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/i339884/Documents/maven/com.ariba.selenium/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # com.ariba.selenium ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.21.0:test (default-test) # com.ariba.selenium ---
[INFO] No tests to run.
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running TestSuite
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[ERROR] There are test failures.
Please refer to /Users/i339884/Documents/maven/com.ariba.selenium/target/surefire-reports for the individual test results.
Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
There was an error in the forked process
Cannot find class in classpath: com.test.selenium.TestHello
org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
Cannot find class in classpath: com.test.selenium.TestHello
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:658)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:278)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:244)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1149)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:978)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:854)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
at org.jvnet.hudson.maven3.launcher.Maven35Launcher.main(Maven35Launcher.java:130)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at jenkins.maven3.agent.Maven35Main.launch(Maven35Main.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
at hudson.remoting.UserRequest.perform(UserRequest.java:212)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:369)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[JENKINS] Recording test results
[WARNING] Attempt to (de-)serialize anonymous class hudson.maven.reporters.BuildInfoRecorder$1; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # com.ariba.selenium ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: /Users/i339884/Documents/maven/com.ariba.selenium/target/com.ariba.selenium-1.0.0.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # com.ariba.selenium ---
[INFO] Installing /Users/i339884/Documents/maven/com.ariba.selenium/target/com.ariba.selenium-1.0.0.jar to /Users/i339884/.m2/repository/com/ariba/selenium/com.ariba.selenium/1.0.0/com.ariba.selenium-1.0.0.jar
[INFO] Installing /Users/i339884/Documents/maven/com.ariba.selenium/pom.xml to /Users/i339884/.m2/repository/com/ariba/selenium/com.ariba.selenium/1.0.0/com.ariba.selenium-1.0.0.pom
[WARNING] Attempt to (de-)serialize anonymous class hudson.maven.reporters.MavenArtifactArchiver$2; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[WARNING] Attempt to (de-)serialize anonymous class hudson.maven.reporters.MavenFingerprinter$1; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.305 s
[INFO] Finished at: 2018-05-12T10:56:23+05:30
[INFO] Final Memory: 17M/265M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /Users/i339884/Documents/maven/com.ariba.selenium/pom.xml to com.ariba.selenium/com.ariba.selenium/1.0.0/com.ariba.selenium-1.0.0.pom
[JENKINS] Archiving /Users/i339884/Documents/maven/com.ariba.selenium/target/com.ariba.selenium-1.0.0.jar to com.ariba.selenium/com.ariba.selenium/1.0.0/com.ariba.selenium-1.0.0.jar
/Users/i339884/Documents/maven/com.ariba.selenium/pom.xml is not inside /Users/i339884/.jenkins/jobs/TestMaven/workspace/Users/i339884/Documents/maven/com.ariba.selenium/; will archive in a separate pass
/Users/i339884/Documents/maven/com.ariba.selenium/target/com.ariba.selenium-1.0.0.jar is not inside /Users/i339884/.jenkins/jobs/TestMaven/workspace/Users/i339884/Documents/maven/com.ariba.selenium/; will archive in a separate pass
channel stopped
[htmlpublisher] Archiving HTML reports...
[htmlpublisher] Archiving at PROJECT level /Users/i339884/.jenkins/jobs/TestMaven/workspace to /Users/i339884/.jenkins/jobs/TestMaven/htmlreports/Extent_20Html_20Report
TestNG Reports Processing: START
Looking for TestNG results report in workspace using pattern: **/testng-results.xml
testng-results.xml was last modified before this build started. Ignoring it.
Saving reports...
Found matching files but did not find any TestNG results.
Finished: SUCCESS
Help us localize this page Page generated: 14-May-2018 11:30:34 ISTREST APIJenkins ver. 2.121
This error getting while running maven project from command versions.
I am suspecting java class files are not generating properly while running from Maven
I had the similar issue while running the tests on Jenkins. In my local, all tests were running fine but Jenkins was giving me this error as all the plugins and dependencies had to be installed manually behind my company firewall.
Initially I only used Maven Surefire Plugin 3.0.0-M3 which gave me error. Then I had to add a dependency "surefire-testng" version 3.0.0-M3 and solved it.

GitLab Runner No Compiler

need some help to help to solve this issue.
Iam running my gitlab ci, to test my maven project, everthing ist working fine but when its starting to compiling/building/installing following error recieves:
Running with gitlab-runner 10.5.0 (80b03db9)
on RolfsRunner 7d39f8f7
Using Shell executor...
Running on ISC-PRAKTIKANT...
Fetching changes...
Removing target/
HEAD is now at a7189518 7.2
Checking out a7189518 as rolf...
Skipping Git submodules setup
Checking cache for default...
Successfully extracted cache
$ cd C:\Program Files\GitLab-Runner\builds\7d39f8f7\0\dev\imsPlatform & mvn compile
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for de.immersight:imsPlatform:war:1.0
[WARNING] 'dependencies.dependency.systemPath' for immersight:imsLibrary:jar should use a variable instead of a hard-coded path C:\Users\Rolf\Desktop\imsLibrary-1.0.jar # line 59, column 19
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ---------------------< de.immersight:imsPlatform >----------------------
[INFO] Building imsPlatform 1.0
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # imsPlatform ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Program Files\GitLab-Runner\builds\7d39f8f7\0\dev\imsPlatform\de\immersight\stats\database\versions
[INFO] Copying 1 resource
[INFO] Copying 154 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # imsPlatform ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 172 source files to C:\Program Files\GitLab-Runner\builds\7d39f8f7\0\dev\imsPlatform\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.769 s
[INFO] Finished at: 2018-03-13T13:05:58+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project imsPlatform: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR]
[ERROR] -> [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:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Running after script...
$ echo CI_ENVIRONMENT_NAME
CI_ENVIRONMENT_NAME
ERROR: Job failed: exit status 1
My eclipse and windows cmd compiling fine without problems everthing is installed and all environment variables are set:
C:\Users\Rolf>mvn -version
Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T20:49:05+01:00)
Maven home: C:\Users\Rolf\Maven-3.5.3\bin\..
Java version: 1.8.0_161, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_161\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
C:\Users\Rolf>javac -version
javac 1.8.0_161
I had the same problem. After installing a JDK and editing the environment variables I had to restart my gitlab-runner with administrator privileges.
gitlab-runner.exe restart
May not interesting for you anymore ;)

Resources