You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2019/06/14 10:36:02 UTC

[maven-javadoc-plugin] branch master updated: [MJAVADOC-599] fix javadoc:aggregate-jar does not create the jar when executed as build plugin

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 43906f1  [MJAVADOC-599] fix javadoc:aggregate-jar does not create the jar when executed as build plugin
43906f1 is described below

commit 43906f119688ac8ad60c043a82878f1aeac1ca09
Author: olivier lamy <ol...@apache.org>
AuthorDate: Fri Jun 14 20:35:48 2019 +1000

    [MJAVADOC-599] fix javadoc:aggregate-jar does not create the jar when executed as build plugin
    
    Signed-off-by: olivier lamy <ol...@apache.org>
---
 .../MJAVADOC-569_aggr-mixed/invoker.properties     |  2 +-
 .../invoker.properties                             |  3 +-
 src/it/projects/MJAVADOC-599/pom.xml               | 51 ++++++++++++++++++++++
 src/it/projects/MJAVADOC-599/subproject1/pom.xml   | 35 +++++++++++++++
 .../subproject1/src/main/java/com/example/A.java   | 32 ++++++++++++++
 src/it/projects/MJAVADOC-599/subproject2/pom.xml   | 35 +++++++++++++++
 .../subproject2/src/main/java/com/example/B.java   | 32 ++++++++++++++
 src/it/projects/MJAVADOC-599/verify.groovy         | 22 ++++++++++
 .../apache/maven/plugins/javadoc/JavadocJar.java   |  2 +-
 9 files changed, 210 insertions(+), 4 deletions(-)

diff --git a/src/it/projects/MJAVADOC-569_aggr-mixed/invoker.properties b/src/it/projects/MJAVADOC-569_aggr-mixed/invoker.properties
index 3fc9dba..77c4ca1 100644
--- a/src/it/projects/MJAVADOC-569_aggr-mixed/invoker.properties
+++ b/src/it/projects/MJAVADOC-569_aggr-mixed/invoker.properties
@@ -15,4 +15,4 @@
 # specific language governing permissions and limitations
 # under the License.
 invoker.java.version = 9+
-invoker.goals = package javadoc:aggregate
\ No newline at end of file
+invoker.goals = package javadoc:aggregate
diff --git a/src/it/projects/MJAVADOC-569_aggr-mixed/invoker.properties b/src/it/projects/MJAVADOC-599/invoker.properties
similarity index 92%
copy from src/it/projects/MJAVADOC-569_aggr-mixed/invoker.properties
copy to src/it/projects/MJAVADOC-599/invoker.properties
index 3fc9dba..37f1e6f 100644
--- a/src/it/projects/MJAVADOC-569_aggr-mixed/invoker.properties
+++ b/src/it/projects/MJAVADOC-599/invoker.properties
@@ -14,5 +14,4 @@
 # 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 javadoc:aggregate
\ No newline at end of file
+invoker.goals = package javadoc:aggregate-jar
diff --git a/src/it/projects/MJAVADOC-599/pom.xml b/src/it/projects/MJAVADOC-599/pom.xml
new file mode 100644
index 0000000..3a5c6e6
--- /dev/null
+++ b/src/it/projects/MJAVADOC-599/pom.xml
@@ -0,0 +1,51 @@
+<?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.javadoc.it</groupId>
+  <artifactId>mjavadoc-599</artifactId>
+  <packaging>pom</packaging>
+  <version>1.0-SNAPSHOT</version>
+
+  <modules>
+    <module>subproject1</module>
+    <module>subproject2</module>
+  </modules>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <maven.compiler.source>1.8</maven.compiler.source>
+    <maven.compiler.target>1.8</maven.compiler.target>
+  </properties>
+
+  <build>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-javadoc-plugin</artifactId>
+          <version>@project.version@</version>
+        </plugin>
+      </plugins>
+  </build>
+</project>
diff --git a/src/it/projects/MJAVADOC-599/subproject1/pom.xml b/src/it/projects/MJAVADOC-599/subproject1/pom.xml
new file mode 100644
index 0000000..9745b7f
--- /dev/null
+++ b/src/it/projects/MJAVADOC-599/subproject1/pom.xml
@@ -0,0 +1,35 @@
+<?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">
+  <parent>
+    <artifactId>mjavadoc-599</artifactId>
+    <groupId>org.apache.maven.plugins.javadoc.it</groupId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>subproject1</artifactId>
+
+  <name>subproject1</name>
+
+</project>
diff --git a/src/it/projects/MJAVADOC-599/subproject1/src/main/java/com/example/A.java b/src/it/projects/MJAVADOC-599/subproject1/src/main/java/com/example/A.java
new file mode 100644
index 0000000..381a5c1
--- /dev/null
+++ b/src/it/projects/MJAVADOC-599/subproject1/src/main/java/com/example/A.java
@@ -0,0 +1,32 @@
+package com.example;
+
+/*
+ * 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.
+ */
+
+/**
+ * Hello world!
+ *
+ */
+public class A
+{
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+    }
+}
diff --git a/src/it/projects/MJAVADOC-599/subproject2/pom.xml b/src/it/projects/MJAVADOC-599/subproject2/pom.xml
new file mode 100644
index 0000000..e110509
--- /dev/null
+++ b/src/it/projects/MJAVADOC-599/subproject2/pom.xml
@@ -0,0 +1,35 @@
+<?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">
+  <parent>
+    <artifactId>mjavadoc-599</artifactId>
+    <groupId>org.apache.maven.plugins.javadoc.it</groupId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>subproject2</artifactId>
+
+  <name>subproject2</name>
+
+</project>
diff --git a/src/it/projects/MJAVADOC-599/subproject2/src/main/java/com/example/B.java b/src/it/projects/MJAVADOC-599/subproject2/src/main/java/com/example/B.java
new file mode 100644
index 0000000..35589ac
--- /dev/null
+++ b/src/it/projects/MJAVADOC-599/subproject2/src/main/java/com/example/B.java
@@ -0,0 +1,32 @@
+package com.example;
+
+/*
+ * 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.
+ */
+
+/**
+ * Hello world!
+ *
+ */
+public class B
+{
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+    }
+}
diff --git a/src/it/projects/MJAVADOC-599/verify.groovy b/src/it/projects/MJAVADOC-599/verify.groovy
new file mode 100644
index 0000000..8d48b8b
--- /dev/null
+++ b/src/it/projects/MJAVADOC-599/verify.groovy
@@ -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.
+ */
+
+def file = new File( basedir, 'target/mjavadoc-599-1.0-SNAPSHOT-javadoc.jar' );
+
+assert file.exists()
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/JavadocJar.java b/src/main/java/org/apache/maven/plugins/javadoc/JavadocJar.java
index 8208f5c..97dca13 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/JavadocJar.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/JavadocJar.java
@@ -174,7 +174,7 @@ public class JavadocJar
             innerDestDir = new File( getOutputDirectory() );
         }
 
-        if ( isAggregator() || !"pom".equalsIgnoreCase( project.getPackaging() ) )
+        if ( !isAggregator() || !"pom".equalsIgnoreCase( project.getPackaging() ) )
         {
             ArtifactHandler artifactHandler = project.getArtifact().getArtifactHandler();
             if ( !"java".equals( artifactHandler.getLanguage() ) )