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/08/13 18:16:40 UTC

svn commit: r1804935 - in /maven/plugins/trunk/maven-compiler-plugin: ./ src/it/MCOMPILER-268_modulepath/ src/it/MCOMPILER-268_modulepath/src/main/java/ src/it/MCOMPILER-294/ src/it/MCOMPILER-294/app/ src/it/MCOMPILER-294/app/src/ src/it/MCOMPILER-294/...

Author: rfscholte
Date: Sun Aug 13 18:16:40 2017
New Revision: 1804935

URL: http://svn.apache.org/viewvc?rev=1804935&view=rev
Log:
[MCOMPILER-304] Introduce plexus-language component

Added:
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/app/
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/app/pom.xml
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/app/src/
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/app/src/main/
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/app/src/main/java/
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/app/src/main/java/module-info.java
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/app/src/main/java/org/
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/app/src/main/java/org/maven/
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/app/src/main/java/org/maven/test/
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/app/src/main/java/org/maven/test/app/
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/app/src/main/java/org/maven/test/app/Main.java
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/invoker.properties
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/lib/
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/lib/pom.xml
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/lib/src/
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/lib/src/main/
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/lib/src/main/java/
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/lib/src/main/java/module-info.java
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/lib/src/main/java/org/
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/lib/src/main/java/org/maven/
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/lib/src/main/java/org/maven/test/
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/lib/src/main/java/org/maven/test/lib/
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/lib/src/main/java/org/maven/test/lib/Sout.java
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/pom.xml
Removed:
    maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/module/
Modified:
    maven/plugins/trunk/maven-compiler-plugin/pom.xml
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-268_modulepath/pom.xml
    maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-268_modulepath/src/main/java/module-info.java
    maven/plugins/trunk/maven-compiler-plugin/src/it/automodules-application/verify.groovy
    maven/plugins/trunk/maven-compiler-plugin/src/it/automodules-library/verify.groovy
    maven/plugins/trunk/maven-compiler-plugin/src/it/automodules-transitive-module/verify.groovy
    maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java
    maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java
    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=1804935&r1=1804934&r2=1804935&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-compiler-plugin/pom.xml Sun Aug 13 18:16:40 2017
@@ -68,6 +68,7 @@ under the License.
     <groovyEclipseCompilerVersion>2.7.0-01</groovyEclipseCompilerVersion>
     <groovy-eclipse-batch>2.0.4-04</groovy-eclipse-batch>
     <openJpaVersion>2.2.0</openJpaVersion>
+    <javaVersion>7</javaVersion>
   </properties>
 
   <contributors>
@@ -110,14 +111,9 @@ under the License.
     </dependency>
 
     <dependency>
-      <groupId>org.ow2.asm</groupId>
-      <artifactId>asm</artifactId>
-      <version>6.0_BETA</version>
-    </dependency>
-    <dependency>
-      <groupId>com.thoughtworks.qdox</groupId>
-      <artifactId>qdox</artifactId>
-      <version>2.0-M7</version>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-java</artifactId>
+      <version>0.9.1</version>
     </dependency>
 
     <dependency>
@@ -313,18 +309,4 @@ under the License.
       </dependencies>
     </profile>
   </profiles>
-
-  <repositories>
-    <repository>
-      <releases>
-        <enabled>false</enabled>
-      </releases>
-      <snapshots>
-        <enabled>true</enabled>
-      </snapshots>
-      <id>plexus-snapshots</id>
-      <name>Plexus Snapshot Repository</name>
-      <url>https://oss.sonatype.org/content/repositories/plexus-snapshots</url>
-    </repository>
-  </repositories>
 </project>

Modified: maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-268_modulepath/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-268_modulepath/pom.xml?rev=1804935&r1=1804934&r2=1804935&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-268_modulepath/pom.xml (original)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-268_modulepath/pom.xml Sun Aug 13 18:16:40 2017
@@ -35,6 +35,11 @@
 
   <dependencies>
     <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+      <version>3.6</version>
