[ 
https://issues.apache.org/jira/browse/SUREFIRE-1312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15734853#comment-15734853
 ] 

Yanick Salzmann edited comment on SUREFIRE-1312 at 12/9/16 9:58 AM:
--------------------------------------------------------------------

Yes, I can also reproduce it with 2.19. It seems to be that it could be 
something around here:
https://github.com/apache/maven-surefire/blob/master/surefire-booter/src/main/java/org/apache/maven/surefire/booter/Classpath.java#L126

This does URL encoding and I think this is how it ends up encoded in the 
{{java.class.path}}. Sadly I currently lack the time to create my own build of 
the plugin to do more advanced debugging


was (Author: yanicks90):
Yes, I can also reproduce it with 2.19. It seems to be that it could be 
something around here:
https://github.com/apache/maven-surefire/blob/master/surefire-booter/src/main/java/org/apache/maven/surefire/booter/Classpath.java#L126

This does URL encoding and I think this is how it ends up encoded in the 
`java.class.path`. Sadly I currently lack the time to create my own build of 
the plugin to do more advanced debugging

> Classpath containing url special characters with Reflections not working
> ------------------------------------------------------------------------
>
>                 Key: SUREFIRE-1312
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1312
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: classloading
>    Affects Versions: 2.16
>         Environment: windows 7, RHEL 7
>            Reporter: Yanick Salzmann
>            Assignee: Tibor Digana
>
> When using the maven surefire plugin with unit tests that make use of the 
> {{CdiRunner}} (which internally fires up a Weld context) I am facing problems 
> with classpaths that contain characters that need url encoding.
> I have created the following debug output in my test class in the 
> {{@BeforeClass}} method:
> {code}
> System.out.println("----WELD-TEST----");
> System.out.println(ConverterTest.class.getClassLoader().getResource("."));
> System.out.println("----WELD-TEST-END----");
> {code}
> This prints the following output: 
> {{file:/C:/sources%402/parser/target/test-classes/}}
> When the tests are launched from IntelliJ the output looks like this: 
> {{file:/C:/sources@2/parser/target/test-classes/}}
> Note the @2 versus %402. In the end this causes Reflections (used by Weld) to 
> fail, because it attempts to urlencode the classpath and ends up with 
> {{file:/C:/sources%25402/parser/target/test-classes/}} and gets exceptions 
> when attempting to read files and directories.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to