Error parsing POM File using Maven in Jenkins - java

So I've been trying to run my Selenium tests using Jenkins.
I created a Maven project, and set the correct POM.xlm pathfile (At least it's what I'm almost certain)
And I continue to get an error at parsing the POM file saying the file is not present in the file path.
The project does work if maven run it from console or eclipse ide.
Here's the stacktrace of the error given by Jenknins.
Building in workspace /Users/Shared/Jenkins/Home/workspace/Pagode
Parsing POMs
Discovered a new module com.hugomonteiro:PagodeAutomatedTests PagodeAutomatedTests
Modules changed, recalculating dependency graph
Established TCP socket on 50661
[PagodeAutomatedTests] $ /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin/java -cp /Users/Shared/Jenkins/Home/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.12-alpha-1.jar:/usr/local/Cellar/maven/3.5.4/libexec/boot/plexus-classworlds-2.5.2.jar:/usr/local/Cellar/maven/3.5.4/libexec/conf/logging jenkins.maven3.agent.Maven35Main /usr/local/Cellar/maven/3.5.4/libexec /Users/Shared/Jenkins/Home/war/WEB-INF/lib/remoting-3.25.jar /Users/Shared/Jenkins/Home/plugins/maven-plugin/WEB-INF/lib/maven35-interceptor-1.12-alpha-1.jar /Users/Shared/Jenkins/Home/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.12-alpha-1.jar 50661
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f /Users/hugomonteiro/eclipse-workspace/PagodeAutomatedTests/pom.xml test
[INFO] Scanning for projects...
[HUDSON] Collecting dependencies info
[INFO]
[INFO] ---------------< com.hugomonteiro:PagodeAutomatedTests >----------------
[INFO] Building PagodeAutomatedTests 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for org.testng:testng:jar:5.14.3 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.beust:jcommander:jar:1.66 is missing, no dependency information available
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # PagodeAutomatedTests ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # PagodeAutomatedTests ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # PagodeAutomatedTests ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # PagodeAutomatedTests ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) # PagodeAutomatedTests ---
[INFO] Surefire report directory: /Users/hugomonteiro/eclipse-workspace/PagodeAutomatedTests/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running TestSuite
Starting ChromeDriver 2.42.591059 (a3d9684d10d61aa0c45f6723b327283be1ebaad8) on port 21561
Only local connections are allowed.
Oct 12, 2018 5:26:39 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 15.043 sec <<< FAILURE! - in TestSuite
doLoginTest(testcases.LoginTest) Time elapsed: 10.681 sec <<< FAILURE!
org.openqa.selenium.TimeoutException: Expected condition failed: waiting for visibility of [[ChromeDriver: chrome on MAC (6cf1ac936bdb4be38c29d55651ee5c6b)] -> css selector: [class='fa fa-fw fa-caret-down']] (tried for 10 second(s) with 500 milliseconds interval)
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z'
System info: host: 'Hugos-MacBook-Pro.local', ip: 'fe80:0:0:0:858:ef39:e614:659a%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.6', java.version: '1.8.0_181'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: false, acceptSslCerts: false, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.42.591059 (a3d9684d10d61a..., userDataDir: /var/folders/9l/55xyqdlx7gl...}, cssSelectorsEnabled: true, databaseEnabled: false, goog:chromeOptions: {debuggerAddress: localhost:50670}, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: MAC, platformName: MAC, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: , unhandledPromptBehavior: , version: 69.0.3497.100, webStorageEnabled: true}
Session ID: 6cf1ac936bdb4be38c29d55651ee5c6b
at org.openqa.selenium.support.ui.WebDriverWait.timeoutException(WebDriverWait.java:113)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:283)
at pages.actions.LoginActions.selectLanguage(LoginActions.java:40)
at pages.actions.LoginActions.doLogin(LoginActions.java:26)
at testcases.LoginTest.doLoginTest(LoginTest.java:21)
Results :
Failed tests:
LoginTest.doLoginTest:21 » Timeout Expected condition failed: waiting for visi...
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
[JENKINS] Recording test results
[WARNING] Attempt to (de-)serialize anonymous class hudson.maven.reporters.SurefireArchiver$2; see: https://jenkins.io/redirect/serialization-of-anonymous-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 org.jfrog.hudson.maven2.MavenDependenciesRecorder$1; 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: 20.760 s
[INFO] Finished at: 2018-10-12T17:26:54+01:00
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project PagodeAutomatedTests: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/hugomonteiro/eclipse-workspace/PagodeAutomatedTests/target/surefire-reports for the individual test results.
[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.
[JENKINS] Archiving /Users/hugomonteiro/eclipse-workspace/PagodeAutomatedTests/pom.xml to com.hugomonteiro/PagodeAutomatedTests/0.0.1-SNAPSHOT/PagodeAutomatedTests-0.0.1-SNAPSHOT.pom
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
/Users/hugomonteiro/eclipse-workspace/PagodeAutomatedTests/pom.xml is not inside /Users/Shared/Jenkins/Home/workspace/Pagode/Users/hugomonteiro/eclipse-workspace/PagodeAutomatedTests/; will archive in a separate pass
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
ERROR: Failed to parse POMs
java.nio.file.NoSuchFileException: /Users/Shared/Jenkins/Home/workspace/Pagode/Users/hugomonteiro/eclipse-workspace/PagodeAutomatedTests/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:1819)
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
Any help would be excelent.
Thanks in advance !

