You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2019/03/12 20:15:52 UTC

[GitHub] [maven-compiler-plugin] sormuras commented on a change in pull request #13: Emit a warning instead of throwing an exception

sormuras commented on a change in pull request #13: Emit a warning instead of throwing an exception
URL: https://github.com/apache/maven-compiler-plugin/pull/13#discussion_r264865001
 
 

 ##########
 File path: src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java
 ##########
 @@ -369,9 +369,11 @@ else if ( Double.valueOf( getTarget() ) < Double.valueOf( MODULE_INFO_TARGET ) )
                 // 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" );
+                // due to extra folder in between ... or the user wants to test his main code on the
+                // classpath used by a named module ... or ...
+                getLog().warn( "Modular black-box test compilation with no main module?!" );
+
+                // TODO classpathElements = List.of( mainOutputDirectory );
 
 Review comment:
   > "In order not to forget"
   
   This. I'm not sure what to do here, actually. That's why I implemented the `throws` variant first. Now, a warning is emitted, and any subsequent "mis-configuration" will lead to an error. Presumably when calling `javac`... but, as stated in the comment, this "main=classic + test=module" case is rare and not well understood.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services