Pipeline Maven: Running on Windows slave

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Pipeline Maven: Running on Windows slave

Sverre Moe-2
I have connected a Windows slave to Jenkins with SSH+Cygwin.
So running shell scripts like "sh 'mvn'" should work as I do it locally on the Windows.

Running withMaven fails, and I cannot figure our why.

[Pipeline] node
Running on master-windows-x86_64 in /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Checkout-Windows)
[Pipeline] checkout
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url ssh://[hidden email]/software/myApp.git # timeout=10
Fetching without tags
Fetching upstream changes from ssh://[hidden email]/software/myApp.git
 > git --version # timeout=10
 > git fetch --no-tags --progress ssh://[hidden email]/software/myApp.git +refs/heads/*:refs/remotes/origin/*
Checking out Revision 05cf171deb903a01b5880c30de28d4b1865e3ed5 (username/work)
Commit message: "Test Windows build on Jenkins"
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 05cf171deb903a01b5880c30de28d4b1865e3ed5
 > git rev-list f9db8914f5688ca74e571dd1104c279f207bf435 # timeout=10
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build-Windows)
[Pipeline] withMaven
[withMaven] Options: []
[withMaven] Available options: 
[withMaven] use JDK installation jdk1.8
$ where mvn.cmd
[withMaven] use Maven installation provided by the build agent with executable C:\Users\username.POLAR\Downloads\apache-maven-3.3.9-bin\apache-maven-3.3.9\bin\mvn.cmd
[Pipeline] {
[Pipeline] sh
[myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ] Running shell script
sh: /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-ff9c24b3/pid: No such file or directory
sh: /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-ff9c24b3/jenkins-log.txt: No such file or directory
sh: /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-ff9c24b3/jenkins-result.txt: No such file or directory


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/8705f243-0417-459c-9627-e00ed7ebd314%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Pipeline Maven: Running on Windows slave

Sverre Moe-2
I took a look at the Maven Pipeline documentation again.
For Windows it says to use bat, not sh. I tried that, and got a little bit closer, but now it cannot find JAVA_HOME
----- withMaven Wrapper script -----

Error: JAVA_HOME is set to an invalid directory.
JAVA_HOME
= "/usr/java/jdk1.8.0_102"
Please set the JAVA_HOME variable in your environment to match the
location of your
Java installation.

Jenkins have jdk set at /usr/java/jdk1.8.0_102 and I have created a symlink in my Cygwin
jdk1.8.0_102 -> /cygdrive/c/Program Files/Java/jdk1.8.0_121
Windows environment variable JAVA_HOME is set to C:\Program Files\Java\jdk1.8.0_121

mandag 11. september 2017 08.07.21 UTC+2 skrev Sverre Moe følgende:
I have connected a Windows slave to Jenkins with SSH+Cygwin.
So running shell scripts like "sh 'mvn'" should work as I do it locally on the Windows.

Running withMaven fails, and I cannot figure our why.

[Pipeline] node
Running on master-windows-x86_64 in /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Checkout-Windows)
[Pipeline] checkout
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url ssh://<a href="http://git@git.company.com/software/myApp.git" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;">git@.../software/myApp.git # timeout=10
Fetching without tags
Fetching upstream changes from ssh://<a href="http://git@git.company.com/software/myApp.git" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;">git@.../software/myApp.git
 > git --version # timeout=10
 > git fetch --no-tags --progress ssh://<a href="http://git@git.company.com/software/myApp.git" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;">git@.../software/myApp.git +refs/heads/*:refs/remotes/origin/*
Checking out Revision 05cf171deb903a01b5880c30de28d4b1865e3ed5 (username/work)
Commit message: "Test Windows build on Jenkins"
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 05cf171deb903a01b5880c30de28d4b1865e3ed5
 > git rev-list f9db8914f5688ca74e571dd1104c279f207bf435 # timeout=10
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build-Windows)
[Pipeline] withMaven
[withMaven] Options: []
[withMaven] Available options: 
[withMaven] use JDK installation jdk1.8
$ where mvn.cmd
[withMaven] use Maven installation provided by the build agent with executable C:\Users\username.POLAR\Downloads\apache-maven-3.3.9-bin\apache-maven-3.3.9\bin\mvn.cmd
[Pipeline] {
[Pipeline] sh
[myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ] Running shell script
sh: /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-ff9c24b3/pid: No such file or directory
sh: /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-ff9c24b3/jenkins-log.txt: No such file or directory
sh: /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-ff9c24b3/jenkins-result.txt: No such file or directory


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/96c3a3ff-30c5-4646-991c-495c529657aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Pipeline Maven: Running on Windows slave

Sverre Moe-2
Well, adding a new JDK in Jenkins Tools pointing to the Windows path of Java worked
Then withMaven(jdk: "jdk1.8-win")

I have though hit another snag. Lots of ERROR after build success.
ERROR: [withMaven] WARNING: Exception archiving and fingerprinting MavenArtifact{no.spacetec:myApp:jar:1.0.0-SNAPSHOT C:\home\username\workspace\myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ\target\myApp-1.0.0-SNAPSHOT.jar}, skip archiving of the artifacts

ERROR: [withMaven] WARNING: Exception archiving and fingerprinting MavenArtifact{no.spacetec:myApp:rpm:1.0.0-SNAPSHOT C:\home\username\workspace\myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ\target\rpm\myApp-windows-installer\RPMS\noarch\myApp-windows-installer-1.0.0-SNAPSHOT20170911082120.noarch.rpm}, skip archiving of the artifacts

ERROR: [withMaven] WARNING Exception executing Maven reporter 'Junit Publisher' / org.jenkinsci.plugins.pipeline.maven.publishers.JunitTestsPublisher. Please report a bug associated for the component 'pipeline-maven-plugin' at https://issues.jenkins-ci.org 
java.lang.IllegalArgumentException: Cannot relativize 'C:\home\username\workspace\myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ\target/surefire-reports' relatively to '/home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ'
at org.jenkinsci.plugins.pipeline.maven.util.XmlUtils.getPathInWorkspace(XmlUtils.java:226)
at org.jenkinsci.plugins.pipeline.maven.publishers.JunitTestsPublisher.executeReporter(JunitTestsPublisher.java:234)
at org.jenkinsci.plugins.pipeline.maven.publishers.JunitTestsPublisher.process(JunitTestsPublisher.java:181)
at org.jenkinsci.plugins.pipeline.maven.MavenSpyLogProcessor.processMavenSpyLogs(MavenSpyLogProcessor.java:109)
at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution$Callback.finished(WithMavenStepExecution.java:864)
at org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback$TailCall.onSuccess(BodyExecutionCallback.java:114)
at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$SuccessAdapter.receive(CpsBodyExecution.java:362)
at com.cloudbees.groovy.cps.Outcome.resumeFrom(Outcome.java:73)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:165)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:162)
at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)
at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)
at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:162)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:35)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:32)
at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:330)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:242)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:230)
at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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)

