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 2018/02/21 21:25:17 UTC

[maven-jdeps-plugin] branch master updated: [MJDEPS-10] Error: unknown option: -M while using module option of maven-jdeps-plugin

This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-jdeps-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new ea44fad  [MJDEPS-10] Error: unknown option: -M while using module option of maven-jdeps-plugin
ea44fad is described below

commit ea44fad322aa62fce130c4a46fa5fea8e7870328
Author: rfscholte <rf...@apache.org>
AuthorDate: Wed Feb 21 22:25:08 2018 +0100

    [MJDEPS-10] Error: unknown option: -M while using module option of maven-jdeps-plugin
---
 src/it/module/invoker.properties                   | 19 +++++++
 src/it/module/pom.xml                              | 62 ++++++++++++++++++++++
 src/it/module/src/main/java/module-info.java       | 19 +++++++
 .../org/apache/maven/plugins/jdeps/its/Main.java   | 28 ++++++++++
 .../maven/plugin/jdeps/AbstractJDepsMojo.java      | 11 ++--
 5 files changed, 134 insertions(+), 5 deletions(-)

diff --git a/src/it/module/invoker.properties b/src/it/module/invoker.properties
new file mode 100644
index 0000000..94d7b2d
--- /dev/null
+++ b/src/it/module/invoker.properties
@@ -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=process-classes
diff --git a/src/it/module/pom.xml b/src/it/module/pom.xml
new file mode 100644
index 0000000..6a8285b
--- /dev/null
+++ b/src/it/module/pom.xml
@@ -0,0 +1,62 @@
+<?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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  
+  <groupId>org.apache.maven.plugins.jdeps.its</groupId>
+  <artifactId>basic</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  
+  <properties>
+    <maven.compiler.release>9</maven.compiler.release>
+  </properties>
+  
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>3.7.0</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+    <plugins>
+      <plugin>
+        <groupId>@project.groupId@</groupId>
+        <artifactId>@project.artifactId@</artifactId>
+        <version>@project.version@</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>jdkinternals</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <module>maven.its.base</module>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file
diff --git a/src/it/module/src/main/java/module-info.java b/src/it/module/src/main/java/module-info.java
new file mode 100644
index 0000000..d27d0a2
--- /dev/null
+++ b/src/it/module/src/main/java/module-info.java
@@ -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.
+ */
+module maven.its.base {}
\ No newline at end of file
diff --git a/src/it/module/src/main/java/org/apache/maven/plugins/jdeps/its/Main.java b/src/it/module/src/main/java/org/apache/maven/plugins/jdeps/its/Main.java
new file mode 100644
index 0000000..221ec9c
--- /dev/null
+++ b/src/it/module/src/main/java/org/apache/maven/plugins/jdeps/its/Main.java
@@ -0,0 +1,28 @@
+package org.apache.maven.plugins.jdeps.its;
+
+/*
+ * 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 Main
+{
+   public static void main( String[] args )
+   {
+     System.out.println( "Hello World!" ); 
+   }    
+}
\ No newline at end of file
diff --git a/src/main/java/org/apache/maven/plugin/jdeps/AbstractJDepsMojo.java b/src/main/java/org/apache/maven/plugin/jdeps/AbstractJDepsMojo.java
index 35b322a..8182230 100644
--- a/src/main/java/org/apache/maven/plugin/jdeps/AbstractJDepsMojo.java
+++ b/src/main/java/org/apache/maven/plugin/jdeps/AbstractJDepsMojo.java
@@ -172,12 +172,12 @@ public abstract class AbstractJDepsMojo
     private boolean recursive;
 
     /**
-     * Show module containing the package
+     * Specifies the root module for analysis.
      * 
      * @since JDK 1.9.0
      */
-    @Parameter( defaultValue = "false", property = "jdeps.module" )
-    private boolean module;
+    @Parameter( property = "jdeps.module" )
+    private String module;
     
     @Component
     private ToolchainManager toolchainManager;
@@ -319,9 +319,10 @@ public abstract class AbstractJDepsMojo
             cmd.createArg().setValue( "-P" );
         }
         
-        if ( module )
+        if ( module != null )
         {
-            cmd.createArg().setValue( "-M" );
+            cmd.createArg().setValue( "-m" );
+            cmd.createArg().setValue( module );
         }
 
         if ( apiOnly )

-- 
To stop receiving notification emails like this one, please contact
rfscholte@apache.org.