From 9eef0fa86c4bb6db589c9bcef6ff59afbab96230 Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Wed, 19 Feb 2020 07:21:34 +1000 Subject: [PATCH 1/4] [MJAVADOC-639] include requires static from external dependencies for all modules 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 beba167b..8917cdf5 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-SNAPSHOT 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 00000000..f6c12c23 --- /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 00000000..cbb8ba4b --- /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 00000000..e597b21c --- /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 00000000..6931f112 --- /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 00000000..4d25a4e3 --- /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 00000000..1f93e009 --- /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 00000000..3f935b86 --- /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 00000000..f68bc4f2 --- /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 00000000..2dbd5ca3 --- /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 00000000..a0534b29 --- /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 00000000..4da452c0 --- /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 00000000..db135dfa --- /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 00000000..20619076 --- /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 00000000..26447fc1 --- /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 00000000..04cf8c10 --- /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 00000000..59f800ae --- /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 00000000..4241e0dd --- /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 00000000..4d9f4d2d --- /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 00000000..bcf28904 --- /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 00000000..57c30d43 --- /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 00000000..3cb9637c --- /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 ee29c6a1..301dc961 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.setIncludeAdditionalModulesStatic( isAggregator() ); try { From 648a47159b3869cc117480cd455b40da4a5a99d9 Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Wed, 19 Feb 2020 11:03:07 +1000 Subject: [PATCH 2/4] [MJAVADOC-639] update plexus-java method name Signed-off-by: olivier lamy --- .../org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 301dc961..83c3bd06 100644 --- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java +++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java @@ -5149,7 +5149,7 @@ private void addJavadocOptions( File javadocOutputDirectory, } request.setAdditionalModules( additionalModules ); - request.setIncludeAdditionalModulesStatic( isAggregator() ); + request.setIncludeStatic( isAggregator() ); try { From d0f8193bed9889af400c3db5ac5cd22bd788d9b7 Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Wed, 19 Feb 2020 11:10:09 +1000 Subject: [PATCH 3/4] add plexus snapshots repository Signed-off-by: olivier lamy --- pom.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pom.xml b/pom.xml index 8917cdf5..483707fc 100644 --- a/pom.xml +++ b/pom.xml @@ -450,6 +450,19 @@ under the License. + + + plexus.snapshots + https://oss.sonatype.org/content/repositories/plexus-snapshots + + false + + + true + + + + run-its From 1905e9721b1f91874cde1af4c9db781dcc9de82f Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Wed, 19 Feb 2020 12:00:18 +1000 Subject: [PATCH 4/4] [MJAVADOC-639] plexus-java 1.0.5 Signed-off-by: olivier lamy --- pom.xml | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/pom.xml b/pom.xml index 483707fc..d2171ab4 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ under the License. 1.7.4 2.4 1.13.1 - 1.0.5-SNAPSHOT + 1.0.5 3.3 2.7 @@ -450,19 +450,6 @@ under the License. - - - plexus.snapshots - https://oss.sonatype.org/content/repositories/plexus-snapshots - - false - - - true - - - - run-its