ERROR: [withMaven] WARNING Exception executing Maven reporter 'Open Task Scanner Publisher' / org.jenkinsci.plugins.pipeline.maven.publishers.TasksScannerPublisher. Please report a bug associated for the component 'pipeline-maven-plugin' at https://issues.jenkins-ci.org 

It would seem it is unable to use the "correct" home directory as Windows is using Cygwin.


mandag 11. september 2017 08.18.38 UTC+2 skrev Sverre Moe følgende:
I took a look at the Maven Pipeline documentation again.
For Windows it says to use bat, not sh. I tried that, and got a little bit closer, but now it cannot find JAVA_HOME
----- withMaven Wrapper script -----

Error: JAVA_HOME is set to an invalid directory.
JAVA_HOME
= "/usr/java/jdk1.8.0_102"
Please set the JAVA_HOME variable in your environment to match the
location of your
Java installation.

Jenkins have jdk set at /usr/java/jdk1.8.0_102 and I have created a symlink in my Cygwin
jdk1.8.0_102 -> /cygdrive/c/Program Files/Java/jdk1.8.0_121
Windows environment variable JAVA_HOME is set to C:\Program Files\Java\jdk1.8.0_121

mandag 11. september 2017 08.07.21 UTC+2 skrev Sverre Moe følgende:
I have connected a Windows slave to Jenkins with SSH+Cygwin.
So running shell scripts like "sh 'mvn'" should work as I do it locally on the Windows.

Running withMaven fails, and I cannot figure our why.

[Pipeline] node
Running on master-windows-x86_64 in /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Checkout-Windows)
[Pipeline] checkout
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url ssh://<a href="http://git@git.company.com/software/myApp.git" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;">git@.../software/myApp.git # timeout=10
Fetching without tags
Fetching upstream changes from ssh://<a href="http://git@git.company.com/software/myApp.git" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;">git@.../software/myApp.git
 > git --version # timeout=10
 > git fetch --no-tags --progress ssh://<a href="http://git@git.company.com/software/myApp.git" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;">git@.../software/myApp.git +refs/heads/*:refs/remotes/origin/*
