Timo Heinonen created MCOMPILER-364:
---------------------------------------

             Summary: Multimodule project test problems with JPMS
                 Key: MCOMPILER-364
                 URL: https://issues.apache.org/jira/browse/MCOMPILER-364
             Project: Maven Compiler Plugin
          Issue Type: Bug
    Affects Versions: 3.8.0
            Reporter: Timo Heinonen


I'm using multimodule maven project with JPMS and can't get all tests to work, 
because classes are not found. It's possible to run all tests successfully 
using java 8 and classpath, but with modulepath classes from module A's test 
sources can not access classes from module B's test sources. 

Project structure:
 *  Module A
 ** src/main/java
 *** Packages
 **** a.foo
 *** module-info.java (exports a.foo)
 ** src/test/java
 *** Packages
 **** a.foo (includes tests for a.foo)
 **** a.bar (includes helper classes needed by module B's integration tests)
 *** module-info.java (exports a.bar)
 * Module B
 ** src/main/java
 *** Packages
 **** b.foo
 *** module-info.java (requires a)
 ** src/test/java
 *** Packages
 **** b.foo (includes tests for b.foo)
 **** b.bar (includes integration tests that require access to module A's 
a.bar-package)
 *** module-info.java (requires a)

I have added additional module-info.java for test sources in both modules 
because a.bar and b.bar are additional packages that need to be exported 
(https://issues.apache.org/jira/browse/MCOMPILER-341). Basically tests in 
package b.bar depend on classes in a.bar and therefore module A's test classes 
should be available when running module B's tests. However, when tests are run 
from module B, modulepath contains two jars from module A: module compiled from 
sources and module compiled from test sources. Both modules have same module 
name and classes required by B's tests are not found. 



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

Reply via email to