+    </dependency>
+    <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <version>3.8.2</version>

Modified: maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-268_modulepath/src/main/java/module-info.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-268_modulepath/src/main/java/module-info.java?rev=1804935&r1=1804934&r2=1804935&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-268_modulepath/src/main/java/module-info.java (original)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-268_modulepath/src/main/java/module-info.java Sun Aug 13 18:16:40 2017
@@ -18,5 +18,5 @@
  */
 
 module M.N {
-    
+    requires org.apache.commons.lang3;
 }
\ No newline at end of file

Added: maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/app/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/app/pom.xml?rev=1804935&view=auto
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/app/pom.xml (added)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/app/pom.xml Sun Aug 13 18:16:40 2017
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.plugins.compiler.it</groupId>
+    <artifactId>mcompiler294</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>app</artifactId>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.plugins.compiler.it</groupId>
+      <artifactId>lib</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+
+</project>

Added: maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/app/src/main/java/module-info.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/app/src/main/java/module-info.java?rev=1804935&view=auto
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/app/src/main/java/module-info.java (added)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/app/src/main/java/module-info.java Sun Aug 13 18:16:40 2017
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+module org.maven.test.app {
+    requires org.maven.test.lib;
+}
\ No newline at end of file

Added: maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/app/src/main/java/org/maven/test/app/Main.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/app/src/main/java/org/maven/test/app/Main.java?rev=1804935&view=auto
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/app/src/main/java/org/maven/test/app/Main.java (added)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/app/src/main/java/org/maven/test/app/Main.java Sun Aug 13 18:16:40 2017
@@ -0,0 +1,32 @@
+package org.maven.test.app;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.maven.test.lib.Sout;
+
+public class Main {
+    
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        Sout.println( args );
+    }
+}
\ No newline at end of file

Added: maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/invoker.properties?rev=1804935&view=auto
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/invoker.properties (added)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/invoker.properties Sun Aug 13 18:16:40 2017
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+invoker.java.version = 9+
+invoker.goals = compile

Added: maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/lib/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/lib/pom.xml?rev=1804935&view=auto
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/lib/pom.xml (added)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/lib/pom.xml Sun Aug 13 18:16:40 2017
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.plugins.compiler.it</groupId>
+    <artifactId>mcompiler294</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>lib</artifactId>
+
+</project>

Added: maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/lib/src/main/java/module-info.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/lib/src/main/java/module-info.java?rev=1804935&view=auto
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/lib/src/main/java/module-info.java (added)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/lib/src/main/java/module-info.java Sun Aug 13 18:16:40 2017
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+module org.maven.test.lib {
+    exports org.maven.test.lib;
+}
\ No newline at end of file

Added: maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/lib/src/main/java/org/maven/test/lib/Sout.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/lib/src/main/java/org/maven/test/lib/Sout.java?rev=1804935&view=auto
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/lib/src/main/java/org/maven/test/lib/Sout.java (added)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/lib/src/main/java/org/maven/test/lib/Sout.java Sun Aug 13 18:16:40 2017
@@ -0,0 +1,33 @@
+package org.maven.test.lib;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+public class Sout {
+    
+    /**
+     * @param args
+     */
+    public static void println(String[] args) {
+        for ( String string : args )
+        {
+            System.out.println( args );
+        }
+    }
+}
\ No newline at end of file

Added: maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/pom.xml?rev=1804935&view=auto
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/pom.xml (added)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/MCOMPILER-294/pom.xml Sun Aug 13 18:16:40 2017
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.plugins.compiler.it</groupId>
+  <artifactId>mcompiler294</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <url>https://issues.apache.org/jira/browse/MCOMPILER-294</url>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>@project.version@</version>
+        <configuration>
+          <release>9</release>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  
+  <modules>
+    <module>lib</module>
+    <module>app</module>
+  </modules>
+
+</project>

