From d772fce836c44fb64bd67b103cb839c2de213bb4 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 12 Mar 2020 07:09:23 +1000 Subject: [PATCH] MJAVADOC-610 Add IT test for multirelease jar * [MJAVADOC-610] Support multirelease jar * add more tests Signed-off-by: olivier lamy * disable MJAVADOC-610_mrjar it for java 11 as it fail for oracle jdk because do not have fix which is in adoptopenjdk Signed-off-by: olivier lamy Co-authored-by: rfscholte --- .../MJAVADOC-610_mrjar/invoker.properties | 21 +++++ src/it/projects/MJAVADOC-610_mrjar/pom.xml | 93 +++++++++++++++++++ .../src/main/java/com/foo/MyClass.java | 30 ++++++ .../src/main/java9/com/foo/MyClass.java | 39 ++++++++ .../src/main/java9/com/foo/OtherClass.java | 25 +++++ .../src/main/java9/module-info.java | 22 +++++ .../projects/MJAVADOC-610_mrjar/verify.groovy | 24 +++++ 7 files changed, 254 insertions(+) create mode 100644 src/it/projects/MJAVADOC-610_mrjar/invoker.properties create mode 100644 src/it/projects/MJAVADOC-610_mrjar/pom.xml create mode 100644 src/it/projects/MJAVADOC-610_mrjar/src/main/java/com/foo/MyClass.java create mode 100644 src/it/projects/MJAVADOC-610_mrjar/src/main/java9/com/foo/MyClass.java create mode 100644 src/it/projects/MJAVADOC-610_mrjar/src/main/java9/com/foo/OtherClass.java create mode 100644 src/it/projects/MJAVADOC-610_mrjar/src/main/java9/module-info.java create mode 100644 src/it/projects/MJAVADOC-610_mrjar/verify.groovy diff --git a/src/it/projects/MJAVADOC-610_mrjar/invoker.properties b/src/it/projects/MJAVADOC-610_mrjar/invoker.properties new file mode 100644 index 000000000..354c26000 --- /dev/null +++ b/src/it/projects/MJAVADOC-610_mrjar/invoker.properties @@ -0,0 +1,21 @@ +# 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 = package +# disable again for java 11 as again it's a bug fixed in openjdk but reported in oracle jdk +# and it seems to be the java vendor we use as a source of trust in ASF build machines and the rest of the team... +invoker.java.version = 1.9+,!11 diff --git a/src/it/projects/MJAVADOC-610_mrjar/pom.xml b/src/it/projects/MJAVADOC-610_mrjar/pom.xml new file mode 100644 index 000000000..70adfa32b --- /dev/null +++ b/src/it/projects/MJAVADOC-610_mrjar/pom.xml @@ -0,0 +1,93 @@ + + + + + 4.0.0 + + org.apache.maven.plugins.javadoc.it + mjavadoc610 + 1.0-SNAPSHOT + + https://issues.apache.org/jira/browse/MJAVADOC-610 + + + UTF-8 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + jdk9 + + compile + + + 9 + true + + ${project.basedir}/src/main/java9 + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + default-jar + + + + true + + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + @project.version@ + + + jar + + jar + + + + + src/main/java9;src/main/java + + + + + + diff --git a/src/it/projects/MJAVADOC-610_mrjar/src/main/java/com/foo/MyClass.java b/src/it/projects/MJAVADOC-610_mrjar/src/main/java/com/foo/MyClass.java new file mode 100644 index 000000000..a698ec9c1 --- /dev/null +++ b/src/it/projects/MJAVADOC-610_mrjar/src/main/java/com/foo/MyClass.java @@ -0,0 +1,30 @@ +package com.foo; + +/* + * 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. + */ + +public class MyClass +{ + /** + * foo method + */ + public void foo(){ + + } +} diff --git a/src/it/projects/MJAVADOC-610_mrjar/src/main/java9/com/foo/MyClass.java b/src/it/projects/MJAVADOC-610_mrjar/src/main/java9/com/foo/MyClass.java new file mode 100644 index 000000000..585958507 --- /dev/null +++ b/src/it/projects/MJAVADOC-610_mrjar/src/main/java9/com/foo/MyClass.java @@ -0,0 +1,39 @@ +package com.foo; + +/* + * 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. + */ + +public class MyClass +{ + + /** + * bar method + */ + public void foo(){ + + } + + /** + * bar method + */ + public void bar(){ + + } + +} diff --git a/src/it/projects/MJAVADOC-610_mrjar/src/main/java9/com/foo/OtherClass.java b/src/it/projects/MJAVADOC-610_mrjar/src/main/java9/com/foo/OtherClass.java new file mode 100644 index 000000000..2b07d89f7 --- /dev/null +++ b/src/it/projects/MJAVADOC-610_mrjar/src/main/java9/com/foo/OtherClass.java @@ -0,0 +1,25 @@ +package com.foo; + +/* + * 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. + */ + +public class OtherClass +{ + +} diff --git a/src/it/projects/MJAVADOC-610_mrjar/src/main/java9/module-info.java b/src/it/projects/MJAVADOC-610_mrjar/src/main/java9/module-info.java new file mode 100644 index 000000000..78ba6a68f --- /dev/null +++ b/src/it/projects/MJAVADOC-610_mrjar/src/main/java9/module-info.java @@ -0,0 +1,22 @@ +/* + * 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. + */ +module com.foo +{ + exports com.foo; +} \ No newline at end of file diff --git a/src/it/projects/MJAVADOC-610_mrjar/verify.groovy b/src/it/projects/MJAVADOC-610_mrjar/verify.groovy new file mode 100644 index 000000000..bbed8f9ec --- /dev/null +++ b/src/it/projects/MJAVADOC-610_mrjar/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/mjavadoc610-1.0-SNAPSHOT-javadoc.jar' ) +assert file.exists() + +assert new File( basedir, 'target/apidocs/com.foo/com/foo/MyClass.html').exists() +assert new File( basedir, 'target/apidocs/com.foo/com/foo/OtherClass.html').exists()