[maven-javadoc-plugin] branch master updated (dbbbc72 -> ff9aee5)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[maven-javadoc-plugin] branch master updated (dbbbc72 -> ff9aee5)

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

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


    from dbbbc72  moved to git
     new f67d3a4  [MJAVADOC-508] option to fail the build in case of javadoc warnings
     new ff9aee5  [MJAVADOC-508] add it test and fix bloody checkstyle :-)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../invoker.properties                             | 37 ++++-----
 .../{MJAVADOC-250 => MJAVADOC-508}/pom.xml         |  4 +-
 .../src/main/java/foo/bar/ALotOfLinkTags.java}     | 68 ++++++++--------
 .../maven/plugins/javadoc/AbstractJavadocMojo.java | 90 +++++++++++++---------
 4 files changed, 108 insertions(+), 91 deletions(-)
 copy src/it/projects/{MJAVADOC-384 => MJAVADOC-508}/invoker.properties (94%)
 copy src/it/projects/{MJAVADOC-250 => MJAVADOC-508}/pom.xml (92%)
 copy src/it/projects/{MJAVADOC-437/module1/src/main/java/com/example/foo/Foo.java => MJAVADOC-508/src/main/java/foo/bar/ALotOfLinkTags.java} (80%)

--
To stop receiving notification emails like this one, please contact
['"[hidden email]" <[hidden email]>'].
Reply | Threaded
Open this post in threaded view
|

[maven-javadoc-plugin] 01/02: [MJAVADOC-508] option to fail the build in case of javadoc warnings

olamy
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

commit f67d3a4940b76f189d072bc2e5d0a54335052006
Author: olivier lamy <[hidden email]>
AuthorDate: Fri Dec 29 20:12:08 2017 +1100

    [MJAVADOC-508] option to fail the build in case of javadoc warnings
   
    Signed-off-by: olivier lamy <[hidden email]>
---
 .../maven/plugins/javadoc/AbstractJavadocMojo.java | 87 ++++++++++++----------
 1 file changed, 49 insertions(+), 38 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
index a720528..46e9856 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
@@ -19,44 +19,6 @@ package org.apache.maven.plugins.javadoc;
  * under the License.
  */
 
-import static org.apache.maven.plugins.javadoc.JavadocUtil.isEmpty;
-import static org.apache.maven.plugins.javadoc.JavadocUtil.isNotEmpty;
-import static org.apache.maven.plugins.javadoc.JavadocUtil.toList;
-import static org.apache.maven.plugins.javadoc.JavadocUtil.toRelative;
-import static org.codehaus.plexus.util.IOUtil.close;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
 import org.apache.commons.lang3.ClassUtils;
 import org.apache.commons.lang3.JavaVersion;
 import org.apache.commons.lang3.SystemUtils;
@@ -134,6 +96,41 @@ import org.codehaus.plexus.util.cli.CommandLineUtils;
 import org.codehaus.plexus.util.cli.Commandline;
 import org.codehaus.plexus.util.xml.Xpp3Dom;
 
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Writer;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.StringTokenizer;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import static org.apache.maven.plugins.javadoc.JavadocUtil.*;
+import static org.codehaus.plexus.util.IOUtil.close;
+
 /**
  * Base class with majority of Javadoc functionalities.
  *
@@ -505,6 +502,15 @@ public abstract class AbstractJavadocMojo
     @Parameter( property = "maven.javadoc.failOnError", defaultValue = "true" )
     protected boolean failOnError;
 
+
+    /**
+     * Specifies if the build will fail if there are warning during javadoc execution or not.
+     *
+     * @since 3.0.1
+     */
+    @Parameter( property = "maven.javadoc.failOnWarnings", defaultValue = "false" )
+    protected boolean failOnWarnings;
+
     /**
      * Specifies to use the
      * <a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#standard">
@@ -5225,6 +5231,11 @@ public abstract class AbstractJavadocMojo
                 getLog().warn( current );
             }
         }
+
+        if ( StringUtils.isNotEmpty( err.getOutput() ) && failOnWarnings )
+        {
+            throw new MavenReportException( "Project contains Javadoc Warnings" );
+        }
     }
 
     /**

--
To stop receiving notification emails like this one, please contact
"[hidden email]" <[hidden email]>.
Reply | Threaded
Open this post in threaded view
|

[maven-javadoc-plugin] 02/02: [MJAVADOC-508] add it test and fix bloody checkstyle :-)

olamy
In reply to this post by olamy
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

commit ff9aee52511188d4b6be0a7089e1b885d40e427e
Author: olivier lamy <[hidden email]>
AuthorDate: Fri Dec 29 21:53:54 2017 +1100

    [MJAVADOC-508] add it test and fix bloody checkstyle :-)
   
    Signed-off-by: olivier lamy <[hidden email]>
---
 src/it/projects/MJAVADOC-508/invoker.properties    | 19 +++++++++
 src/it/projects/MJAVADOC-508/pom.xml               | 48 ++++++++++++++++++++++
 .../src/main/java/foo/bar/ALotOfLinkTags.java      | 35 ++++++++++++++++
 .../maven/plugins/javadoc/AbstractJavadocMojo.java |  5 ++-
 4 files changed, 106 insertions(+), 1 deletion(-)

diff --git a/src/it/projects/MJAVADOC-508/invoker.properties b/src/it/projects/MJAVADOC-508/invoker.properties
new file mode 100644
index 0000000..5068e6e
--- /dev/null
+++ b/src/it/projects/MJAVADOC-508/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.goals=clean javadoc:javadoc
+invoker.buildResult = failure
diff --git a/src/it/projects/MJAVADOC-508/pom.xml b/src/it/projects/MJAVADOC-508/pom.xml
new file mode 100644
index 0000000..e0e222f
--- /dev/null
+++ b/src/it/projects/MJAVADOC-508/pom.xml
@@ -0,0 +1,48 @@
+<?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-508</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <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>@pom.version@</version>
+          <configuration>
+            <failOnWarnings>true</failOnWarnings>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+</project>
diff --git a/src/it/projects/MJAVADOC-508/src/main/java/foo/bar/ALotOfLinkTags.java b/src/it/projects/MJAVADOC-508/src/main/java/foo/bar/ALotOfLinkTags.java
new file mode 100644
index 0000000..2605006
--- /dev/null
+++ b/src/it/projects/MJAVADOC-508/src/main/java/foo/bar/ALotOfLinkTags.java
@@ -0,0 +1,35 @@
+package foo.bar;
+
+/*
+ * 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.util.HashSet;
+import java.util.*;
+public class ALotOfLinkTags
+{
+
+
+    /**
+     */
+    public boolean aMethod( String[] args )
+    {
+        return true;
+    }
+
+}
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
index 46e9856..9897f83 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
@@ -128,7 +128,10 @@ import java.util.StringTokenizer;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import static org.apache.maven.plugins.javadoc.JavadocUtil.*;
+import static org.apache.maven.plugins.javadoc.JavadocUtil.toRelative;
+import static org.apache.maven.plugins.javadoc.JavadocUtil.toList;
+import static org.apache.maven.plugins.javadoc.JavadocUtil.isEmpty;
+import static org.apache.maven.plugins.javadoc.JavadocUtil.isNotEmpty;
 import static org.codehaus.plexus.util.IOUtil.close;
 
 /**

--
To stop receiving notification emails like this one, please contact
"[hidden email]" <[hidden email]>.