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 2021/05/08 15:53:54 UTC

[maven-javadoc-plugin] branch master updated: [MJAVADOC-590] Setting nooverview option always causes a build failure

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


The following commit(s) were added to refs/heads/master by this push:
     new f27c99d  [MJAVADOC-590] Setting nooverview option always causes a build failure
f27c99d is described below

commit f27c99dcf35a27ab06b00ad1e2b30336de39fdf8
Author: rfscholte <rf...@apache.org>
AuthorDate: Fri May 7 22:46:52 2021 +0200

    [MJAVADOC-590] Setting nooverview option always causes a build failure
---
 .../MJAVADOC-590_nooverview/invoker.properties     | 18 +++++++++++
 src/it/projects/MJAVADOC-590_nooverview/pom.xml    | 37 ++++++++++++++++++++++
 .../src/main/java/com/example/MJavaDoc590.java     | 30 ++++++++++++++++++
 .../projects/MJAVADOC-590_nooverview/verify.groovy | 24 ++++++++++++++
 .../maven/plugins/javadoc/AbstractJavadocMojo.java |  2 +-
 5 files changed, 110 insertions(+), 1 deletion(-)

diff --git a/src/it/projects/MJAVADOC-590_nooverview/invoker.properties b/src/it/projects/MJAVADOC-590_nooverview/invoker.properties
new file mode 100644
index 0000000..b60ab5b
--- /dev/null
+++ b/src/it/projects/MJAVADOC-590_nooverview/invoker.properties
@@ -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=compile javadoc:javadoc
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-590_nooverview/pom.xml b/src/it/projects/MJAVADOC-590_nooverview/pom.xml
new file mode 100644
index 0000000..caab701
--- /dev/null
+++ b/src/it/projects/MJAVADOC-590_nooverview/pom.xml
@@ -0,0 +1,37 @@
+<?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-590</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+
+  <url>https://issues.apache.org/jira/browse/MJAVADOC-590</url>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <version>@project.version@</version>
+        <configuration>
+          <nooverview>true</nooverview>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
diff --git a/src/it/projects/MJAVADOC-590_nooverview/src/main/java/com/example/MJavaDoc590.java b/src/it/projects/MJAVADOC-590_nooverview/src/main/java/com/example/MJavaDoc590.java
new file mode 100644
index 0000000..2390805
--- /dev/null
+++ b/src/it/projects/MJAVADOC-590_nooverview/src/main/java/com/example/MJavaDoc590.java
@@ -0,0 +1,30 @@
+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.
+ */
+
+/**
+ * Verify nooverview value
+ * 
+ * @since 3.3.0
+ */
+public class MJavaDoc590
+{
+
+}
diff --git a/src/it/projects/MJAVADOC-590_nooverview/verify.groovy b/src/it/projects/MJAVADOC-590_nooverview/verify.groovy
new file mode 100644
index 0000000..cd10da3
--- /dev/null
+++ b/src/it/projects/MJAVADOC-590_nooverview/verify.groovy
@@ -0,0 +1,24 @@
+/*
+ * 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/site/apidocs/com/example/MJavaDoc590.html' );
+assert file.exists()
+
+def overview = new File( basedir, 'target/site/apidocs/overview.html' );
+assert !overview.exists()
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 0dbd61a..2d43182 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
@@ -5030,7 +5030,7 @@ public abstract class AbstractJavadocMojo
         }
 
         // overview
-        if ( ( getOverview() != null ) && nooverview )
+        if ( getOverview() != null && getOverview().exists() && nooverview )
         {
             throw new MavenReportException( "Option <nooverview/> conflicts with <overview/>" );
         }