From f27c99dcf35a27ab06b00ad1e2b30336de39fdf8 Mon Sep 17 00:00:00 2001 From: rfscholte Date: Fri, 7 May 2021 22:46:52 +0200 Subject: [PATCH] [MJAVADOC-590] Setting nooverview option always causes a build failure --- .../invoker.properties | 18 +++++++++ .../projects/MJAVADOC-590_nooverview/pom.xml | 37 +++++++++++++++++++ .../main/java/com/example/MJavaDoc590.java | 30 +++++++++++++++ .../MJAVADOC-590_nooverview/verify.groovy | 24 ++++++++++++ .../plugins/javadoc/AbstractJavadocMojo.java | 2 +- 5 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 src/it/projects/MJAVADOC-590_nooverview/invoker.properties create mode 100644 src/it/projects/MJAVADOC-590_nooverview/pom.xml create mode 100644 src/it/projects/MJAVADOC-590_nooverview/src/main/java/com/example/MJavaDoc590.java create mode 100644 src/it/projects/MJAVADOC-590_nooverview/verify.groovy 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 000000000..b60ab5b48 --- /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 000000000..caab701bf --- /dev/null +++ b/src/it/projects/MJAVADOC-590_nooverview/pom.xml @@ -0,0 +1,37 @@ + + + + + + 4.0.0 + org.apache.maven.plugins.javadoc.it + mjavadoc-590 + 1.0.0-SNAPSHOT + + https://issues.apache.org/jira/browse/MJAVADOC-590 + + + + + org.apache.maven.plugins + maven-javadoc-plugin + @project.version@ + + true + + + + + + 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 000000000..239080571 --- /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 000000000..cd10da3c1 --- /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 0dbd61a4c..2d4318210 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 @@ private void validateStandardDocletOptions() } // overview - if ( ( getOverview() != null ) && nooverview ) + if ( getOverview() != null && getOverview().exists() && nooverview ) { throw new MavenReportException( "Option conflicts with " ); }