Author: rfscholte Date: Thu Apr 28 19:45:10 2016 New Revision: 1741500 URL: http://svn.apache.org/viewvc?rev=1741500&view=rev Log: Improve testCompile with modules
Modified: maven/plugins/branches/maven-compiler-plugin_jigsaw-ea/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java Modified: maven/plugins/branches/maven-compiler-plugin_jigsaw-ea/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-compiler-plugin_jigsaw-ea/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java?rev=1741500&r1=1741499&r2=1741500&view=diff ============================================================================== --- maven/plugins/branches/maven-compiler-plugin_jigsaw-ea/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java (original) +++ maven/plugins/branches/maven-compiler-plugin_jigsaw-ea/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java Thu Apr 28 19:45:10 2016 @@ -215,27 +215,16 @@ public class TestCompilerMojo if ( hasMainModuleDescriptor ) { - if ( compilerArgs == null ) - { - compilerArgs = new ArrayList<String>(); - } - - try - { - // - String moduleName = new AsmModuleInfoParser().getModuleName( mainOutputDirectory ); - compilerArgs.add( "-Xmodule:" + moduleName ); - compilerArgs.add( "-XaddReads:" + moduleName + "=ALL-UNNAMED" ); - } - catch ( IOException e ) - { - // TODO Auto-generated catch block - e.printStackTrace(); - } + // maybe some extra analysis required } else { // very odd + // Means that main sources must be compiled with -modulesource and -Xmodule:<moduleName> + // However, this has a huge impact since you can't simply use it as a classpathEntry + // due to extra folder in between + throw new UnsupportedOperationException( "Can't compile test sources " + + "when main sources are missing a module descriptor" ); } } else