From 405b16dc1de312d31f8a4f31c1cf8a07db3220eb Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 19 Feb 2020 12:17:06 +1000 Subject: [PATCH] [MJAVADOC-639] include requires static from external dependencies for all modules (#38) * [MJAVADOC-639] include requires static from external dependencies for all modules Signed-off-by: olivier lamy * [MJAVADOC-639] update plexus-java method name Signed-off-by: olivier lamy * add plexus snapshots repository Signed-off-by: olivier lamy * [MJAVADOC-639] plexus-java 1.0.5 Signed-off-by: olivier lamy --- pom.xml | 2 +- .../invoker.properties | 19 +++++++ .../modulea/pom.xml | 32 +++++++++++ .../javamodularity/modulea/HelloWorld.java | 37 ++++++++++++ .../modulea/src/main/java/module-info.java | 25 +++++++++ .../moduleb/pom.xml | 32 +++++++++++ .../javamodularity/moduleb/HelloWorld.java | 37 ++++++++++++ .../moduleb/src/main/java/module-info.java | 25 +++++++++ .../modulec/pom.xml | 46 +++++++++++++++ .../modulec/WorldCollector.java | 50 +++++++++++++++++ .../modulec/src/main/java/module-info.java | 28 ++++++++++ .../pom.xml | 36 ++++++++++++ .../invoker.properties | 19 +++++++ .../modulea/pom.xml | 32 +++++++++++ .../javamodularity/modulea/HelloWorld.java | 37 ++++++++++++ .../javamodularity/modulea/SimpleLogging.java | 48 ++++++++++++++++ .../modulea/src/main/java/module-info.java | 28 ++++++++++ .../moduleb/pom.xml | 25 +++++++++ .../javamodularity/moduleb/HelloWorld.java | 37 ++++++++++++ .../moduleb/src/main/java/module-info.java | 25 +++++++++ .../MJAVADOC-639_requires_ignored/pom.xml | 56 +++++++++++++++++++ .../verify.groovy | 55 ++++++++++++++++++ .../plugins/javadoc/AbstractJavadocMojo.java | 1 + 23 files changed, 731 insertions(+), 1 deletion(-) create mode 100644 src/it/projects/MJAVADOC-639_aggr_static_modulepath/invoker.properties create mode 100644 src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulea/pom.xml create mode 100644 src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulea/src/main/java/com/javamodularity/modulea/HelloWorld.java create mode 100644 src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulea/src/main/java/module-info.java create mode 100644 src/it/projects/MJAVADOC-639_aggr_static_modulepath/moduleb/pom.xml create mode 100644 src/it/projects/MJAVADOC-639_aggr_static_modulepath/moduleb/src/main/java/com/javamodularity/moduleb/HelloWorld.java create mode 100644 src/it/projects/MJAVADOC-639_aggr_static_modulepath/moduleb/src/main/java/module-info.java create mode 100644 src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulec/pom.xml create mode 100644 src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulec/src/main/java/com/javamodularity/modulec/WorldCollector.java create mode 100644 src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulec/src/main/java/module-info.java create mode 100644 src/it/projects/MJAVADOC-639_aggr_static_modulepath/pom.xml create mode 100644 src/it/projects/MJAVADOC-639_requires_ignored/invoker.properties create mode 100644 src/it/projects/MJAVADOC-639_requires_ignored/modulea/pom.xml create mode 100644 src/it/projects/MJAVADOC-639_requires_ignored/modulea/src/main/java/com/javamodularity/modulea/HelloWorld.java create mode 100644 src/it/projects/MJAVADOC-639_requires_ignored/modulea/src/main/java/com/javamodularity/modulea/SimpleLogging.java create mode 100644 src/it/projects/MJAVADOC-639_requires_ignored/modulea/src/main/java/module-info.java create mode 100644 src/it/projects/MJAVADOC-639_requires_ignored/moduleb/pom.xml create mode 100644 src/it/projects/MJAVADOC-639_requires_ignored/moduleb/src/main/java/com/javamodularity/moduleb/HelloWorld.java create mode 100644 src/it/projects/MJAVADOC-639_requires_ignored/moduleb/src/main/java/module-info.java create mode 100644 src/it/projects/MJAVADOC-639_requires_ignored/pom.xml create mode 100644 src/it/projects/MJAVADOC-639_requires_ignored/verify.groovy diff --git a/pom.xml b/pom.xml index 1c104184e..c4c088621 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ under the License. 1.7.4 2.4 1.13.1 - 1.0.4 + 1.0.5 3.3 2.7 diff --git a/src/it/projects/MJAVADOC-639_aggr_static_modulepath/invoker.properties b/src/it/projects/MJAVADOC-639_aggr_static_modulepath/invoker.properties new file mode 100644 index 000000000..f6c12c23f --- /dev/null +++ b/src/it/projects/MJAVADOC-639_aggr_static_modulepath/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.java.version = 9+ +invoker.goals=javadoc:aggregate + diff --git a/src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulea/pom.xml b/src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulea/pom.xml new file mode 100644 index 000000000..cbb8ba4b7 --- /dev/null +++ b/src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulea/pom.xml @@ -0,0 +1,32 @@ + + + + 4.0.0 + modulea + modulea + 1.0.0-SNAPSHOT + + + + + maven-compiler-plugin + 3.8.0 + + 9 + + + + + diff --git a/src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulea/src/main/java/com/javamodularity/modulea/HelloWorld.java b/src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulea/src/main/java/com/javamodularity/modulea/HelloWorld.java new file mode 100644 index 000000000..e597b21c4 --- /dev/null +++ b/src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulea/src/main/java/com/javamodularity/modulea/HelloWorld.java @@ -0,0 +1,37 @@ +package com.javamodularity.modulea; + +/* + * 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. + */ + +/** + *

Javadoc aggregation from module a.

+ */ +public class HelloWorld { + + /** + *

method f does something

+ */ + public void f() { + } + + public static void main(String... args) { + System.out.println("Hello Modular World!"); + } + +} diff --git a/src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulea/src/main/java/module-info.java b/src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulea/src/main/java/module-info.java new file mode 100644 index 000000000..6931f112a --- /dev/null +++ b/src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulea/src/main/java/module-info.java @@ -0,0 +1,25 @@ +/* + * 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. + */ + +/** + *

modulea does something

+ */ +module modulea { + exports com.javamodularity.modulea; +} diff --git a/src/it/projects/MJAVADOC-639_aggr_static_modulepath/moduleb/pom.xml b/src/it/projects/MJAVADOC-639_aggr_static_modulepath/moduleb/pom.xml new file mode 100644 index 000000000..4d25a4e32 --- /dev/null +++ b/src/it/projects/MJAVADOC-639_aggr_static_modulepath/moduleb/pom.xml @@ -0,0 +1,32 @@ + + + + 4.0.0 + moduleb + moduleb + 1.0.0-SNAPSHOT + + + + + maven-compiler-plugin + 3.8.0 + + 9 + + + + + diff --git a/src/it/projects/MJAVADOC-639_aggr_static_modulepath/moduleb/src/main/java/com/javamodularity/moduleb/HelloWorld.java b/src/it/projects/MJAVADOC-639_aggr_static_modulepath/moduleb/src/main/java/com/javamodularity/moduleb/HelloWorld.java new file mode 100644 index 000000000..1f93e0092 --- /dev/null +++ b/src/it/projects/MJAVADOC-639_aggr_static_modulepath/moduleb/src/main/java/com/javamodularity/moduleb/HelloWorld.java @@ -0,0 +1,37 @@ +package com.javamodularity.moduleb; + +/* + * 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. + */ + +/** + *

Javadoc aggregation from module a.

+ */ +public class HelloWorld { + + /** + *

method f does something

+ */ + public void f() { + } + + public static void main(String... args) { + System.out.println("Hello Modular World!"); + } + +} diff --git a/src/it/projects/MJAVADOC-639_aggr_static_modulepath/moduleb/src/main/java/module-info.java b/src/it/projects/MJAVADOC-639_aggr_static_modulepath/moduleb/src/main/java/module-info.java new file mode 100644 index 000000000..3f935b864 --- /dev/null +++ b/src/it/projects/MJAVADOC-639_aggr_static_modulepath/moduleb/src/main/java/module-info.java @@ -0,0 +1,25 @@ +/* + * 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. + */ + +/** + *

moduleb does something

+ */ +module moduleb { + exports com.javamodularity.moduleb; +} diff --git a/src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulec/pom.xml b/src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulec/pom.xml new file mode 100644 index 000000000..f68bc4f2f --- /dev/null +++ b/src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulec/pom.xml @@ -0,0 +1,46 @@ + + + + 4.0.0 + modulec + modulec + 1.0.0-SNAPSHOT + + + + + maven-compiler-plugin + 3.8.0 + + 9 + + + + + + + + modulea + modulea + 1.0.0-SNAPSHOT + + + moduleb + moduleb + 1.0.0-SNAPSHOT + true + + + diff --git a/src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulec/src/main/java/com/javamodularity/modulec/WorldCollector.java b/src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulec/src/main/java/com/javamodularity/modulec/WorldCollector.java new file mode 100644 index 000000000..2dbd5ca31 --- /dev/null +++ b/src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulec/src/main/java/com/javamodularity/modulec/WorldCollector.java @@ -0,0 +1,50 @@ +package com.javamodularity.modulec; + +/* + * 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. + */ + +/** + * WorldCollector + */ +public class WorldCollector { + + public void collect() + { + getA().main(); + + try + { + getB().main(); + } + catch ( Exception e ) + { + // noop + } + } + + public com.javamodularity.modulea.HelloWorld getA() + { + return new com.javamodularity.modulea.HelloWorld(); + } + + public com.javamodularity.moduleb.HelloWorld getB() + { + return new com.javamodularity.moduleb.HelloWorld(); + } +} diff --git a/src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulec/src/main/java/module-info.java b/src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulec/src/main/java/module-info.java new file mode 100644 index 000000000..a0534b294 --- /dev/null +++ b/src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulec/src/main/java/module-info.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + +/** + *

modulec does something

+ */ +module modulec { + requires modulea; + requires static moduleb; + + exports com.javamodularity.modulec; +} diff --git a/src/it/projects/MJAVADOC-639_aggr_static_modulepath/pom.xml b/src/it/projects/MJAVADOC-639_aggr_static_modulepath/pom.xml new file mode 100644 index 000000000..4da452c02 --- /dev/null +++ b/src/it/projects/MJAVADOC-639_aggr_static_modulepath/pom.xml @@ -0,0 +1,36 @@ + + + + + 4.0.0 + parent + parent + 1.0.0-SNAPSHOT + pom + + modulea + moduleb + modulec + + + + + org.apache.maven.plugins + maven-javadoc-plugin + @project.version@ + + + + diff --git a/src/it/projects/MJAVADOC-639_requires_ignored/invoker.properties b/src/it/projects/MJAVADOC-639_requires_ignored/invoker.properties new file mode 100644 index 000000000..db135dfa1 --- /dev/null +++ b/src/it/projects/MJAVADOC-639_requires_ignored/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.java.version = 9+ +invoker.goals=package source:jar javadoc:jar javadoc:aggregate-jar + diff --git a/src/it/projects/MJAVADOC-639_requires_ignored/modulea/pom.xml b/src/it/projects/MJAVADOC-639_requires_ignored/modulea/pom.xml new file mode 100644 index 000000000..206190762 --- /dev/null +++ b/src/it/projects/MJAVADOC-639_requires_ignored/modulea/pom.xml @@ -0,0 +1,32 @@ + + + + 4.0.0 + + org.apache.maven.plugins.javadoc.its + MJAVADOC-639 + 1.0.0-SNAPSHOT + + modulea + modulea + + + org.slf4j + slf4j-api + provided + true + + + diff --git a/src/it/projects/MJAVADOC-639_requires_ignored/modulea/src/main/java/com/javamodularity/modulea/HelloWorld.java b/src/it/projects/MJAVADOC-639_requires_ignored/modulea/src/main/java/com/javamodularity/modulea/HelloWorld.java new file mode 100644 index 000000000..26447fc17 --- /dev/null +++ b/src/it/projects/MJAVADOC-639_requires_ignored/modulea/src/main/java/com/javamodularity/modulea/HelloWorld.java @@ -0,0 +1,37 @@ +package com.javamodularity.modulea; + +/* + * 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. + */ + +/** + *

Javadoc aggregation from module a.

+ */ +public class HelloWorld { + + /** + *

method f does something

+ */ + public void f() { + } + + public static void main(String... args) { + System.out.println("Hello Modular World!"); + } + +} diff --git a/src/it/projects/MJAVADOC-639_requires_ignored/modulea/src/main/java/com/javamodularity/modulea/SimpleLogging.java b/src/it/projects/MJAVADOC-639_requires_ignored/modulea/src/main/java/com/javamodularity/modulea/SimpleLogging.java new file mode 100644 index 000000000..04cf8c109 --- /dev/null +++ b/src/it/projects/MJAVADOC-639_requires_ignored/modulea/src/main/java/com/javamodularity/modulea/SimpleLogging.java @@ -0,0 +1,48 @@ +package com.javamodularity.modulea; + +/* + * 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. + */ + +/** + *

Javadoc aggregation from module a.

+ */ +public class SimpleLogging +{ + + private final org.slf4j.Logger _logger; + + public SimpleLogging( ) + { + org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger("SimpleLogging"); + _logger = logger; + } + + /** + *

method f does something

+ */ + public void f() + { + } + + public static void main( String... args ) + { + System.out.println( "Hello Modular World!" ); + } + +} diff --git a/src/it/projects/MJAVADOC-639_requires_ignored/modulea/src/main/java/module-info.java b/src/it/projects/MJAVADOC-639_requires_ignored/modulea/src/main/java/module-info.java new file mode 100644 index 000000000..59f800aea --- /dev/null +++ b/src/it/projects/MJAVADOC-639_requires_ignored/modulea/src/main/java/module-info.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + +/** + *

modulea does something

+ */ +module modulea { + exports com.javamodularity.modulea; + + // Only required if using Slf4jLog. + requires static org.slf4j; +} diff --git a/src/it/projects/MJAVADOC-639_requires_ignored/moduleb/pom.xml b/src/it/projects/MJAVADOC-639_requires_ignored/moduleb/pom.xml new file mode 100644 index 000000000..4241e0dd6 --- /dev/null +++ b/src/it/projects/MJAVADOC-639_requires_ignored/moduleb/pom.xml @@ -0,0 +1,25 @@ + + + + 4.0.0 + + org.apache.maven.plugins.javadoc.its + MJAVADOC-639 + 1.0.0-SNAPSHOT + + moduleb + moduleb + + diff --git a/src/it/projects/MJAVADOC-639_requires_ignored/moduleb/src/main/java/com/javamodularity/moduleb/HelloWorld.java b/src/it/projects/MJAVADOC-639_requires_ignored/moduleb/src/main/java/com/javamodularity/moduleb/HelloWorld.java new file mode 100644 index 000000000..4d9f4d2d1 --- /dev/null +++ b/src/it/projects/MJAVADOC-639_requires_ignored/moduleb/src/main/java/com/javamodularity/moduleb/HelloWorld.java @@ -0,0 +1,37 @@ +package com.javamodularity.moduleb; + +/* + * 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. + */ + +/** + *

Javadoc aggregation from module a.

+ */ +public class HelloWorld { + + /** + *

method f does something

+ */ + public void f() { + } + + public static void main(String... args) { + System.out.println("Hello Modular World!"); + } + +} diff --git a/src/it/projects/MJAVADOC-639_requires_ignored/moduleb/src/main/java/module-info.java b/src/it/projects/MJAVADOC-639_requires_ignored/moduleb/src/main/java/module-info.java new file mode 100644 index 000000000..bcf28904c --- /dev/null +++ b/src/it/projects/MJAVADOC-639_requires_ignored/moduleb/src/main/java/module-info.java @@ -0,0 +1,25 @@ +/* + * 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. + */ + +/** + *

moduleb does something

+ */ +module moduleb { + exports com.javamodularity.moduleb; +} diff --git a/src/it/projects/MJAVADOC-639_requires_ignored/pom.xml b/src/it/projects/MJAVADOC-639_requires_ignored/pom.xml new file mode 100644 index 000000000..57c30d432 --- /dev/null +++ b/src/it/projects/MJAVADOC-639_requires_ignored/pom.xml @@ -0,0 +1,56 @@ + + + + + 4.0.0 + org.apache.maven.plugins.javadoc.its + MJAVADOC-639 + 1.0.0-SNAPSHOT + pom + + 1.8.0-beta4 + + + modulea + moduleb + + + + + org.slf4j + slf4j-api + ${slf4j.version} + + + + + + + + maven-compiler-plugin + 3.8.1 + + 9 + + + + org.apache.maven.plugins + maven-javadoc-plugin + @project.version@ + + + + + diff --git a/src/it/projects/MJAVADOC-639_requires_ignored/verify.groovy b/src/it/projects/MJAVADOC-639_requires_ignored/verify.groovy new file mode 100644 index 000000000..3cb9637cf --- /dev/null +++ b/src/it/projects/MJAVADOC-639_requires_ignored/verify.groovy @@ -0,0 +1,55 @@ +import java.util.jar.JarEntry +import java.util.jar.JarFile + +/* + * 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. + */ + +int javaVersion = System.getProperty( "java.specification.version" ) as Integer +if ( javaVersion >= 11 ) { + def index = new File( basedir, 'target/apidocs/index.html') + + assert index.text =~ /modulea<\/a>/ + assert index.text =~ /moduleb<\/a>/ + + assert new File( basedir, 'target/apidocs/modulea/module-summary.html').exists() + assert new File( basedir, 'target/apidocs/moduleb/module-summary.html').exists() +} +else { + def overview = new File( basedir, 'target/site/apidocs/overview-summary.html') + + assert overview.text =~ /modulea<\/a>/ + assert overview.text =~ /moduleb<\/a>/ + + assert new File( basedir, 'target/site/apidocs/modulea-summary.html').exists() + assert new File( basedir, 'target/site/apidocs/moduleb-summary.html').exists() +} + +def aggregate = new File(basedir, 'target/MJAVADOC-639-1.0.0-SNAPSHOT-javadoc.jar') +assert aggregate.exists() + +def jar = new JarFile( aggregate ) +def files = new ArrayList() + +for ( JarEntry file in jar.entries() ) { + files.add(file.getName()) +} + +assert files.contains("modulea/com/javamodularity/modulea/SimpleLogging.html") +assert files.contains("modulea/com/javamodularity/modulea/HelloWorld.html") +assert files.contains("moduleb/com/javamodularity/moduleb/HelloWorld.html") 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 ee29c6a1a..83c3bd06f 100644 --- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java +++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java @@ -5149,6 +5149,7 @@ private void addJavadocOptions( File javadocOutputDirectory, } request.setAdditionalModules( additionalModules ); + request.setIncludeStatic( isAggregator() ); try {