maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (SUREFIRE-1588) Surefire manifest jar classloading broken on latest Debian/Ubuntu Java8
Date Thu, 01 Nov 2018 16:00:00 GMT


ASF GitHub Bot commented on SUREFIRE-1588:

jglick commented on a change in pull request #197: SUREFIRE-1588 Patch (Java7)

 File path: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/
 @@ -111,7 +113,8 @@ private File createJar( @Nonnull List<String> classPath, @Nonnull
String startCl
             for ( Iterator<String> it = classPath.iterator(); it.hasNext(); )
                 File file1 = new File( );
-                String uri = file1.toURI().toASCIIString();
+                String uri = parent.relativize( file1.toPath() ).toString();
 Review comment:
   Not sure offhand what the paths here are like (have not yet tested this patch), but beware
that this might throw `IllegalArgumentException` on Windows if they are on different drive
letters. It might be wise to catch this exception and either
   * fall back to the original implementation and hope for the best
   * copy some of the classpath entries to a nearby location
   There is also a possible bug here with paths containing spaces or other special characters.
From [what I can make out](,
the expectation is that entries are relative URIs, not relative filenames. The original code
used `File.toURI`, which escaped most characters into URI form (though NIO does a better job,
for example handling Windows UNC paths). The new code uses `Path.toString`, which would not
do that escaping. I suspect you meant to use
                   String uri = new URI(null, parent.relativize( file1.toPath() ).toString(),

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

> Surefire manifest jar classloading broken on latest Debian/Ubuntu Java8
> -----------------------------------------------------------------------
>                 Key: SUREFIRE-1588
>                 URL:
>             Project: Maven Surefire
>          Issue Type: Bug
>    Affects Versions: 2.22.1
>            Reporter: Cservenak, Tamas
>            Priority: Major
> See issue [1], but in short: latest Java8 on Ubuntu/Debian/Mint family of Linuxes (am
on Mint, Ubuntu derivative) contains this patch [3], and eforces Manifest class path entries
to be relative, as defined in [2].
> Hence, surefire booter and rest of Maven classpath, that uses absolute URLs are simply
> Example error:
> {noformat}
> # Created at 2018-10-30T21:34:43.339
> Error: Could not find or load main class org.apache.maven.surefire.booter.ForkedBooter{noformat}
> using the new property {{}} clearly
shows that all the entries from the surefire JAR are simply ignored.
> [1] []
> [2]
> [3] []

This message was sent by Atlassian JIRA

View raw message