Checking out Revision 05cf171deb903a01b5880c30de28d4b1865e3ed5 (username/work)
Commit message: "Test Windows build on Jenkins"
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 05cf171deb903a01b5880c30de28d4b1865e3ed5
 > git rev-list f9db8914f5688ca74e571dd1104c279f207bf435 # timeout=10
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build-Windows)
[Pipeline] withMaven
[withMaven] Options: []
[withMaven] Available options: 
[withMaven] use JDK installation jdk1.8
$ where mvn.cmd
[withMaven] use Maven installation provided by the build agent with executable C:\Users\username.POLAR\Downloads\apache-maven-3.3.9-bin\apache-maven-3.3.9\bin\mvn.cmd
[Pipeline] {
[Pipeline] sh
[myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ] Running shell script
sh: /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-ff9c24b3/pid: No such file or directory
sh: /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-ff9c24b3/jenkins-log.txt: No such file or directory
sh: /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-ff9c24b3/jenkins-result.txt: No such file or directory


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/cd9eb59b-d6f0-45db-abfb-e1f64b1f7212%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Pipeline Maven: Running on Windows slave

Sverre Moe-2
The fix was to set the Windows slave Remote Root Directory to Windows URI
C:\cygwin64\home\username

mandag 11. september 2017 08.35.29 UTC+2 skrev Sverre Moe følgende:
Well, adding a new JDK in Jenkins Tools pointing to the Windows path of Java worked
Then withMaven(jdk: "jdk1.8-win")

I have though hit another snag. Lots of ERROR after build success.
ERROR: [withMaven] WARNING: Exception archiving and fingerprinting MavenArtifact{no.spacetec:myApp:jar:1.0.0-SNAPSHOT C:\home\username\workspace\myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ\target\myApp-1.0.0-SNAPSHOT.jar}, skip archiving of the artifacts

ERROR: [withMaven] WARNING: Exception archiving and fingerprinting MavenArtifact{no.spacetec:myApp:rpm:1.0.0-SNAPSHOT C:\home\username\workspace\myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ\target\rpm\myApp-windows-installer\RPMS\noarch\myApp-windows-installer-1.0.0-SNAPSHOT20170911082120.noarch.rpm}, skip archiving of the artifacts

ERROR: [withMaven] WARNING Exception executing Maven reporter 'Junit Publisher' / org.jenkinsci.plugins.pipeline.maven.publishers.JunitTestsPublisher. Please report a bug associated for the component 'pipeline-maven-plugin' at <a href="https://issues.jenkins-ci.org" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fissues.jenkins-ci.org\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHmEUgSbfJWAAO1Px4589p59VKkAw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fissues.jenkins-ci.org\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHmEUgSbfJWAAO1Px4589p59VKkAw&#39;;return true;">https://issues.jenkins-ci.org 
java.lang.IllegalArgumentException: Cannot relativize 'C:\home\username\workspace\myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ\target/surefire-reports' relatively to '/home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ'
at org.jenkinsci.plugins.pipeline.maven.util.XmlUtils.getPathInWorkspace(XmlUtils.java:226)
at org.jenkinsci.plugins.pipeline.maven.publishers.JunitTestsPublisher.executeReporter(JunitTestsPublisher.java:234)
at org.jenkinsci.plugins.pipeline.maven.publishers.JunitTestsPublisher.process(JunitTestsPublisher.java:181)
at org.jenkinsci.plugins.pipeline.maven.MavenSpyLogProcessor.processMavenSpyLogs(MavenSpyLogProcessor.java:109)
at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution$Callback.finished(WithMavenStepExecution.java:864)
at org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback$TailCall.onSuccess(BodyExecutionCallback.java:114)
at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$SuccessAdapter.receive(CpsBodyExecution.java:362)
at com.cloudbees.groovy.cps.Outcome.resumeFrom(Outcome.java:73)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:165)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:162)
at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)
at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)
at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:162)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:35)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:32)
at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:330)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:242)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:230)
at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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)

ERROR: [withMaven] WARNING Exception executing Maven reporter 'Open Task Scanner Publisher' / org.jenkinsci.plugins.pipeline.maven.publishers.TasksScannerPublisher. Please report a bug associated for the component 'pipeline-maven-plugin' at <a href="https://issues.jenkins-ci.org" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fissues.jenkins-ci.org\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHmEUgSbfJWAAO1Px4589p59VKkAw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fissues.jenkins-ci.org\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHmEUgSbfJWAAO1Px4589p59VKkAw&#39;;return true;">https://issues.jenkins-ci.org 

It would seem it is unable to use the "correct" home directory as Windows is using Cygwin.


mandag 11. september 2017 08.18.38 UTC+2 skrev Sverre Moe følgende:
I took a look at the Maven Pipeline documentation again.
For Windows it says to use bat, not sh. I tried that, and got a little bit closer, but now it cannot find JAVA_HOME
----- withMaven Wrapper script -----

Error: JAVA_HOME is set to an invalid directory.
JAVA_HOME
= "/usr/java/jdk1.8.0_102"
Please set the JAVA_HOME variable in your environment to match the
location of your
Java installation.

Jenkins have jdk set at /usr/java/jdk1.8.0_102 and I have created a symlink in my Cygwin
jdk1.8.0_102 -> /cygdrive/c/Program Files/Java/jdk1.8.0_121
Windows environment variable JAVA_HOME is set to C:\Program Files\Java\jdk1.8.0_121

mandag 11. september 2017 08.07.21 UTC+2 skrev Sverre Moe følgende:
I have connected a Windows slave to Jenkins with SSH+Cygwin.
So running shell scripts like "sh 'mvn'" should work as I do it locally on the Windows.

Running withMaven fails, and I cannot figure our why.

[Pipeline] node
Running on master-windows-x86_64 in /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Checkout-Windows)
[Pipeline] checkout
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url ssh://<a href="http://git@git.company.com/software/myApp.git" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;">git@.../software/myApp.git # timeout=10
Fetching without tags
Fetching upstream changes from ssh://<a href="http://git@git.company.com/software/myApp.git" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;">git@.../software/myApp.git
 > git --version # timeout=10
 > git fetch --no-tags --progress ssh://<a href="http://git@git.company.com/software/myApp.git" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;">git@.../software/myApp.git +refs/heads/*:refs/remotes/origin/*
