From issues-return-139666-archive-asf-public=cust-asf.ponee.io@maven.apache.org Thu Nov 1 18:51:04 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 9528718077A for ; Thu, 1 Nov 2018 18:51:03 +0100 (CET) Received: (qmail 63248 invoked by uid 500); 1 Nov 2018 17:51:02 -0000 Mailing-List: contact issues-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list issues@maven.apache.org Received: (qmail 63236 invoked by uid 99); 1 Nov 2018 17:51:02 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Nov 2018 17:51:02 +0000 From: GitBox To: issues@maven.apache.org Subject: [GitHub] jglick commented on a change in pull request #197: SUREFIRE-1588 Patch (Java7) Message-ID: <154109466204.2265.17200896245581515183.gitbox@gitbox.apache.org> Date: Thu, 01 Nov 2018 17:51:02 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit jglick commented on a change in pull request #197: SUREFIRE-1588 Patch (Java7) URL: https://github.com/apache/maven-surefire/pull/197#discussion_r230134884 ########## File path: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/JarManifestForkConfiguration.java ########## @@ -111,7 +114,17 @@ private File createJar( @Nonnull List classPath, @Nonnull String startCl for ( Iterator it = classPath.iterator(); it.hasNext(); ) { File file1 = new File( it.next() ); - String uri = file1.toURI().toASCIIString(); + String uri; + try + { + uri = URI.create( parent.relativize( file1.toPath() ).toString() ).toASCIIString(); Review comment: There is a reason I suggested the three-arg `URI` constructor rather than `create`. You want to _construct_ a URI from a raw path, not _parse_ a URI. ``` jshell> URI.create("../../a b/c.jar") | java.lang.IllegalArgumentException thrown: Illegal character in path at index 7: ../../a b/c.jar | at URI.create (URI.java:883) | at (#6:1) jshell> new URI(null, "../../a b/c.jar", null) $7 ==> ../../a%20b/c.jar ``` ---------------------------------------------------------------- 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: users@infra.apache.org With regards, Apache Git Services