[HAP-1004] Maven3Builder.buildMavenCmdLine() broken on Windows since 2.13.0 (InvalidPathException) Created: 23/Oct/17  Updated: 08/Nov/17  Resolved: 26/Oct/17

Status: Resolved
Project: Jenkins Artifactory Plug-in
Component/s: Maven3
Affects Version/s: 2.13.0
Fix Version/s: 2.13.1

Type: Bug Priority: Normal
Reporter: Stefan Köhler Assignee: Roman Gurevitch (Inactive)
Resolution: Fixed Votes: 0
Labels: None


 Description   

Since plugin version 2.13.0 our builds fail with the following error:

Jenkins Artifactory Plugin version: 2.13.0
ERROR: Build step failed with exception
java.nio.file.InvalidPathException: Illegal char <*> at index 90: c:\Daten\jenkins\tools\hudson.tasks.Maven_MavenInstallation\Maven_3.5.0_automatisch_\boot\*
	at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
	at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
	at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
	at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
	at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
	at java.nio.file.Paths.get(Paths.java:84)
	at org.jfrog.hudson.maven3.Maven3Builder.buildMavenCmdLine(Maven3Builder.java:147)
	at org.jfrog.hudson.maven3.Maven3Builder.perform(Maven3Builder.java:98)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:736)
	at hudson.model.Build$BuildExecution.build(Build.java:206)
	at hudson.model.Build$BuildExecution.doRun(Build.java:163)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:496)
	at hudson.model.Run.execute(Run.java:1724)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:421)
Build step 'Invoke Artifactory Maven 3' marked build as failure

Version 2.12.2 was not affected by this problem. The reason is in line 147:

Path classPath = Paths.get(mavenHome.getRemote(), "boot", "*");)

While this code works fine on Linux systems, it throws an Exception on Windows (simply to be tested with System.out.println(java.nio.file.Paths.get("/foo", "bar", "*"));).



 Comments   
Comment by Roman Gurevitch (Inactive) [ 26/Oct/17 ]

Stefan Köhler, thank you for reporting this issue,
We have fixed the issue, the relevant commit can be found here.
Official version will be released soon.

Comment by Stefan Köhler [ 27/Oct/17 ]

Hi Roman Gurevitch, thank you very much for providing a fix so quickly. We're looking forward to the release.

Generated at Sun Oct 20 11:09:54 UTC 2019 using JIRA 7.6.16#76018-sha1:9ed376192612a49536ac834c64177a0fed6290f5.