Modified: maven/plugins/trunk/maven-compiler-plugin/src/it/automodules-application/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/automodules-application/verify.groovy?rev=1804935&r1=1804934&r2=1804935&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/automodules-application/verify.groovy (original)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/automodules-application/verify.groovy Sun Aug 13 18:16:40 2017
@@ -19,4 +19,4 @@
 
 buildLog = new File( basedir, 'build.log' ).text;
 
-assert buildLog.contains("[INFO] Required automodules detected. Please don't publish this project to a public artifact repository!");
+assert buildLog.contains("[INFO] Required filename-based automodules detected. Please don't publish this project to a public artifact repository!");

Modified: maven/plugins/trunk/maven-compiler-plugin/src/it/automodules-library/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/automodules-library/verify.groovy?rev=1804935&r1=1804934&r2=1804935&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/automodules-library/verify.groovy (original)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/automodules-library/verify.groovy Sun Aug 13 18:16:40 2017
@@ -19,4 +19,4 @@
 
 buildLog = new File( basedir, 'build.log' ).text;
 
-assert buildLog.contains("[WARNING] * Required automodules detected. Please don't publish this project to a public artifact repository! *");
+assert buildLog.contains("[WARNING] * Required filename-based automodules detected. Please don't publish this project to a public artifact repository! *");

Modified: maven/plugins/trunk/maven-compiler-plugin/src/it/automodules-transitive-module/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/automodules-transitive-module/verify.groovy?rev=1804935&r1=1804934&r2=1804935&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/automodules-transitive-module/verify.groovy (original)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/automodules-transitive-module/verify.groovy Sun Aug 13 18:16:40 2017
@@ -19,4 +19,4 @@
 
 buildLog = new File( basedir, 'build.log' ).text;
 
-assert buildLog.contains("[WARNING] * Required automodules detected. Please don't publish this project to a public artifact repository! *");
+assert buildLog.contains("[WARNING] * Required filename-based automodules detected. Please don't publish this project to a public artifact repository! *");

Modified: maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java?rev=1804935&r1=1804934&r2=1804935&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java (original)
+++ maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java Sun Aug 13 18:16:40 2017
@@ -1227,7 +1227,7 @@ public abstract class AbstractCompilerMo
 
     //TODO remove the part with ToolchainManager lookup once we depend on
     //3.0.9 (have it as prerequisite). Define as regular component field then.
