From aed49ae808b7e9e618f68dc3aebc3b161ad7671d Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 27 Jul 2022 10:43:01 +1000 Subject: [PATCH] add it for issue #183 but using javac compiler, use properties for versions in its Signed-off-by: Olivier Lamy --- .../src/main/it/MCOMPILER-346-mre/pom.xml | 5 ++- .../src/main/it/aspectj-compiler/pom.xml | 7 +-- .../it/eclipse-compiler-mapstruct/pom.xml | 8 ++-- .../src/main/it/error-prone-compiler/pom.xml | 3 +- .../it/missing-warnings/invoker.properties | 20 +++++++++ .../src/main/it/missing-warnings/pom.xml | 45 +++++++++++++++++++ .../src/main/java/com/company/SomeClass.java | 5 +++ .../src/main/java/module-info.java | 3 ++ .../main/it/missing-warnings/verify.groovy | 24 ++++++++++ .../it/simple-eclipse-compiler-fail/pom.xml | 5 ++- .../main/it/simple-eclipse-compiler/pom.xml | 5 ++- .../src/main/it/simple-javac-fork/pom.xml | 7 +-- .../src/main/it/simple-javac/pom.xml | 9 ++-- pom.xml | 2 + 14 files changed, 127 insertions(+), 21 deletions(-) create mode 100644 plexus-compiler-its/src/main/it/missing-warnings/invoker.properties create mode 100644 plexus-compiler-its/src/main/it/missing-warnings/pom.xml create mode 100644 plexus-compiler-its/src/main/it/missing-warnings/src/main/java/com/company/SomeClass.java create mode 100644 plexus-compiler-its/src/main/it/missing-warnings/src/main/java/module-info.java create mode 100644 plexus-compiler-its/src/main/it/missing-warnings/verify.groovy diff --git a/plexus-compiler-its/src/main/it/MCOMPILER-346-mre/pom.xml b/plexus-compiler-its/src/main/it/MCOMPILER-346-mre/pom.xml index 5fcea033..c8a739f3 100644 --- a/plexus-compiler-its/src/main/it/MCOMPILER-346-mre/pom.xml +++ b/plexus-compiler-its/src/main/it/MCOMPILER-346-mre/pom.xml @@ -29,6 +29,7 @@ https://github.com/basil/MCOMPILER-346-mre UTF-8 + @pom.version@ @@ -61,12 +62,12 @@ org.codehaus.plexus plexus-compiler-api - @pom.version@ + ${plexus.compiler.version} org.codehaus.plexus plexus-compiler-javac - @pom.version@ + ${plexus.compiler.version} diff --git a/plexus-compiler-its/src/main/it/aspectj-compiler/pom.xml b/plexus-compiler-its/src/main/it/aspectj-compiler/pom.xml index 8c7ab602..4638fbcb 100644 --- a/plexus-compiler-its/src/main/it/aspectj-compiler/pom.xml +++ b/plexus-compiler-its/src/main/it/aspectj-compiler/pom.xml @@ -31,13 +31,14 @@ UTF-8 1.8 1.8 + @pom.version@ maven-compiler-plugin - 3.8.1 + @maven.compiler.version@ aspectj @@ -45,12 +46,12 @@ org.codehaus.plexus plexus-compiler-api - @pom.version@ + ${plexus.compiler.version} org.codehaus.plexus plexus-compiler-aspectj - @pom.version@ + ${plexus.compiler.version} diff --git a/plexus-compiler-its/src/main/it/eclipse-compiler-mapstruct/pom.xml b/plexus-compiler-its/src/main/it/eclipse-compiler-mapstruct/pom.xml index c72ca81e..39d0796b 100644 --- a/plexus-compiler-its/src/main/it/eclipse-compiler-mapstruct/pom.xml +++ b/plexus-compiler-its/src/main/it/eclipse-compiler-mapstruct/pom.xml @@ -34,7 +34,7 @@ UTF-8 1.8 1.8 - + @pom.version@ 1.5.2.Final @@ -51,7 +51,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.10.1 + @maven.compiler.version@ eclipse @@ -59,12 +59,12 @@ org.codehaus.plexus plexus-compiler-api - @pom.version@ + ${plexus.compiler.version} org.codehaus.plexus plexus-compiler-eclipse - @pom.version@ + ${plexus.compiler.version} org.mapstruct diff --git a/plexus-compiler-its/src/main/it/error-prone-compiler/pom.xml b/plexus-compiler-its/src/main/it/error-prone-compiler/pom.xml index 2722f0a9..47466656 100644 --- a/plexus-compiler-its/src/main/it/error-prone-compiler/pom.xml +++ b/plexus-compiler-its/src/main/it/error-prone-compiler/pom.xml @@ -32,6 +32,7 @@ UTF-8 9+181-r4173-1 + @pom.version@ @@ -48,7 +49,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + @maven.compiler.version@ 8 8 diff --git a/plexus-compiler-its/src/main/it/missing-warnings/invoker.properties b/plexus-compiler-its/src/main/it/missing-warnings/invoker.properties new file mode 100644 index 00000000..7265e231 --- /dev/null +++ b/plexus-compiler-its/src/main/it/missing-warnings/invoker.properties @@ -0,0 +1,20 @@ +# 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 = 11+ +invoker.goals = clean compile +#invoker.buildResult = failure diff --git a/plexus-compiler-its/src/main/it/missing-warnings/pom.xml b/plexus-compiler-its/src/main/it/missing-warnings/pom.xml new file mode 100644 index 00000000..42af0b33 --- /dev/null +++ b/plexus-compiler-its/src/main/it/missing-warnings/pom.xml @@ -0,0 +1,45 @@ + + + 4.0.0 + + org.apache.maven.plugins.compiler.it + missing-warnings + 1.0-SNAPSHOT + + + + + + org.apache.maven.plugins + maven-compiler-plugin + @maven.compiler.version@ + + true + true + + + + org.codehaus.plexus + plexus-compiler-api + ${plexus.compiler.version} + + + org.codehaus.plexus + plexus-compiler-javac + ${plexus.compiler.version} + + + + + + + + + 11 + 11 + UTF-8 + @pom.version@ + + \ No newline at end of file diff --git a/plexus-compiler-its/src/main/it/missing-warnings/src/main/java/com/company/SomeClass.java b/plexus-compiler-its/src/main/it/missing-warnings/src/main/java/com/company/SomeClass.java new file mode 100644 index 00000000..c0c65494 --- /dev/null +++ b/plexus-compiler-its/src/main/it/missing-warnings/src/main/java/com/company/SomeClass.java @@ -0,0 +1,5 @@ +package com.company; + +public class SomeClass +{ +} diff --git a/plexus-compiler-its/src/main/it/missing-warnings/src/main/java/module-info.java b/plexus-compiler-its/src/main/it/missing-warnings/src/main/java/module-info.java new file mode 100644 index 00000000..0b7ef296 --- /dev/null +++ b/plexus-compiler-its/src/main/it/missing-warnings/src/main/java/module-info.java @@ -0,0 +1,3 @@ +module testcase { + exports com.company to someOtherModule; +} \ No newline at end of file diff --git a/plexus-compiler-its/src/main/it/missing-warnings/verify.groovy b/plexus-compiler-its/src/main/it/missing-warnings/verify.groovy new file mode 100644 index 00000000..6e9df7a4 --- /dev/null +++ b/plexus-compiler-its/src/main/it/missing-warnings/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 logFile = new File( basedir, 'build.log' ) +assert logFile.exists() +content = logFile.text.normalize() + +assert content.contains( "module-info.java:[2,24] [module] module not found: someOtherModule") +//assert content.contains( "exports com.company to someOtherModule;" ) diff --git a/plexus-compiler-its/src/main/it/simple-eclipse-compiler-fail/pom.xml b/plexus-compiler-its/src/main/it/simple-eclipse-compiler-fail/pom.xml index 5beaa3d0..03a77f48 100644 --- a/plexus-compiler-its/src/main/it/simple-eclipse-compiler-fail/pom.xml +++ b/plexus-compiler-its/src/main/it/simple-eclipse-compiler-fail/pom.xml @@ -34,6 +34,7 @@ UTF-8 1.8 1.8 + @pom.version@ @@ -58,12 +59,12 @@ org.codehaus.plexus plexus-compiler-api - @pom.version@ + ${plexus.compiler.version} org.codehaus.plexus plexus-compiler-eclipse - @pom.version@ + ${plexus.compiler.version} diff --git a/plexus-compiler-its/src/main/it/simple-eclipse-compiler/pom.xml b/plexus-compiler-its/src/main/it/simple-eclipse-compiler/pom.xml index a4efe0c0..54694e38 100644 --- a/plexus-compiler-its/src/main/it/simple-eclipse-compiler/pom.xml +++ b/plexus-compiler-its/src/main/it/simple-eclipse-compiler/pom.xml @@ -34,6 +34,7 @@ UTF-8 1.8 1.8 + @pom.version@ @@ -58,12 +59,12 @@ org.codehaus.plexus plexus-compiler-api - @pom.version@ + ${plexus.compiler.version} org.codehaus.plexus plexus-compiler-eclipse - @pom.version@ + ${plexus.compiler.version} diff --git a/plexus-compiler-its/src/main/it/simple-javac-fork/pom.xml b/plexus-compiler-its/src/main/it/simple-javac-fork/pom.xml index 054f42a6..d72b91ab 100644 --- a/plexus-compiler-its/src/main/it/simple-javac-fork/pom.xml +++ b/plexus-compiler-its/src/main/it/simple-javac-fork/pom.xml @@ -34,6 +34,7 @@ UTF-8 11 11 + @pom.version@ @@ -50,7 +51,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + @maven.compiler.version@ true @@ -61,12 +62,12 @@ org.codehaus.plexus plexus-compiler-api - @pom.version@ + ${plexus.compiler.version} org.codehaus.plexus plexus-compiler-javac - @pom.version@ + ${plexus.compiler.version} diff --git a/plexus-compiler-its/src/main/it/simple-javac/pom.xml b/plexus-compiler-its/src/main/it/simple-javac/pom.xml index 5c5efffc..a400f268 100644 --- a/plexus-compiler-its/src/main/it/simple-javac/pom.xml +++ b/plexus-compiler-its/src/main/it/simple-javac/pom.xml @@ -34,6 +34,7 @@ UTF-8 1.8 1.8 + @pom.version@ @@ -50,22 +51,22 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + @maven.compiler.version@ -Xlint:-path - + org.codehaus.plexus plexus-compiler-api - @pom.version@ + ${plexus.compiler.version} org.codehaus.plexus plexus-compiler-javac - @pom.version@ + ${plexus.compiler.version} diff --git a/pom.xml b/pom.xml index f61a59cd..e167a988 100644 --- a/pom.xml +++ b/pom.xml @@ -54,6 +54,7 @@ 2.14.0 false clean install + 3.10.1 @@ -129,6 +130,7 @@ org.apache.maven.plugins maven-compiler-plugin + ${maven.compiler.version} 8