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 2014/10/09 21:48:23 UTC

svn commit: r1630574 - in /maven/plugins/trunk/maven-javadoc-plugin: ./ src/it/MJAVADOC-365/ src/it/MJAVADOC-365/src/ src/it/MJAVADOC-365/src/main/ src/it/MJAVADOC-365/src/main/java/ src/it/MJAVADOC-365/src/main/java/foo/ src/main/java/org/apache/maven...

Author: rfscholte
Date: Thu Oct  9 19:48:22 2014
New Revision: 1630574

URL: http://svn.apache.org/r1630574
Log: (empty)

Added:
    maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/
    maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/invoker.properties
    maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/pom.xml
    maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/src/
    maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/src/main/
    maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/src/main/java/
    maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/src/main/java/foo/
    maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/src/main/java/foo/Excluded.java
    maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/src/main/java/foo/Included.java
    maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/verify.bsh
Modified:
    maven/plugins/trunk/maven-javadoc-plugin/pom.xml
    maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java

Modified: maven/plugins/trunk/maven-javadoc-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/pom.xml?rev=1630574&r1=1630573&r2=1630574&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/pom.xml Thu Oct  9 19:48:22 2014
@@ -86,6 +86,9 @@ under the License.
     <contributor>
       <name>Laird Nelson</name>
     </contributor>
+    <contributor>
+      <name>Richard Eckart de Castilho</name>
+    </contributor>
   </contributors>
 
   <dependencies>
@@ -417,6 +420,7 @@ under the License.
                 <pomInclude>site-failOnError/pom.xml</pomInclude>
                 <pomInclude>MJAVADOC-320/pom.xml</pomInclude>
                 <pomInclude>MJAVADOC-325/pom.xml</pomInclude>
+                <pomInclude>MJAVADOC-365/pom.xml</pomInclude>
                 <pomInclude>MJAVADOC-369/pom.xml</pomInclude>
                 <pomInclude>MJAVADOC-407/pom.xml</pomInclude>
               </pomIncludes>

Added: maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/invoker.properties?rev=1630574&view=auto
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/invoker.properties (added)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/invoker.properties Thu Oct  9 19:48:22 2014
@@ -0,0 +1,18 @@
+# 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.goals=clean javadoc:javadoc

Added: maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/pom.xml?rev=1630574&view=auto
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/pom.xml (added)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/pom.xml Thu Oct  9 19:48:22 2014
@@ -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.maven-javadoc-plugin.it</groupId>
+  <artifactId>mjavadoc-369</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <url>https://jira.codehaus.org/browse/MJAVADOC-365</url>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-javadoc-plugin</artifactId>
+          <version>@project.version@</version>
+          <configuration>
+            <sourceFileExcludes>
+              <exclude>**/*Excluded.java</exclude>
+            </sourceFileExcludes>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+</project>

Added: maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/src/main/java/foo/Excluded.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/src/main/java/foo/Excluded.java?rev=1630574&view=auto
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/src/main/java/foo/Excluded.java (added)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/src/main/java/foo/Excluded.java Thu Oct  9 19:48:22 2014
@@ -0,0 +1,31 @@
+package foo;
+
+/*
+ * 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 Excluded
+{
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+    }
+}

Added: maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/src/main/java/foo/Included.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/src/main/java/foo/Included.java?rev=1630574&view=auto
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/src/main/java/foo/Included.java (added)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/src/main/java/foo/Included.java Thu Oct  9 19:48:22 2014
@@ -0,0 +1,31 @@
+package foo;
+
+/*
+ * 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 Included
+{
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+    }
+}

Added: maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/verify.bsh?rev=1630574&view=auto
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/verify.bsh (added)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-365/verify.bsh Thu Oct  9 19:48:22 2014
@@ -0,0 +1,39 @@
+
+/*
+ * 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 java.io.*;
+import org.codehaus.plexus.util.*;
+
+File includedFile = new File( basedir, "target/site/apidocs/foo/Included.html" );
+File excludedFile = new File( basedir, "target/site/apidocs/foo/Excluded.html" );
+
+if ( !includedFile.exists() ) 
+{
+    System.err.println( includedFile.getAbsolutePath() + " is missing." );
+    return false;
+}
+
+if ( excludedFile.exists() ) 
+{
+    System.err.println( excludedFile.getAbsolutePath() + " is not excluded." );
+    return false;
+}
+
+return true;
\ No newline at end of file

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java?rev=1630574&r1=1630573&r2=1630574&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java Thu Oct  9 19:48:22 2014
@@ -1972,7 +1972,19 @@ public abstract class AbstractJavadocMoj
         // Write packages file and include it in the command line
         // ----------------------------------------------------------------------
 
-        if ( !packageNames.isEmpty() )
+        // MJAVADOC-365 if includes/excludes are specified, these take precedence over the default
+        // package-based mode and force javadoc into file-based mode unless subpackages are 
+        // specified. Subpackages take precedence over file-based include/excludes. Why? Because
+        // getFiles(...) returns an empty list when subpackages are specified.
+        boolean includesExcludesActive =
+            ( sourceFileIncludes != null && !sourceFileIncludes.isEmpty() )
+                || ( sourceFileExcludes != null && !sourceFileExcludes.isEmpty() );
+        if ( includesExcludesActive && !StringUtils.isEmpty( subpackages ) )
+        {
+            getLog().warn( "sourceFileIncludes and sourceFileExcludes have no effect when subpackages are specified!" );
+            includesExcludesActive = false;
+        }
+        if ( !packageNames.isEmpty() && !includesExcludesActive )
         {
             addCommandLinePackages( cmd, javadocOutputDirectory, packageNames );