-    private Toolchain getToolchain()
+    protected final Toolchain getToolchain()
     {
         Toolchain tc = null;
         

Modified: maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java?rev=1804935&r1=1804934&r2=1804935&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java (original)
+++ maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java Sun Aug 13 18:16:40 2017
@@ -31,12 +31,6 @@ import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.compiler.module.JavaModuleDescriptor;
-import org.apache.maven.plugin.compiler.module.ModuleInfoParser;
-import org.apache.maven.plugin.compiler.module.ProjectAnalyzer;
-import org.apache.maven.plugin.compiler.module.ProjectAnalyzerRequest;
-import org.apache.maven.plugin.compiler.module.ProjectAnalyzerResult;
-import org.apache.maven.plugins.annotations.Component;
 import org.apache.maven.plugins.annotations.LifecyclePhase;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.Parameter;
@@ -44,9 +38,17 @@ import org.apache.maven.plugins.annotati
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.shared.utils.StringUtils;
 import org.apache.maven.shared.utils.logging.MessageUtils;
+import org.apache.maven.toolchain.Toolchain;
+import org.apache.maven.toolchain.java.DefaultJavaToolChain;
 import org.codehaus.plexus.compiler.util.scan.SimpleSourceInclusionScanner;
 import org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner;
 import org.codehaus.plexus.compiler.util.scan.StaleSourceScanner;
+import org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptor;
+import org.codehaus.plexus.languages.java.jpms.LocationManager;
+import org.codehaus.plexus.languages.java.jpms.QDoxModuleInfoParser;
+import org.codehaus.plexus.languages.java.jpms.ResolvePathsRequest;
+import org.codehaus.plexus.languages.java.jpms.ResolvePathsResult;
+import org.codehaus.plexus.languages.java.jpms.ResolvePathsResult.ModuleNameSource;
 
 /**
  * Compiles application sources
@@ -115,11 +117,9 @@ public class CompilerMojo
     @Parameter
     private boolean allowPartialRequirements;
 
-    @Component( hint = "qdox" )
-    private ModuleInfoParser moduleInfoParser;
+    private QDoxModuleInfoParser moduleInfoParser = new QDoxModuleInfoParser();
 
-    @Component
-    private ProjectAnalyzer projectAnalyzer;
+    private LocationManager locationManager = new LocationManager();
 
     private List<String> classpathElements;
 
@@ -177,7 +177,7 @@ public class CompilerMojo
             {
                 try
                 {
-                    moduleDescriptor = moduleInfoParser.getModuleDescriptor( sourceFile.getParentFile() );
+                    moduleDescriptor = moduleInfoParser.fromSourcePath( sourceFile.getParentFile().toPath() );
                 }
                 catch ( IOException e )
                 {
@@ -197,92 +197,57 @@ public class CompilerMojo
             modulepathElements = new ArrayList<String>( compilePath.size() );
             classpathElements = new ArrayList<String>( compilePath.size() );
 
-            ProjectAnalyzerResult analyzerResult;
+            ResolvePathsResult<File> analyzerResult;
             try
             {
                 Collection<File> dependencyArtifacts = getCompileClasspathElements( getProject() );
+                
+                ResolvePathsRequest<File> request =
+                    ResolvePathsRequest.withFiles( dependencyArtifacts ).setMainModuleDescriptor( moduleDescriptor );
+                
+                Toolchain toolchain = getToolchain();
+                if ( toolchain != null && toolchain instanceof DefaultJavaToolChain )
+                {
+                    request.setJdkHome( new File( ( (DefaultJavaToolChain) toolchain ).getJavaHome() ) );
+                }
 
-                ProjectAnalyzerRequest analyzerRequest = new ProjectAnalyzerRequest()
-                                .setBaseModuleDescriptor( moduleDescriptor )
-                                .setDependencyArtifacts( dependencyArtifacts );
-
-                analyzerResult = projectAnalyzer.analyze( analyzerRequest );
+                analyzerResult = locationManager.resolvePaths( request );
 
-                if ( !analyzerResult.getRequiredAutomaticModules().isEmpty() )
+                for ( Map.Entry<File, ModuleNameSource> entry : analyzerResult.getModulepathElements().entrySet() )
                 {
-                    boolean filenameBased = false;
-                    
-                    for ( String automodule : analyzerResult.getRequiredAutomaticModules() )
+                    if ( ModuleNameSource.FILENAME.equals( entry.getValue() ) )
                     {
-                        filenameBased =
-                            ProjectAnalyzerResult.ModuleNameSource.FILENAME.equals( 
-                                                            analyzerResult.getModuleNameSource( automodule ) );
-                        
-                        if ( filenameBased )
+                        final String message = "Required filename-based automodules detected. "
+                            + "Please don't publish this project to a public artifact repository!";
+
+                        if ( moduleDescriptor.exports().isEmpty() )
                         {
-                            final String message = "Required automodules detected. "
-                                + "Please don't publish this project to a public artifact repository!";
-                            
-                            if ( moduleDescriptor.exports().isEmpty() )
-                            {
-                                // application
-                                getLog().info( message );
-                            }
-                            else
-                            {
-                                // library
-                                writeBoxedWarning( message );
-                            }
-                            
-                            break;
+                            // application
+                            getLog().info( message );
                         }
+                        else
+                        {
+                            // library
+                            writeBoxedWarning( message );
+                        }
+                        break;
                     }
                 }
                 
-                for ( Map.Entry<File, JavaModuleDescriptor> entry : analyzerResult.getPathElements().entrySet() )
+                for ( File file : analyzerResult.getClasspathElements() )
                 {
-                    if ( !allowPartialRequirements )
-                    {
-                        modulepathElements.add( entry.getKey().getPath() );
-                    }
-                    else if ( entry.getValue() == null )
-                    {
-                        classpathElements.add( entry.getKey().getPath() );
-                    }
-                    else if ( analyzerResult.getRequiredNormalModules().contains( entry.getValue().name() ) )
-                    {
-                        modulepathElements.add( entry.getKey().getPath() );
-                    }
-                    else if ( analyzerResult.getRequiredAutomaticModules().contains( entry.getValue().name() ) )
-                    {
-                        modulepathElements.add( entry.getKey().getPath() );
-                    }
-                    else
-                    {
-                        classpathElements.add( entry.getKey().getPath() );
-                    }
+                    classpathElements.add( file.getPath() );
+                }
+                
+                for ( File file : analyzerResult.getModulepathElements().keySet() )
+                {
+                    modulepathElements.add( file.getPath() );
                 }
             }
             catch ( IOException e )
             {
                 getLog().warn( e.getMessage() );
             }
-
-//            if ( !classpathElements.isEmpty() )
-//            {
-//                if ( compilerArgs == null )
-//                {
-//                    compilerArgs = new ArrayList<String>();
-//                }
-//                compilerArgs.add( "--add-reads" );
-//                compilerArgs.add( moduleDescriptor.name() + "=ALL-UNNAMED" );
-//
-//                if ( !modulepathElements.isEmpty() )
-//                {
-//                    compilerArgs.add( "--add-reads" );
-//                    compilerArgs.add( "ALL-MODULE-PATH=ALL-UNNAMED" );
-//                }
-//            }
         }
         else
         {

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=1804935&r1=1804934&r2=1804935&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 Sun Aug 13 18:16:40 2017
@@ -20,25 +20,30 @@ package org.apache.maven.plugin.compiler
  */
 
 import java.io.File;
+import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Arrays;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
-import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
 import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.compiler.module.ModuleInfoParser;
-import org.apache.maven.plugins.annotations.Component;
 import org.apache.maven.plugins.annotations.LifecyclePhase;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.toolchain.Toolchain;
+import org.apache.maven.toolchain.java.DefaultJavaToolChain;
 import org.codehaus.plexus.compiler.util.scan.SimpleSourceInclusionScanner;
 import org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner;
 import org.codehaus.plexus.compiler.util.scan.StaleSourceScanner;
+import org.codehaus.plexus.languages.java.jpms.AsmModuleInfoParser;
+import org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptor;
+import org.codehaus.plexus.languages.java.jpms.LocationManager;
+import org.codehaus.plexus.languages.java.jpms.ResolvePathsRequest;
+import org.codehaus.plexus.languages.java.jpms.ResolvePathsResult;
 
 /**
  * Compiles application test sources.
@@ -153,13 +158,14 @@ public class TestCompilerMojo
 
     @Parameter( defaultValue = "${project.testClasspathElements}", readonly = true )
     private List<String> testPath;
+
+    private AsmModuleInfoParser asmModuleInfoParser = new AsmModuleInfoParser();
     
-    @Component
-    private Map<String, ModuleInfoParser> moduleInfoParsers;
+    private LocationManager locationManager = new LocationManager();
 
-    private List<String> classpathElements;
+    private Collection<String> classpathElements;
 
-    private List<String> modulepathElements;
+    private Collection<String> modulepathElements;
 
     public void execute()
         throws MojoExecutionException, CompilationFailureException
@@ -179,13 +185,13 @@ public class TestCompilerMojo
 
     protected List<String> getClasspathElements()
     {
-        return classpathElements;
+        return new ArrayList<>( classpathElements );
     }
-    
+
     @Override
     protected List<String> getModulepathElements()
     {
-        return modulepathElements;
+        return new ArrayList<>( modulepathElements );
     }
 
     protected File getOutputDirectory()
@@ -213,9 +219,6 @@ public class TestCompilerMojo
             }
         }
         
-        List<String> testScopedElements = new ArrayList<String>( testPath );
-        testScopedElements.removeAll( compilePath );
-        
         if ( release != null )
         {
             if ( Integer.valueOf( release ) < 9 )
@@ -255,18 +258,39 @@ public class TestCompilerMojo
         {
             if ( hasMainModuleDescriptor )
             {
-                modulepathElements = compilePath;
-                classpathElements = testScopedElements;
-                if ( compilerArgs == null )
+                JavaModuleDescriptor moduleDescriptor;
+                ResolvePathsResult<String> result;
+                
+                try
                 {
-                    compilerArgs = new ArrayList<String>();
+                    moduleDescriptor = getModuleDescriptor( mainOutputDirectory );
+
+                    ResolvePathsRequest<String> request =
+                        ResolvePathsRequest.withStrings( testPath ).setMainModuleDescriptor( moduleDescriptor );
+                    
+                    Toolchain toolchain = getToolchain();
+                    if ( toolchain != null && toolchain instanceof DefaultJavaToolChain )
+                    {
+                        request.setJdkHome( new File( ( (DefaultJavaToolChain) toolchain ).getJavaHome() ) );
+                    }
+                    
+                    result = locationManager.resolvePaths( request );
+                }
+                catch ( IOException e )
+                {
+                    throw new RuntimeException( e );
                 }
                 
-                String moduleName = getModuleName( mainOutputDirectory );
+                modulepathElements = result.getModulepathElements().keySet();
+                classpathElements = result.getClasspathElements();
                 
+                if ( compilerArgs == null )
+                {
+                    compilerArgs = new ArrayList<String>();
+                }
                 compilerArgs.add( "--patch-module" );
                 
-                StringBuilder addReadsValue = new StringBuilder( moduleName )
+                StringBuilder addReadsValue = new StringBuilder( moduleDescriptor.name() )
                                 .append( '=' )
                                 .append( mainOutputDirectory )
                                 .append( PS );
@@ -278,7 +302,7 @@ public class TestCompilerMojo
                 compilerArgs.add( addReadsValue.toString() );
                 
                 compilerArgs.add( "--add-reads" );
-                compilerArgs.add( moduleName + "=ALL-UNNAMED" );
+                compilerArgs.add( moduleDescriptor.name() + "=ALL-UNNAMED" );
             }
             else
             {
@@ -288,46 +312,9 @@ public class TestCompilerMojo
         }
     }
 
-    private String getModuleName( File mainOutputDirectory )
+    private JavaModuleDescriptor getModuleDescriptor( File mainOutputDirectory ) throws IOException
     {
-        String moduleName = null;
-        
-        Map<String, Exception> exceptionMap = new LinkedHashMap<String, Exception>( moduleInfoParsers.size() ); 
-        
-        List<String> parserKeys = Arrays.asList( "reflect", "asm" );
-        
-        // The class format is still changing, for that reason provide multiple strategies to parse module-info 
-        for ( String parserKey: parserKeys )
-        {
-            ModuleInfoParser parser = moduleInfoParsers.get( parserKey );
-
-            try
-            {
-                moduleName = parser.getModuleDescriptor( mainOutputDirectory  ).name();
-                
-                if ( moduleName != null )
-                {
-                    break;
-                }
-            }
-            catch ( Exception e )
-            {
-                exceptionMap.put( parserKey, e );
-            }
-        }
-        
-        if ( moduleName == null )
-        {
-            getLog().error( "Failed to parse module-info:" );
-            
-            for ( Map.Entry<String, Exception> exception : exceptionMap.entrySet() )
-            {
-                getLog().error( "With " + exception.getKey() + ": " + exception.getValue().getMessage() );
-            }
-            
-            throw new RuntimeException( "Failed to parse module-info" );
-        }
-        return moduleName;
+        return asmModuleInfoParser.getModuleDescriptor( mainOutputDirectory.toPath() );
     }
 
     protected SourceInclusionScanner getSourceInclusionScanner( int staleMillis )