Checking out Revision 05cf171deb903a01b5880c30de28d4b1865e3ed5 (username/work)
Commit message: "Test Windows build on Jenkins"
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 05cf171deb903a01b5880c30de28d4b1865e3ed5
 > git rev-list f9db8914f5688ca74e571dd1104c279f207bf435 # timeout=10
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build-Windows)
[Pipeline] withMaven
[withMaven] Options: []
[withMaven] Available options: 
[withMaven] use JDK installation jdk1.8
$ where mvn.cmd
[withMaven] use Maven installation provided by the build agent with executable C:\Users\username.POLAR\Downloads\apache-maven-3.3.9-bin\apache-maven-3.3.9\bin\mvn.cmd
[Pipeline] {
[Pipeline] sh
[myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ] Running shell script
sh: /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-ff9c24b3/pid: No such file or directory
sh: /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-ff9c24b3/jenkins-log.txt: No such file or directory
sh: /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-ff9c24b3/jenkins-result.txt: No such file or directory


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/5da9746b-17c9-47b7-ab1e-88f32b0416f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Pipeline Maven: Running on Windows slave

Baptiste MATHUS
Hello,
I know the developers of that plugin would like to make it as good as possible. To that, if so, could you please try and summarize what you think could be made easier/better? And even if possibly a config error, if you think the error could help more quickly understand what is wrong?

Thanks!

Le 11 sept. 2017 09:03, "Sverre Moe" <[hidden email]> a écrit :
The fix was to set the Windows slave Remote Root Directory to Windows URI
C:\cygwin64\home\username

mandag 11. september 2017 08.35.29 UTC+2 skrev Sverre Moe følgende:
Well, adding a new JDK in Jenkins Tools pointing to the Windows path of Java worked
Then withMaven(jdk: "jdk1.8-win")

I have though hit another snag. Lots of ERROR after build success.
ERROR: [withMaven] WARNING: Exception archiving and fingerprinting MavenArtifact{no.spacetec:myApp:jar:1.0.0-SNAPSHOT C:\home\username\workspace\myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ\target\myApp-1.0.0-SNAPSHOT.jar}, skip archiving of the artifacts

ERROR: [withMaven] WARNING: Exception archiving and fingerprinting MavenArtifact{no.spacetec:myApp:rpm:1.0.0-SNAPSHOT C:\home\username\workspace\myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ\target\rpm\myApp-windows-installer\RPMS\noarch\myApp-windows-installer-1.0.0-SNAPSHOT20170911082120.noarch.rpm}, skip archiving of the artifacts

ERROR: [withMaven] WARNING Exception executing Maven reporter 'Junit Publisher' / org.jenkinsci.plugins.pipeline.maven.publishers.JunitTestsPublisher. Please report a bug associated for the component 'pipeline-maven-plugin' at https://issues.jenkins-ci.org 
java.lang.IllegalArgumentException: Cannot relativize 'C:\home\username\workspace\myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ\target/surefire-reports' relatively to '/home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ'
at org.jenkinsci.plugins.pipeline.maven.util.XmlUtils.getPathInWorkspace(XmlUtils.java:226)
at org.jenkinsci.plugins.pipeline.maven.publishers.JunitTestsPublisher.executeReporter(JunitTestsPublisher.java:234)
at org.jenkinsci.plugins.pipeline.maven.publishers.JunitTestsPublisher.process(JunitTestsPublisher.java:181)
at org.jenkinsci.plugins.pipeline.maven.MavenSpyLogProcessor.processMavenSpyLogs(MavenSpyLogProcessor.java:109)
at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution$Callback.finished(WithMavenStepExecution.java:864)
at org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback$TailCall.onSuccess(BodyExecutionCallback.java:114)
at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$SuccessAdapter.receive(CpsBodyExecution.java:362)
at com.cloudbees.groovy.cps.Outcome.resumeFrom(Outcome.java:73)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:165)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:162)
at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)
at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)
at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:162)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:35)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:32)
at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:330)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:242)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:230)
at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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)

ERROR: [withMaven] WARNING Exception executing Maven reporter 'Open Task Scanner Publisher' / org.jenkinsci.plugins.pipeline.maven.publishers.TasksScannerPublisher. Please report a bug associated for the component 'pipeline-maven-plugin' at https://issues.jenkins-ci.org 

It would seem it is unable to use the "correct" home directory as Windows is using Cygwin.


mandag 11. september 2017 08.18.38 UTC+2 skrev Sverre Moe følgende:
I took a look at the Maven Pipeline documentation again.
For Windows it says to use bat, not sh. I tried that, and got a little bit closer, but now it cannot find JAVA_HOME
----- withMaven Wrapper script -----

Error: JAVA_HOME is set to an invalid directory.
JAVA_HOME
= "/usr/java/jdk1.8.0_102"
Please set the JAVA_HOME variable in your environment to match the
location of your
Java installation.

Jenkins have jdk set at /usr/java/jdk1.8.0_102 and I have created a symlink in my Cygwin
jdk1.8.0_102 -> /cygdrive/c/Program Files/Java/jdk1.8.0_121
Windows environment variable JAVA_HOME is set to C:\Program Files\Java\jdk1.8.0_121

mandag 11. september 2017 08.07.21 UTC+2 skrev Sverre Moe følgende:
I have connected a Windows slave to Jenkins with SSH+Cygwin.
So running shell scripts like "sh 'mvn'" should work as I do it locally on the Windows.

Running withMaven fails, and I cannot figure our why.

[Pipeline] node
Running on master-windows-x86_64 in /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Checkout-Windows)
[Pipeline] checkout
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url ssh://git@.../software/myApp.git # timeout=10
Fetching without tags
Fetching upstream changes from ssh://git@.../software/myApp.git
 > git --version # timeout=10
 > git fetch --no-tags --progress ssh://git@.../software/myApp.git +refs/heads/*:refs/remotes/origin/*
