Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-52657

[withMaven] IllegalArgumentException: Cannot relativize <some windows path> relatively to <some other windows path>

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • pipeline-maven-plugin
    • None
    • Windows 10, Jenkins LTS 2.121.1, pipeline-maven-plugin 3.5.7

      the task scanner seems tries to relativize a non-existing path... i guess that should be silent?

      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 
      java.lang.IllegalArgumentException: Cannot relativize 'C:\data\jenkins\ws\cebjut\ce\com.esri\com.esri.master\src\main\java' relatively to 'C:/data/jenkins/ws/cebjut/ce/com.procedural.tests'
      at org.jenkinsci.plugins.pipeline.maven.util.XmlUtils.getPathInWorkspace(XmlUtils.java:397)
      at org.jenkinsci.plugins.pipeline.maven.publishers.TasksScannerPublisher.process(TasksScannerPublisher.java:134)
      at org.jenkinsci.plugins.pipeline.maven.MavenSpyLogProcessor.processMavenSpyLogs(MavenSpyLogProcessor.java:118)
      at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution$WithMavenStepExecutionCallBack.finished(WithMavenStepExecution.java:1050)
      at org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback$TailCall.onSuccess(BodyExecutionCallback.java:114)
      at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$SuccessAdapter.receive(CpsBodyExecution.java:366)
      at com.cloudbees.groovy.cps.Outcome.resumeFrom(Outcome.java:73)
      at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:166)
      at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
      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:163)
      at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$101(SandboxContinuable.java:34)
      at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.lambda$run0$0(SandboxContinuable.java:59)
      at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
      at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:58)
      at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)
      at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:332)
      at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$200(CpsThreadGroup.java:83)
      at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:244)
      at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:232)
      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:131)
      at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
      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:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
      

          [JENKINS-52657] [withMaven] IllegalArgumentException: Cannot relativize <some windows path> relatively to <some other windows path>

          Which version of the pipeline-maven-plugin are you running?

          Cyrille Le Clerc added a comment - Which version of the pipeline-maven-plugin are you running?

          mistafunk added a comment -

          pipeline-maven-plugin 3.5.7, sorry i missed that

          mistafunk added a comment - pipeline-maven-plugin 3.5.7, sorry i missed that

          Thanks. Do you use Cygwin or equivalent "linux style shell" on this windows agent?

          Notes: TODO verify why wasn't this path escaped by https://github.com/jenkinsci/pipeline-maven-plugin/blob/pipeline-maven-3.5.7/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/util/XmlUtils.java#L368

          Cyrille Le Clerc added a comment - Thanks. Do you use Cygwin or equivalent "linux style shell" on this windows agent? Notes: TODO verify why wasn't this path escaped by https://github.com/jenkinsci/pipeline-maven-plugin/blob/pipeline-maven-3.5.7/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/util/XmlUtils.java#L368

          mistafunk could you be invoking "withMaven(){}" from a folder that is not the root folder of your multi module maven project?

          Can you do the following

          dir ("path/to/maven-multi-module-root") {
             withMaven() {
                // if the desired pom.xml is at the root of the multi-module project
                sh "mvn clean verify"
                // if the desired pom.xml is NOT at the root of the multi-module project
                sh "mvn -f path/to/pom.xml clean verify"
          
             }
          }
          

          Cyrille Le Clerc added a comment - mistafunk could you be invoking "withMaven(){}" from a folder that is not the root folder of your multi module maven project? Can you do the following dir ( "path/to/maven-multi-module-root" ) { withMaven() { // if the desired pom.xml is at the root of the multi-module project sh "mvn clean verify" // if the desired pom.xml is NOT at the root of the multi-module project sh "mvn -f path/to/pom.xml clean verify" } }

          hello mistafunk, could you test the pattern of pipeline I proposed?

          Cyrille Le Clerc added a comment - hello mistafunk , could you test the pattern of pipeline I proposed?

            Unassigned Unassigned
            mistafunk mistafunk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: