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/23 15:27:45 UTC

[maven-dependency-plugin] branch master updated: [MDEP-559] Java 9 bytecode cannot be parsed

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-dependency-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 8b75d89  [MDEP-559] Java 9 bytecode cannot be parsed
8b75d89 is described below

commit 8b75d89ab193f835b222b250413a19b1fe92bc81
Author: rfscholte <rf...@apache.org>
AuthorDate: Fri Feb 23 16:27:39 2018 +0100

    [MDEP-559] Java 9 bytecode cannot be parsed
---
 pom.xml                                            | 11 +++-
 .../mdep-599-analyze-java9/invoker.properties      | 19 +++++++
 src/it/projects/mdep-599-analyze-java9/pom.xml     | 60 ++++++++++++++++++++++
 .../src/main/java/hello/Hello.java                 | 24 +++++++++
 .../src/main/java/module-info.java                 | 22 ++++++++
 .../src/test/java/hello/HelloTest.java             | 33 ++++++++++++
 6 files changed, 167 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index df990a5..6ef6c63 100644
--- a/pom.xml
+++ b/pom.xml
@@ -206,7 +206,7 @@ under the License.
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
       <artifactId>maven-dependency-analyzer</artifactId>
-      <version>1.7</version>
+      <version>1.8</version>
       <exclusions>
         <exclusion>
           <artifactId>maven-project</artifactId>
@@ -322,6 +322,11 @@ under the License.
             </excludes>
           </configuration>
         </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-plugin-plugin</artifactId>
+          <version>3.5</version>
+        </plugin>
       </plugins>
     </pluginManagement>
     <plugins>
@@ -338,9 +343,11 @@ under the License.
               <rules>
                 <enforceBytecodeVersion>
                   <maxJdkVersion>${maven.compiler.target}</maxJdkVersion>
+                  <ignoreClasses>
+                    <ignoreClass>module-info</ignoreClass>
+                  </ignoreClasses>
                 </enforceBytecodeVersion>
               </rules>
-              <fail>true</fail>
             </configuration>
           </execution>
         </executions>
diff --git a/src/it/projects/mdep-599-analyze-java9/invoker.properties b/src/it/projects/mdep-599-analyze-java9/invoker.properties
new file mode 100644
index 0000000..9f015da
--- /dev/null
+++ b/src/it/projects/mdep-599-analyze-java9/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 = package ${project.groupId}:${project.artifactId}:${project.version}:analyze-only
diff --git a/src/it/projects/mdep-599-analyze-java9/pom.xml b/src/it/projects/mdep-599-analyze-java9/pom.xml
new file mode 100644
index 0000000..252dea6
--- /dev/null
+++ b/src/it/projects/mdep-599-analyze-java9/pom.xml
@@ -0,0 +1,60 @@
+<?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.dependency.its</groupId>
+  <artifactId>mdep-599</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <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>
+  </build>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.12</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.hamcrest</groupId>
+      <artifactId>hamcrest-core</artifactId>
+      <version>1.3</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/src/it/projects/mdep-599-analyze-java9/src/main/java/hello/Hello.java b/src/it/projects/mdep-599-analyze-java9/src/main/java/hello/Hello.java
new file mode 100644
index 0000000..7b5e10d
--- /dev/null
+++ b/src/it/projects/mdep-599-analyze-java9/src/main/java/hello/Hello.java
@@ -0,0 +1,24 @@
+package hello;
+
+/*
+ * 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 Hello
+{
+}
diff --git a/src/it/projects/mdep-599-analyze-java9/src/main/java/module-info.java b/src/it/projects/mdep-599-analyze-java9/src/main/java/module-info.java
new file mode 100644
index 0000000..ae8f768
--- /dev/null
+++ b/src/it/projects/mdep-599-analyze-java9/src/main/java/module-info.java
@@ -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 hello 
+{
+  exports hello;
+}
\ No newline at end of file
diff --git a/src/it/projects/mdep-599-analyze-java9/src/test/java/hello/HelloTest.java b/src/it/projects/mdep-599-analyze-java9/src/test/java/hello/HelloTest.java
new file mode 100644
index 0000000..97dfb69
--- /dev/null
+++ b/src/it/projects/mdep-599-analyze-java9/src/test/java/hello/HelloTest.java
@@ -0,0 +1,33 @@
+package hello;
+
+/*
+ * 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 static org.hamcrest.CoreMatchers.is;
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class HelloTest {
+
+  @Test
+  public void add() {
+    assertThat(1 + 1, is(2));
+  }
+
+}

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