Checking out Revision 05cf171deb903a01b5880c30de28d4b1865e3ed5 (username/work)
Commit message: "Test Windows build on Jenkins"
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 05cf171deb903a01b5880c30de28d4b1865e3ed5
 > git rev-list f9db8914f5688ca74e571dd1104c279f207bf435 # timeout=10
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build-Windows)
[Pipeline] withMaven
[withMaven] Options: []
[withMaven] Available options: 
[withMaven] use JDK installation jdk1.8
$ where mvn.cmd
[withMaven] use Maven installation provided by the build agent with executable C:\Users\username.POLAR\Downloads\apache-maven-3.3.9-bin\apache-maven-3.3.9\bin\mvn.cmd
[Pipeline] {
[Pipeline] sh
[myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ] Running shell script
sh: /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-ff9c24b3/pid: No such file or directory
sh: /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-ff9c24b3/jenkins-log.txt: No such file or directory
sh: /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-ff9c24b3/jenkins-result.txt: No such file or directory


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/5da9746b-17c9-47b7-ab1e-88f32b0416f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CANWgJS5GWTKOkXhZ2RUsCZ2VHfQwEhjRNd8Wc%3DgmFmC7s%3D3mXA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Pipeline Maven: Running on Windows slave

Cyrille Le Clerc
Hello Svere,

It seems that we have some work to make withMaven(){} more friendly to Windows+Cygwin users.

We have already tracked:
Some refactoring of the code will be needed to generate both standard Windows and Cygwin friendly scripts on Windows agents.

Please feel free to give us hints on what a smooth integration with Windows and Cygwin should look like.

Cyrille

On Monday, September 11, 2017 at 9:08:53 AM UTC+2, Baptiste Mathus wrote:
Hello,
I know the developers of that plugin would like to make it as good as possible. To that, if so, could you please try and summarize what you think could be made easier/better? And even if possibly a config error, if you think the error could help more quickly understand what is wrong?

Thanks!

Le 11 sept. 2017 09:03, "Sverre Moe" <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="0ZYEx5LbAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">sverr...@...> a écrit :
The fix was to set the Windows slave Remote Root Directory to Windows URI
C:\cygwin64\home\username

mandag 11. september 2017 08.35.29 UTC+2 skrev Sverre Moe følgende:
Well, adding a new JDK in Jenkins Tools pointing to the Windows path of Java worked
Then withMaven(jdk: "jdk1.8-win")

I have though hit another snag. Lots of ERROR after build success.
ERROR: [withMaven] WARNING: Exception archiving and fingerprinting MavenArtifact{no.spacetec:myApp:jar:1.0.0-SNAPSHOT C:\home\username\workspace\myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ\target\myApp-1.0.0-SNAPSHOT.jar}, skip archiving of the artifacts

ERROR: [withMaven] WARNING: Exception archiving and fingerprinting MavenArtifact{no.spacetec:myApp:rpm:1.0.0-SNAPSHOT C:\home\username\workspace\myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ\target\rpm\myApp-windows-installer\RPMS\noarch\myApp-windows-installer-1.0.0-SNAPSHOT20170911082120.noarch.rpm}, skip archiving of the artifacts

ERROR: [withMaven] WARNING Exception executing Maven reporter 'Junit Publisher' / org.jenkinsci.plugins.pipeline.maven.publishers.JunitTestsPublisher. Please report a bug associated for the component 'pipeline-maven-plugin' at <a href="https://issues.jenkins-ci.org" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fissues.jenkins-ci.org\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHmEUgSbfJWAAO1Px4589p59VKkAw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fissues.jenkins-ci.org\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHmEUgSbfJWAAO1Px4589p59VKkAw&#39;;return true;">https://issues.jenkins-ci.org 
java.lang.IllegalArgumentException: Cannot relativize 'C:\home\username\workspace\myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ\target/surefire-reports' relatively to '/home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ'
at org.jenkinsci.plugins.pipeline.maven.util.XmlUtils.getPathInWorkspace(XmlUtils.java:226)
at org.jenkinsci.plugins.pipeline.maven.publishers.JunitTestsPublisher.executeReporter(JunitTestsPublisher.java:234)
at org.jenkinsci.plugins.pipeline.maven.publishers.JunitTestsPublisher.process(JunitTestsPublisher.java:181)
at org.jenkinsci.plugins.pipeline.<a href="http://maven.MavenSpyLogProcessor.pr" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fmaven.MavenSpyLogProcessor.pr\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEIAhiNnO_1QEHXWF0jG1gajCB42w&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fmaven.MavenSpyLogProcessor.pr\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEIAhiNnO_1QEHXWF0jG1gajCB42w&#39;;return true;">maven.MavenSpyLogProcessor.processMavenSpyLogs(MavenSpyLogProcessor.java:109)
at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution$Callback.finished(WithMavenStepExecution.java:864)
at org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback$TailCall.onSuccess(BodyExecutionCallback.java:114)
at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$SuccessAdapter.receive(CpsBodyExecution.java:362)
at com.cloudbees.groovy.cps.Outcome.resumeFrom(Outcome.java:73)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:165)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:162)
at <a href="http://org.codehaus.groovy.runtime.Gr" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Forg.codehaus.groovy.runtime.Gr\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGWJIYukM_b8cVDiDOqGVgqW9f-zg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Forg.codehaus.groovy.runtime.Gr\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGWJIYukM_b8cVDiDOqGVgqW9f-zg&#39;;return true;">org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)
at <a href="http://org.codehaus.groovy.runtime.Gr" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Forg.codehaus.groovy.runtime.Gr\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGWJIYukM_b8cVDiDOqGVgqW9f-zg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Forg.codehaus.groovy.runtime.Gr\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGWJIYukM_b8cVDiDOqGVgqW9f-zg&#39;;return true;">org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)
at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:162)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:35)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:32)
at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:330)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:242)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:230)
at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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)

