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

Stephen Colebourne commented on SUREFIRE-1497:
----------------------------------------------

The attachment shows the problem.

When surefire is set to v2.21.0 it tests in "module mode", using the service 
list in module-info.java.

When surefire is set to v2.20.1 it tests in "classpath mode", using the service 
list in META-INF/services.

The attached project is setup such that "module mode" is correct but "classpath 
mode" has a bug. As a library author, I cannot control or know whether the 
project will be used in "module mode" or "classpath mode". As such, what is 
needed is a way to test in both "module mode" and "classpath mode" - at present 
surefire provides no mechanism to test both modes.

NOTE: The attached project uses surefire v2.21.0 so will pass. Change the 
pom.xml version of surefire to v2.20.1 to see it fail (because the 
META-INF/services file is incorrect).

 

> Flag to select modulepath or classpath
> --------------------------------------
>
>                 Key: SUREFIRE-1497
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1497
>             Project: Maven Surefire
>          Issue Type: Improvement
>    Affects Versions: 2.21.0
>            Reporter: Stephen Colebourne
>            Priority: Major
>         Attachments: maven-issue4.zip
>
>
> SUREFIRE-1262 added the ability to run tests using the modulepath, which is 
> great. However, as a library developer I cannot guarantee that the code will 
> be run on the modulepath, it might well be run on the classpath.
> As such, can I request a flag that turns the behaviour in SUREFIRE-1262 on 
> and off? This would allow a single pom.xml to run surefire twice, once with 
> the code on the modulepath and once with the code on the classpath, to ensure 
> that the behaviour always works however the code is run. (Other solutions to 
> achieve the same goal may be possible, but this seems the most obvious).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to