Ok so the problem was :
I was hardcoding the pom file from the eclipse workspace directly to the Jenkins pom file path and this is wrong.
How I fixed with chrylis help :
Moved the project folder to the Jenkins workspace and gave the path from that directory and it worked just fine.

Related

my cosole log showing running as system , but i want to chrome browser to open and run the script

I am using Jenkins and applying the window batch command to execute, my build is successful but somehow it is not opening the chrome browser to execute my script, i am sharing my console output and it says its successful not sure where the problem, i have applied all the required plugins and other important code in pom file , will appreciate any help
Started by user admin
Running as SYSTEM
Building in workspace C:\ProgramData\Jenkins\.jenkins\workspace\TestProject1
[TestProject1] $ cmd /c call C:\Users\WRP\AppData\Local\Temp\jenkins17301363669897190864.bat
C:\ProgramData\Jenkins\.jenkins\workspace\TestProject1>c:
C:\ProgramData\Jenkins\.jenkins\workspace\TestProject1>cd C:\Users\WRP\eclipse-workspace\PracticeProject
C:\Users\WRP\eclipse-workspace\PracticeProject>mvn clean test
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------< com.NewPractice.org:PracticeProject >-----------------
[INFO] Building PracticeProject 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # PracticeProject ---
[INFO] Deleting C:\Users\WRP\eclipse-workspace\PracticeProject\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # PracticeProject ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # PracticeProject ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # PracticeProject ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # PracticeProject ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 4 source files to C:\Users\WRP\eclipse-workspace\PracticeProject\target\test-classes
[WARNING] /C:/Users/WRP/eclipse-workspace/PracticeProject/src/test/java/First_Test/Practice_Arabic.java:[64,77] unmappable character (0x8F) for encoding windows-1252
[WARNING] /C:/Users/WRP/eclipse-workspace/PracticeProject/src/test/java/First_Test/Practice_Arabic.java:[76,76] unmappable character (0x81) for encoding windows-1252
[WARNING] /C:/Users/WRP/eclipse-workspace/PracticeProject/src/test/java/First_Test/Practice_Arabic.java:[93,78] unmappable character (0x81) for encoding windows-1252
[WARNING] /C:/Users/WRP/eclipse-workspace/PracticeProject/src/test/java/First_Test/Practice_Arabic.java:[132,96] unmappable character (0x81) for encoding windows-1252
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M7:test (default-test) # PracticeProject ---
[INFO] Using auto detected provider org.apache.maven.surefire.testng.TestNGProvider
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running TestSuite
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Starting ChromeDriver 103.0.5060.53 (a1711811edd74ff1cf2150f36ffa3b0dae40b17f-refs/branch-heads/5060#{#853}) on port 55115
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Jul 06, 2022 11:05:45 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected upstream dialect: W3C
Jul 06, 2022 11:05:45 AM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
INFO: Found exact CDP implementation for version 103
Test was executed
Jul 06, 2022 11:06:49 AM org.openqa.selenium.remote.http.WebSocket$Listener onError
WARNING: Connection reset
java.net.SocketException: Connection reset
at java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(SocketChannelImpl.java:394)
at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:426)
at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:258)
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132)
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:357)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:833)
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 68.373 s - in TestSuite
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:20 min
[INFO] Finished at: 2022-07-06T11:06:50+05:00
[INFO] ------------------------------------------------------------------------
Finished: SUCCESS