ERROR: [withMaven] WARNING Exception executing Maven reporter 'Open Task Scanner Publisher' / org.jenkinsci.plugins.pipeline.maven.publishers.TasksScannerPublisher. Please report a bug associated for the component 'pipeline-maven-plugin' at <a href="https://issues.jenkins-ci.org" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fissues.jenkins-ci.org\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHmEUgSbfJWAAO1Px4589p59VKkAw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fissues.jenkins-ci.org\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHmEUgSbfJWAAO1Px4589p59VKkAw&#39;;return true;">https://issues.jenkins-ci.org 

It would seem it is unable to use the "correct" home directory as Windows is using Cygwin.


mandag 11. september 2017 08.18.38 UTC+2 skrev Sverre Moe følgende:
I took a look at the Maven Pipeline documentation again.
For Windows it says to use bat, not sh. I tried that, and got a little bit closer, but now it cannot find JAVA_HOME
----- withMaven Wrapper script -----

Error: JAVA_HOME is set to an invalid directory.
JAVA_HOME
= "/usr/java/jdk1.8.0_102"
Please set the JAVA_HOME variable in your environment to match the
location of your
Java installation.

Jenkins have jdk set at /usr/java/jdk1.8.0_102 and I have created a symlink in my Cygwin
jdk1.8.0_102 -> /cygdrive/c/Program Files/Java/jdk1.8.0_121
Windows environment variable JAVA_HOME is set to C:\Program Files\Java\jdk1.8.0_121

mandag 11. september 2017 08.07.21 UTC+2 skrev Sverre Moe følgende:
I have connected a Windows slave to Jenkins with SSH+Cygwin.
So running shell scripts like "sh 'mvn'" should work as I do it locally on the Windows.

Running withMaven fails, and I cannot figure our why.

[Pipeline] node
Running on master-windows-x86_64 in /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Checkout-Windows)
[Pipeline] checkout
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url ssh://<a href="http://git@git.company.com/software/myApp.git" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;">git@.../software/myApp.git # timeout=10
Fetching without tags
Fetching upstream changes from ssh://<a href="http://git@git.company.com/software/myApp.git" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;">git@.../software/myApp.git
 > git --version # timeout=10
 > git fetch --no-tags --progress ssh://<a href="http://git@git.company.com/software/myApp.git" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;">git@.../software/myApp.git +refs/heads/*:refs/remotes/origin/*
