[
https://issues.apache.org/jira/browse/SUREFIRE-1765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17265091#comment-17265091
]
Peter Hicks commented on SUREFIRE-1765:
---------------------------------------
Sorry to butt in - I've been battling with a problem for the past few weeks
related to the changed behaviour in M5 which I think is covered under this
issue, but I need some assistance to confirm.
I've made a test-case at [https://github.com/poggs/spring-autowire-it-problem]
which shows the issue with a Spring integration test and autowiring. Reverting
back to M4 fixes it, as does adding target/classes using
<additionalClassPathElements> in the <configuration> stanza in pom.xml.
Is this a regression or merely changed behaviour? If it's the latter, what's
the changes that a user needs to make in their project to run integration tests
with Spring?
> 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)