Build fails in jenkins for java which is in Azure repo

I have configured the project in Azure Repo and Jenkins VM but when I start Build of that java project in jenkins, it fails. Please help me to resolve the issue. Jenkins console output below. Integration between Azure Repo and Jenkins was successful but when I try to click on Build Now in Jenkins it fails.
Java Project is in Azure Repo,
Jenkins is in Azure cloud vm (Ready plugins available by Azure)
Started by user user
Running as SYSTEM
Building in workspace /bitnami/jenkins/home/workspace/MyShuttle
The recommended git tool is: NONE
using credential 04536115-8271-469c-9196-66fa633da13a
> git rev-parse --resolve-git-dir /bitnami/jenkins/home/workspace/MyShuttle/.git # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://cloudera2019#dev.azure.com/cloudera2019/MyShuttle/_git/MyShuttle # timeout=10
Fetching upstream changes from https://cloudera2019#dev.azure.com/cloudera2019/MyShuttle/_git/MyShuttle
> git --version # timeout=10
> git --version # 'git version 2.35.1'
using GIT_ASKPASS to set credentials
> git fetch --tags --force --progress -- https://cloudera2019#dev.azure.com/cloudera2019/MyShuttle/_git/MyShuttle +refs/heads/*:refs/remotes/origin/* # timeout=10
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
Checking out Revision c481534e99083921a6ff50e07bed72b1f6855a93 (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f c481534e99083921a6ff50e07bed72b1f6855a93 # timeout=10
Commit message: "Added CreateMYSQLDB.sql"
> git rev-list --no-walk c481534e99083921a6ff50e07bed72b1f6855a93 # timeout=10
Parsing POMs
Established TCP socket on 33515
[MyShuttle] $ java -cp /bitnami/jenkins/home/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.13.jar:/bitnami/jenkins/home/tools/hudson.tasks.Maven_MavenInstallation/maven/boot/plexus-classworlds-2.6.0.jar:/bitnami/jenkins/home/tools/hudson.tasks.Maven_MavenInstallation/maven/conf/logging jenkins.maven3.agent.Maven35Main /bitnami/jenkins/home/tools/hudson.tasks.Maven_MavenInstallation/maven /bitnami/jenkins/home/war/WEB-INF/lib/remoting-4.11.2.jar /bitnami/jenkins/home/plugins/maven-plugin/WEB-INF/lib/maven35-interceptor-1.13.jar /bitnami/jenkins/home/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.13.jar 33515
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f /bitnami/jenkins/home/workspace/MyShuttle/pom.xml package -Dtest=FaresTest,SimpleTest
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< com.microsoft.example:myshuttle >-------------------
[INFO] Building myshuttle 0.0.1
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.9:prepare-agent (default) # myshuttle ---
[WARNING] The artifact xml-apis:xml-apis:jar:2.0.2 has been relocated to xml-apis:xml-apis:jar:1.0.b2
[INFO] argLine set to -javaagent:/bitnami/jenkins/home/.m2/repository/org/jacoco/org.jacoco.agent/0.7.9/org.jacoco.agent-0.7.9-runtime.jar=destfile=/bitnami/jenkins/home/workspace/MyShuttle/target/jacoco.exec
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # myshuttle ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /bitnami/jenkins/home/workspace/MyShuttle/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) # myshuttle ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # myshuttle ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /bitnami/jenkins/home/workspace/MyShuttle/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) # myshuttle ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # myshuttle ---
[INFO] Surefire report directory: /bitnami/jenkins/home/workspace/MyShuttle/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525)
Caused by: java.lang.RuntimeException: Class java/util/UUID could not be instrumented.
at org.jacoco.agent.rt.internal_8ff85ea.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:140)
at org.jacoco.agent.rt.internal_8ff85ea.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:101)
at org.jacoco.agent.rt.internal_8ff85ea.PreMain.createRuntime(PreMain.java:55)
at org.jacoco.agent.rt.internal_8ff85ea.PreMain.premain(PreMain.java:47)
... 6 more
Caused by: java.lang.NoSuchFieldException: $jacocoAccess
at java.base/java.lang.Class.getField(Class.java:1999)
at org.jacoco.agent.rt.internal_8ff85ea.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:138)
... 9 more
*** java.lang.instrument ASSERTION FAILED ***: "result" with message agent load/premain call failed at ./src/java.instrument/share/native/libinstrument/JPLISAgent.c line: 422
FATAL ERROR in native method: processing of -javaagent failed, processJavaStart failed
Aborted
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[JENKINS] Recording test results
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.070 s
[INFO] Finished at: 2022-02-28T09:25:11Z
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project myshuttle: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ? -> [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/PluginExecutionException
[JENKINS] Archiving /bitnami/jenkins/home/workspace/MyShuttle/pom.xml to com.microsoft.example/myshuttle/0.0.1/myshuttle-0.0.1.pom
channel stopped
Archiving artifacts
Finished: FAILURE
I could able to solve the issue by adding below xml in pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkCount>3</forkCount>
<reuseForks>true</reuseForks>
<argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
</configuration>
</plugin>

Cannot execute a simple maven project through jenkins

I'm using Linux - Ubuntu 14.04.
I've installed Jenkins 2.7.2.
I created a maven project in Eclipse and followed the instructions provided in this link http://www.guru99.com/maven-jenkins-with-selenium-complete-tutorial.html.
After completing the project setup, I executed it as Maven Project and the build was successful.
Then I installed Jenkins, installed Maven Integration Plugin, created a Maven Project and added the Root POM location and in 'Goals and options' field, I gave 'test' as input and executed the Build, but the Build was a failure.
The console output is as follows:
Started by user QA Admin
Building in workspace /var/lib/jenkins/workspace/WebDriverTest2
Parsing POMs
Established TCP socket on 58065
[WebdriverTest] $ java -Xms1024m -Xmx4096m -XX:PermSize=1024m -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven32-agent-1.7.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven/boot/plexus-classworlds-2.5.2.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven/conf/logging jenkins.maven3.agent.Maven32Main /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven /var/cache/jenkins/war/WEB-INF/lib/remoting-2.60.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven32-interceptor-1.7.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.7.jar 58065
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=1024m; support was removed in 8.0
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f /home/admin/workspace/WebdriverTest/pom.xml test
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WebdriverTest 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # WebdriverTest ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) # WebdriverTest ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # WebdriverTest ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) # WebdriverTest ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) # WebdriverTest ---
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[JENKINS] Recording test results
hudson.AbortException: Test reports were found but none of them are new. Did tests run?
For example, /home/admin/workspace/WebdriverTest/target/surefire-reports/TEST-TestSuite.xml is 23 min old
at hudson.tasks.junit.TestResult.parse(TestResult.java:228)
at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:148)
at hudson.maven.Maven3Builder$MavenExecutionListener.recordMojoEnded(Maven3Builder.java:634)
at hudson.maven.Maven3Builder$MavenExecutionListener.mojoFailed(Maven3Builder.java:667)
at hudson.maven.Maven3Builder$JenkinsEventSpy.onEvent(Maven3Builder.java:311)
at org.apache.maven.eventspy.internal.EventSpyDispatcher.onEvent(EventSpyDispatcher.java:104)
at org.apache.maven.eventspy.internal.EventSpyExecutionListener.mojoFailed(EventSpyExecutionListener.java:138)
at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:90)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:219)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
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:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.jvnet.hudson.maven3.launcher.Maven32Launcher.main(Maven32Launcher.java:132)
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.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven32Main.launch(Maven32Main.java:186)
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:136)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:71)
at hudson.remoting.UserRequest.perform(UserRequest.java:153)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
at hudson.remoting.Request$2.run(Request.java:332)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
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)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.097 s
[INFO] Finished at: 2016-08-25T17:16:17+05:30
[INFO] Final Memory: 18M/981M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project WebdriverTest: Error creating properties files for forking: No such file or directory -> [Help 1]
[JENKINS] Archiving /home/admin/workspace/WebdriverTest/pom.xml to WebdriverTest/WebdriverTest/0.0.1-SNAPSHOT/WebdriverTest-0.0.1-SNAPSHOT.pom
[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
/home/admin/workspace/WebdriverTest/pom.xml is not inside /var/lib/jenkins/workspace/WebDriverTest2/home/admin/workspace/WebdriverTest/; will archive in a separate pass
channel stopped
Finished: FAILURE
Any help is greatly appreciated. Please help. Thanks in advance.
It looks like you may have given an absolute path to the pom file. At the top Maven logs
Building in workspace /var/lib/jenkins/workspace/WebDriverTest2
And at the end you can see
/home/admin/workspace/WebdriverTest/pom.xml is not inside /var/lib/jenkins/workspace/WebDriverTest2/home/admin/workspace/WebdriverTest/; will archive in a separate pass
So if what I'm thinking is correct, you just need to change the "Root POM" parameter. Give it a relative path to the pom.xml from the project's root directory. So if your project is
WebDriverTest
src/main/java
src/test/java
...
pom.xml
The "Root POM" parameter should just be pom.xml

Jenkins cannot start chrome driver - Selenium Maven

I have written an automation test script using Selenium WebDriver which will open up a browser and navigate to a site and then close the browser.
This is a Maven Project and since I use Eclipse, I am able to execute the project with 'Run As' -> 'Maven Test' and the project gets executed and the Build is Success in console.
But when I try to execute this same project through Jenkins, Jenkins cannot start the chromedriver.
Below is the console output:
Started by user QA Admin
Building in workspace /var/lib/jenkins/workspace/WebDriverTest2
Parsing POMs
Modules changed, recalculating dependency graph
Established TCP socket on 42178
[WebdriverTest] $ java -Xms1024m -Xmx4096m -XX:PermSize=1024m -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven32-agent-1.7.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven/boot/plexus-classworlds-2.5.2.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven/conf/logging jenkins.maven3.agent.Maven32Main /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven /var/cache/jenkins/war/WEB-INF/lib/remoting-2.60.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven32-interceptor-1.7.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.7.jar 42178
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=1024m; support was removed in 8.0
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f /home/admin/workspace/WebdriverTest/pom.xml test
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WebdriverTest 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # WebdriverTest ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) # WebdriverTest ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # WebdriverTest ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) # WebdriverTest ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) # WebdriverTest ---
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running TestSuite
Starting ChromeDriver 2.23.409687 (c46e862757edc04c06b1bd88724d15a5807b84d1) on port 13012
Only local connections are allowed.
Tests run: 3, Failures: 1, Errors: 0, Skipped: 2, Time elapsed: 61.125 sec <<< FAILURE! - in TestSuite
beforeTest(example.NewTest) Time elapsed: 61.027 sec <<< FAILURE!
org.openqa.selenium.WebDriverException:
unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.23.409687 (c46e862757edc04c06b1bd88724d15a5807b84d1),platform=Linux 3.16.0-77-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.22 seconds
Build info: version: '2.53.1', revision: 'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30 19:26:09'
System info: host: 'AZDTPDE-L2', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.16.0-77-generic', java.version: '1.8.0_101'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at example.NewTest.beforeTest(NewTest.java:31)
Results :
Failed tests:
NewTest.beforeTest:31 » WebDriver unknown error: Chrome failed to start: exite...
Tests run: 3, Failures: 1, Errors: 0, Skipped: 2
[ERROR] There are test failures.
Please refer to /home/admin/workspace/WebdriverTest/target/surefire-reports for the individual test results.
[JENKINS] Recording test results
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:07 min
[INFO] Finished at: 2016-08-26T12:09:35+05:30
[INFO] Final Memory: 28M/1059M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /home/admin/workspace/WebdriverTest/pom.xml to WebdriverTest/WebdriverTest/0.0.1-SNAPSHOT/WebdriverTest-0.0.1-SNAPSHOT.pom
/home/admin/workspace/WebdriverTest/pom.xml is not inside /var/lib/jenkins/workspace/WebDriverTest2/home/admin/workspace/WebdriverTest/; will archive in a separate pass
channel stopped
Finished: UNSTABLE
I'm using Ubuntu 14.04 OS.
Any help is greatly appreciated. Thanks in advance. Please help. Any help?

Maven with Surefire refuses to run single test method?

I've been trying to use Maven with the Surefire plugin to run some JUnit unit tests.
Following the instructions provided by Maven and the Surefire folks here: http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html
My command for maven is as follows:
mvn clean -Dtest-group=regression -Dtest=TestClass#testMethod test
TestGroup is pulled from an #IfProfileValue statement and has always worked:
#IfProfileValue(name = "test-group", values = {"regression"})
However after I run the command, despite being sure that testClass has a method named testMethod(which would run if I didn't add the #testMethod to the command) my output is as follows:
~/REPOS/app: mvn clean -Dtest-group=regression -Dtest=TestClass#testmethod test
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.app:GuiAuto:jar:0.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.twitter4j:twitter4j-core:jar -> version 2.2.4 vs [3.0,) # line 127, column 21
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. # line 147, 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 GuiAuto 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # GuiAuto ---
[INFO] Deleting /Users/llaskin/REPOS/app/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # GuiAuto ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 92 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # GuiAuto ---
[INFO] Compiling 762 source files to /Users/llaskin/REPOS/app/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # GuiAuto ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) # GuiAuto ---
[INFO] Compiling 762 source files to /Users/llaskin/REPOS/app/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.17:test (default-test) # GuiAuto ---
[INFO] Surefire report directory: /Users/llaskin/REPOS/app/target/surefire-reports
[INFO] parallel='classes', perCoreThreadCount=false, threadCount=5, useUnlimitedThreads=false, threadCountSuites=0, threadCountClasses=0, threadCountMethods=0, parallelOptimized=true
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.379s
[INFO] Finished at: Mon Nov 17 12:27:59 CST 2014
[INFO] Final Memory: 27M/571M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test (default-test) on project GuiAuto: No tests were executed! (Set -DfailIfNoTests=false to ignore this 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
Maybe this is because of the bug SUREFIRE-1028 in Surefire 2.16 and 2.17. This bug is fixed in Surefire 2.18.
Can you please upgrade and tell us whether your problem is fixed with Surefire 2.18 or not.

Categories

Resources