Checking out Revision 05cf171deb903a01b5880c30de28d4b1865e3ed5 (username/work)
Commit message: "Test Windows build on Jenkins"
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 05cf171deb903a01b5880c30de28d4b1865e3ed5
 > git rev-list f9db8914f5688ca74e571dd1104c279f207bf435 # timeout=10
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build-Windows)
[Pipeline] withMaven
[withMaven] Options: []
[withMaven] Available options: 
[withMaven] use JDK installation jdk1.8
$ where mvn.cmd
[withMaven] use Maven installation provided by the build agent with executable C:\Users\username.POLAR\Downloads\apache-maven-3.3.9-bin\apache-maven-3.3.9\bin\mvn.cmd
[Pipeline] {
[Pipeline] sh
[myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ] Running shell script
sh: /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-ff9c24b3/pid: No such file or directory
sh: /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-ff9c24b3/jenkins-log.txt: No such file or directory
sh: /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-ff9c24b3/jenkins-result.txt: No such file or directory


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="0ZYEx5LbAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/5da9746b-17c9-47b7-ab1e-88f32b0416f2%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/5da9746b-17c9-47b7-ab1e-88f32b0416f2%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/5da9746b-17c9-47b7-ab1e-88f32b0416f2%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/5da9746b-17c9-47b7-ab1e-88f32b0416f2%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/ed70a784-f45a-4820-b53d-b176e8135c1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Pipeline Maven: Running on Windows slave

Sverre Moe-2
Here follows an update of some observations and configurations I have done to get building on Windows to work.

The Windows node is connected in Jenkins with SSH started by sshd in Cygwin.
Using this guide: https://www.howtogeek.com/howto/41560/how-to-get-ssh-command-line-access-to-windows-7-using-cygwin/

The Windows node's "Remote root directory" is set to "C:\cygwin64\home\build", because "/home/build" would not work.
Step withMaven woulld fail with use of the latter:
[myApp_sverre_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ] Running shell script
sh
: /home/build/workspace/myApp_sverre_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-e1932da9/pid: No such file or directory
sh
: /home/build/workspace/myApp_sverre_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-e1932da9/jenkins-log.txt: No such file or directory
sh
: /home/build/workspace/myApp_sverre_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-e1932da9/jenkins-result.txt: No such file or directory

I have also added an additional Windows JDK in Jenkins pointing to C:\Program Files\Java\jdk1.8.0_144.
Creating a symlink in cygwin at /usr/java/jdk1.8.0_144 to /cygdrive/c/Program\ Files/jdk1.8.0_144 allowed me to use the same Jenkins JDK tool for both Windows and Linux (though only with the sh step).

For the time being I have been using the pipeline step bat after checking !isUnix().
However with the bat step I must use a different JDK that points to the real directory in Windows C:\Program Files\Java\jdk1.8.0_144.
Otherwise withMaven fails to find the JDK at /usr/java/jdk1.8.0_144
[myApp_sverre_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ] Running batch script
C:\cygwin64\home\build\workspace\myApp_sverre_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ>mvn clean install  
----- withMaven Wrapper script -----
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB
: JAVA_HOME should point to a JDK not a JRE


Using the sh step instead of the bat step in pipeline kinda works. However with one Exception.
[withMaven] use Maven installation provided by the build agent with executable C:\Program Files\apache-maven-3.5.0\bin\mvn.cmd
[Pipeline] {
[Pipeline] sh
[C:\cygwin64\home\build\workspace\myApp_sverre_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ] Running shell script
Cannot contact master-windows7-x86_64: java.io.IOException: Remote call on master-windows7-x86_64 failed
+ mvn clean install
The build continues never the less with success, so I am not sure what failed here and what it tried to do on the remote node that caused the IOException.


tirsdag 12. september 2017 10.51.46 UTC+2 skrev Cyrille Le Clerc følgende:
Hello Svere,

It seems that we have some work to make withMaven(){} more friendly to Windows+Cygwin users.

We have already tracked:
  • <a href="https://issues.jenkins-ci.org/browse/JENKINS-44089" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fissues.jenkins-ci.org%2Fbrowse%2FJENKINS-44089\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE3UGYXhgYl1kPMkmw1kwVXrdQjbg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fissues.jenkins-ci.org%2Fbrowse%2FJENKINS-44089\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE3UGYXhgYl1kPMkmw1kwVXrdQjbg&#39;;return true;">JENKINS-44089 Request that withMaven pipeline step produce both mvn and mvn.cmd wrappers on Windows
  • <a href="https://issues.jenkins-ci.org/browse/JENKINS-44276" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fissues.jenkins-ci.org%2Fbrowse%2FJENKINS-44276\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH5qqa3ihnzPdHzfB2QD-pfb0vWEQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fissues.jenkins-ci.org%2Fbrowse%2FJENKINS-44276\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH5qqa3ihnzPdHzfB2QD-pfb0vWEQ&#39;;return true;">JENKINS-44276 Maven fails in pipeline + cygwin
Some refactoring of the code will be needed to generate both standard Windows and Cygwin friendly scripts on Windows agents.

Please feel free to give us hints on what a smooth integration with Windows and Cygwin should look like.

Cyrille

On Monday, September 11, 2017 at 9:08:53 AM UTC+2, Baptiste Mathus wrote:
Hello,
I know the developers of that plugin would like to make it as good as possible. To that, if so, could you please try and summarize what you think could be made easier/better? And even if possibly a config error, if you think the error could help more quickly understand what is wrong?

Thanks!

Le 11 sept. 2017 09:03, "Sverre Moe" <[hidden email]> a écrit :
The fix was to set the Windows slave Remote Root Directory to Windows URI
C:\cygwin64\home\username

mandag 11. september 2017 08.35.29 UTC+2 skrev Sverre Moe følgende:
Well, adding a new JDK in Jenkins Tools pointing to the Windows path of Java worked
Then withMaven(jdk: "jdk1.8-win")

I have though hit another snag. Lots of ERROR after build success.
ERROR: [withMaven] WARNING: Exception archiving and fingerprinting MavenArtifact{no.spacetec:myApp:jar:1.0.0-SNAPSHOT C:\home\username\workspace\myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ\target\myApp-1.0.0-SNAPSHOT.jar}, skip archiving of the artifacts

ERROR: [withMaven] WARNING: Exception archiving and fingerprinting MavenArtifact{no.spacetec:myApp:rpm:1.0.0-SNAPSHOT C:\home\username\workspace\myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ\target\rpm\myApp-windows-installer\RPMS\noarch\myApp-windows-installer-1.0.0-SNAPSHOT20170911082120.noarch.rpm}, skip archiving of the artifacts

ERROR: [withMaven] WARNING Exception executing Maven reporter 'Junit Publisher' / org.jenkinsci.plugins.pipeline.maven.publishers.JunitTestsPublisher. Please report a bug associated for the component 'pipeline-maven-plugin' at <a href="https://issues.jenkins-ci.org" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fissues.jenkins-ci.org\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHmEUgSbfJWAAO1Px4589p59VKkAw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fissues.jenkins-ci.org\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHmEUgSbfJWAAO1Px4589p59VKkAw&#39;;return true;">https://issues.jenkins-ci.org 
java.lang.IllegalArgumentException: Cannot relativize 'C:\home\username\workspace\myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ\target/surefire-reports' relatively to '/home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ'
at org.jenkinsci.plugins.pipeline.maven.util.XmlUtils.getPathInWorkspace(XmlUtils.java:226)
at org.jenkinsci.plugins.pipeline.maven.publishers.JunitTestsPublisher.executeReporter(JunitTestsPublisher.java:234)
at org.jenkinsci.plugins.pipeline.maven.publishers.JunitTestsPublisher.process(JunitTestsPublisher.java:181)
at org.jenkinsci.plugins.pipeline.<a href="http://maven.MavenSpyLogProcessor.pr" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fmaven.MavenSpyLogProcessor.pr\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEIAhiNnO_1QEHXWF0jG1gajCB42w&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fmaven.MavenSpyLogProcessor.pr\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEIAhiNnO_1QEHXWF0jG1gajCB42w&#39;;return true;">maven.MavenSpyLogProcessor.processMavenSpyLogs(MavenSpyLogProcessor.java:109)
at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution$Callback.finished(WithMavenStepExecution.java:864)
at org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback$TailCall.onSuccess(BodyExecutionCallback.java:114)
at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$SuccessAdapter.receive(CpsBodyExecution.java:362)
at com.cloudbees.groovy.cps.Outcome.resumeFrom(Outcome.java:73)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:165)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:162)
at <a href="http://org.codehaus.groovy.runtime.Gr" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Forg.codehaus.groovy.runtime.Gr\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGWJIYukM_b8cVDiDOqGVgqW9f-zg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Forg.codehaus.groovy.runtime.Gr\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGWJIYukM_b8cVDiDOqGVgqW9f-zg&#39;;return true;">org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)
at <a href="http://org.codehaus.groovy.runtime.Gr" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Forg.codehaus.groovy.runtime.Gr\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGWJIYukM_b8cVDiDOqGVgqW9f-zg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Forg.codehaus.groovy.runtime.Gr\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGWJIYukM_b8cVDiDOqGVgqW9f-zg&#39;;return true;">org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)
at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:162)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:35)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:32)
at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:330)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:242)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:230)
at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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)

