You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Christian Stein (Jira)" <ji...@apache.org> on 2020/06/08 09:57:00 UTC

[jira] [Commented] (SUREFIRE-1765) target/test-classes should not be added to classpath when tests run on modulepath using patch-module

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

Christian Stein commented on SUREFIRE-1765:
-------------------------------------------

With Surefire 3.0.0-M5 being released soon and the junit-platform-maven-plugin already mentioned above -- I created a branch in the micromata/sawdust project showing current issues of Surefire 3.0.0-M4 with running tests in the modular world. Find details in the log of https://travis-ci.org/github/micromata/sawdust/builds/695936739

Having said that, I'm looking forward to update to Surefire 3.0.0-M5 to test-drive its new module-related capabilities implemented in https://issues.apache.org/jira/browse/SUREFIRE-1733 I expect some (all?) modular samples of the micromata/sawdust matrix to execute tests successfully.

> target/test-classes should not be added to classpath when tests run on modulepath using patch-module
> ----------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-1765
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1765
>             Project: Maven Surefire
>          Issue Type: Bug
>    Affects Versions: 2.22.1, 2.22.2
>            Reporter: Tom De Wolf
>            Priority: Major
>         Attachments: reproduce-xxxAnnotation-jdk-bug.zip
>
>
> When running junit tests using the maven-surefire-plugin the target/test-classes are added as first entry in the classpath.
> However, when testing a explicit java module with a module-info.java the test-classes are already part of the module path using --patch-module. So they should not be on the classpath?
> In some scenario's this can give unwanted side-effects, i.e. that the same classes are on the modulepath and classpath, possibly with a module-info.class in both locations (cfr [https://bugs.openjdk.java.net/browse/JDK-8241770).]
> So it seems that it is best that target/test-classes is only added to the classpath when it is not put on the module-path.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)