You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2017/10/24 19:48:37 UTC

svn commit: r1813229 - in /maven/plugins/trunk/maven-compiler-plugin: pom.xml src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java

Author: rfscholte
Date: Tue Oct 24 19:48:37 2017
New Revision: 1813229

URL: http://svn.apache.org/viewvc?rev=1813229&view=rev
Log:
[MCOMPILER-313] Support mrjar dependency with module descriptor only in META-INF/versions/x

Modified:
    maven/plugins/trunk/maven-compiler-plugin/pom.xml
    maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java

Modified: maven/plugins/trunk/maven-compiler-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/pom.xml?rev=1813229&r1=1813228&r2=1813229&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-compiler-plugin/pom.xml Tue Oct 24 19:48:37 2017
@@ -113,7 +113,7 @@ under the License.
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-java</artifactId>
-      <version>0.9.2</version>
+      <version>0.9.4</version>
     </dependency>
 
     <dependency>

Modified: maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java?rev=1813229&r1=1813228&r2=1813229&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java (original)
+++ maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java Tue Oct 24 19:48:37 2017
@@ -207,9 +207,9 @@ public class TestCompilerMojo
     protected void preparePaths( Set<File> sourceFiles )
     {
         File mainOutputDirectory = new File( getProject().getBuild().getOutputDirectory() );
-
-        boolean hasMainModuleDescriptor = new File( mainOutputDirectory, "module-info.class" ).exists();
         
+        File mainModuleDescriptor = new File( mainOutputDirectory, "module-info.class" );
+
         boolean hasTestModuleDescriptor = false;
         
         // Go through the source files to respect includes/excludes 
@@ -246,7 +246,7 @@ public class TestCompilerMojo
             modulepathElements = testPath;
             classpathElements = Collections.emptyList();
 
-            if ( hasMainModuleDescriptor )
+            if ( mainModuleDescriptor.exists() )
             {
                 // maybe some extra analysis required
             }
@@ -262,7 +262,7 @@ public class TestCompilerMojo
         }
         else
         {
-            if ( hasMainModuleDescriptor )
+            if ( mainModuleDescriptor.exists() )
             {
                 ResolvePathsResult<String> result;
                 
@@ -270,7 +270,7 @@ public class TestCompilerMojo
                 {
                     ResolvePathsRequest<String> request =
                         ResolvePathsRequest.withStrings( testPath )
-                                           .setMainModuleDescriptor( mainOutputDirectory.getAbsolutePath() );
+                                           .setMainModuleDescriptor( mainModuleDescriptor.getAbsolutePath() );
                     
                     Toolchain toolchain = getToolchain();
                     if ( toolchain != null && toolchain instanceof DefaultJavaToolChain )