ERROR: [withMaven] WARNING Exception executing Maven reporter 'Open Task Scanner Publisher' / org.jenkinsci.plugins.pipeline.maven.publishers.TasksScannerPublisher. Please report a bug associated for the component 'pipeline-maven-plugin' at <a href="https://issues.jenkins-ci.org" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fissues.jenkins-ci.org\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHmEUgSbfJWAAO1Px4589p59VKkAw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fissues.jenkins-ci.org\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHmEUgSbfJWAAO1Px4589p59VKkAw&#39;;return true;">https://issues.jenkins-ci.org 

It would seem it is unable to use the "correct" home directory as Windows is using Cygwin.


mandag 11. september 2017 08.18.38 UTC+2 skrev Sverre Moe følgende:
I took a look at the Maven Pipeline documentation again.
For Windows it says to use bat, not sh. I tried that, and got a little bit closer, but now it cannot find JAVA_HOME
----- withMaven Wrapper script -----

Error: JAVA_HOME is set to an invalid directory.
JAVA_HOME
= "/usr/java/jdk1.8.0_102"
Please set the JAVA_HOME variable in your environment to match the
location of your
Java installation.

Jenkins have jdk set at /usr/java/jdk1.8.0_102 and I have created a symlink in my Cygwin
jdk1.8.0_102 -> /cygdrive/c/Program Files/Java/jdk1.8.0_121
Windows environment variable JAVA_HOME is set to C:\Program Files\Java\jdk1.8.0_121

mandag 11. september 2017 08.07.21 UTC+2 skrev Sverre Moe følgende:
I have connected a Windows slave to Jenkins with SSH+Cygwin.
So running shell scripts like "sh 'mvn'" should work as I do it locally on the Windows.

Running withMaven fails, and I cannot figure our why.

[Pipeline] node
Running on master-windows-x86_64 in /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Checkout-Windows)
[Pipeline] checkout
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url ssh://<a href="http://git@git.company.com/software/myApp.git" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;">git@.../software/myApp.git # timeout=10
Fetching without tags
Fetching upstream changes from ssh://<a href="http://git@git.company.com/software/myApp.git" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;">git@.../software/myApp.git
 > git --version # timeout=10
 > git fetch --no-tags --progress ssh://<a href="http://git@git.company.com/software/myApp.git" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit%40git.company.com%2Fsoftware%2FmyApp.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFm6At9LXCzmoimbdkuw5XPeBh7AA&#39;;return true;">git@.../software/myApp.git +refs/heads/*:refs/remotes/origin/*
Checking out Revision 05cf171deb903a01b5880c30de28d4b1865e3ed5 (username/work)
Commit message: "Test Windows build on Jenkins"
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 05cf171deb903a01b5880c30de28d4b1865e3ed5
 > git rev-list f9db8914f5688ca74e571dd1104c279f207bf435 # timeout=10
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build-Windows)
[Pipeline] withMaven
[withMaven] Options: []
[withMaven] Available options: 
[withMaven] use JDK installation jdk1.8
$ where mvn.cmd
[withMaven] use Maven installation provided by the build agent with executable C:\Users\username.POLAR\Downloads\apache-maven-3.3.9-bin\apache-maven-3.3.9\bin\mvn.cmd
[Pipeline] {
[Pipeline] sh
[myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ] Running shell script
sh: /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-ff9c24b3/pid: No such file or directory
sh: /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-ff9c24b3/jenkins-log.txt: No such file or directory
sh: /home/username/workspace/myApp_username_work-3U54DPE57F6TMOZM2O6QBWDQ2LNRU2QHAXT6INC3UPGWF2ERMXAQ@tmp/durable-ff9c24b3/jenkins-result.txt: No such file or directory


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/5da9746b-17c9-47b7-ab1e-88f32b0416f2%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/5da9746b-17c9-47b7-ab1e-88f32b0416f2%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/5da9746b-17c9-47b7-ab1e-88f32b0416f2%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/5da9746b-17c9-47b7-ab1e-88f32b0416f2%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/14497211-6028-4892-af63-bbf0c7e0a234%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.