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 2019/01/04 20:28:07 UTC

[maven-javadoc-plugin] branch MJAVADOC-555 updated: [MJAVADOC-555] Javadoc:aggregate, Javadoc:jar fail if one of the modules does not contain module-info.java Testcase 2: link with automatic module

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

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


The following commit(s) were added to refs/heads/MJAVADOC-555 by this push:
     new e33813f  [MJAVADOC-555] Javadoc:aggregate, Javadoc:jar fail if one of the modules does not contain module-info.java Testcase 2: link with automatic module
e33813f is described below

commit e33813ff0b9f67b0ccf667078801d6f4e3ede86c
Author: rfscholte <rf...@apache.org>
AuthorDate: Fri Jan 4 21:28:01 2019 +0100

    [MJAVADOC-555] Javadoc:aggregate, Javadoc:jar fail if one of the modules does not contain module-info.java
    Testcase 2: link with automatic module
---
 .../invoker.properties                             | 19 ++++++
 .../MJAVADOC-555_link-automatic-modules/pom.xml    | 75 ++++++++++++++++++++++
 .../src/main/java/com/testcase/Testcase.java       | 30 +++++++++
 .../src/main/java/module-info.java                 | 22 +++++++
 .../verify.groovy                                  | 33 ++++++++++
 5 files changed, 179 insertions(+)

diff --git a/src/it/projects/MJAVADOC-555_link-automatic-modules/invoker.properties b/src/it/projects/MJAVADOC-555_link-automatic-modules/invoker.properties
new file mode 100644
index 0000000..d47ff2a
--- /dev/null
+++ b/src/it/projects/MJAVADOC-555_link-automatic-modules/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
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-555_link-automatic-modules/pom.xml b/src/it/projects/MJAVADOC-555_link-automatic-modules/pom.xml
new file mode 100644
index 0000000..6c5522c
--- /dev/null
+++ b/src/it/projects/MJAVADOC-555_link-automatic-modules/pom.xml
@@ -0,0 +1,75 @@
+<?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>testcase</groupId>
+  <artifactId>javadoc-cannot-link-to-automatic-modules</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <url>https://issues.apache.org/jira/browse/MJAVADOC-555</url>
+  
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <guava.version>27.0.1-jre</guava.version>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.8.0</version>
+        <configuration>
+          <release>9</release>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <version>@project.version@</version>
+        <executions>
+          <execution>
+            <id>attach-javadocs</id>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+            <configuration>
+              <links>
+                <link>https://google.github.io/guava/releases/${guava.version}/api/docs/</link>
+              </links>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+      <version>${guava.version}</version>
+    </dependency>
+  </dependencies>
+</project>
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-555_link-automatic-modules/src/main/java/com/testcase/Testcase.java b/src/it/projects/MJAVADOC-555_link-automatic-modules/src/main/java/com/testcase/Testcase.java
new file mode 100644
index 0000000..0dedddd
--- /dev/null
+++ b/src/it/projects/MJAVADOC-555_link-automatic-modules/src/main/java/com/testcase/Testcase.java
@@ -0,0 +1,30 @@
+package com.testcase;
+
+/*
+ * 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 com.google.common.collect.Multimap;
+
+public class Testcase
+{
+	public Multimap<String, String> test()
+	{
+		return null;
+	}
+}
diff --git a/src/it/projects/MJAVADOC-555_link-automatic-modules/src/main/java/module-info.java b/src/it/projects/MJAVADOC-555_link-automatic-modules/src/main/java/module-info.java
new file mode 100644
index 0000000..05a60d9
--- /dev/null
+++ b/src/it/projects/MJAVADOC-555_link-automatic-modules/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 jul_to_slf4j
+{
+	requires com.google.common;
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-555_link-automatic-modules/verify.groovy b/src/it/projects/MJAVADOC-555_link-automatic-modules/verify.groovy
new file mode 100644
index 0000000..df3df50
--- /dev/null
+++ b/src/it/projects/MJAVADOC-555_link-automatic-modules/verify.groovy
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+def classFile 
+int javaVersion = System.getProperty( "java.specification.version" ) as Integer
+if ( javaVersion >= 11 ) {
+ classFile = new File( basedir, 'target/apidocs/jul_to_slf4j/com/testcase/Testcase.html')
+} else {
+ classFile = new File( basedir, 'target/apidocs/com/testcase/Testcase.html')
+}
+
+def p = /<a href="([^"]+)"(?:[^>]+)>Multimap<\/a>/
+
+def m = classFile.text =~ p
+
+assert m.hasGroup()
+assert m[0][1] == "https://google.github.io/guava/releases/27.0.1-jre/api/docs/com/google/common/collect/Multimap.html?is-external=true"