Skip to content

Commit

Permalink
add it for issue #183 but using javac compiler, use properties for ve…
Browse files Browse the repository at this point in the history
…rsions in its (#238)

Signed-off-by: Olivier Lamy <olamy@apache.org>
  • Loading branch information
olamy committed Jul 27, 2022
1 parent 4e8b33e commit 84e2dab
Show file tree
Hide file tree
Showing 14 changed files with 127 additions and 21 deletions.
5 changes: 3 additions & 2 deletions plexus-compiler-its/src/main/it/MCOMPILER-346-mre/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<url>https://github.com/basil/MCOMPILER-346-mre</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<plexus.compiler.version>@pom.version@</plexus.compiler.version>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -61,12 +62,12 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-api</artifactId>
<version>@pom.version@</version>
<version>${plexus.compiler.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-javac</artifactId>
<version>@pom.version@</version>
<version>${plexus.compiler.version}</version>
</dependency>
</dependencies>
</plugin>
Expand Down
7 changes: 4 additions & 3 deletions plexus-compiler-its/src/main/it/aspectj-compiler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,27 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<plexus.compiler.version>@pom.version@</plexus.compiler.version>
</properties>

<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>@maven.compiler.version@</version>
<configuration>
<compilerId>aspectj</compilerId>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-api</artifactId>
<version>@pom.version@</version>
<version>${plexus.compiler.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-aspectj</artifactId>
<version>@pom.version@</version>
<version>${plexus.compiler.version}</version>
</dependency>
</dependencies>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>

<plexus.compiler.version>@pom.version@</plexus.compiler.version>
<org.mapstruct.version>1.5.2.Final</org.mapstruct.version>
</properties>

Expand All @@ -51,20 +51,20 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<version>@maven.compiler.version@</version>
<configuration>
<compilerId>eclipse</compilerId>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-api</artifactId>
<version>@pom.version@</version>
<version>${plexus.compiler.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-eclipse</artifactId>
<version>@pom.version@</version>
<version>${plexus.compiler.version}</version>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
Expand Down
3 changes: 2 additions & 1 deletion plexus-compiler-its/src/main/it/error-prone-compiler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<javac.version>9+181-r4173-1</javac.version>
<plexus.compiler.version>@pom.version@</plexus.compiler.version>
</properties>

<dependencies>
Expand All @@ -48,7 +49,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>@maven.compiler.version@</version>
<configuration>
<target>8</target>
<source>8</source>
Expand Down
Original file line number Diff line number Diff line change
@@ -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
45 changes: 45 additions & 0 deletions plexus-compiler-its/src/main/it/missing-warnings/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>missing-warnings</artifactId>
<version>1.0-SNAPSHOT</version>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>@maven.compiler.version@</version>
<configuration>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
<showWarnings>true</showWarnings>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-api</artifactId>
<version>${plexus.compiler.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-javac</artifactId>
<version>${plexus.compiler.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<plexus.compiler.version>@pom.version@</plexus.compiler.version>
</properties>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.company;

public class SomeClass
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module testcase {
exports com.company to someOtherModule;
}
24 changes: 24 additions & 0 deletions plexus-compiler-its/src/main/it/missing-warnings/verify.groovy
Original file line number Diff line number Diff line change
@@ -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;" )
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<plexus.compiler.version>@pom.version@</plexus.compiler.version>
</properties>

<dependencies>
Expand All @@ -58,12 +59,12 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-api</artifactId>
<version>@pom.version@</version>
<version>${plexus.compiler.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-eclipse</artifactId>
<version>@pom.version@</version>
<version>${plexus.compiler.version}</version>
</dependency>
</dependencies>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<plexus.compiler.version>@pom.version@</plexus.compiler.version>
</properties>

<dependencies>
Expand All @@ -58,12 +59,12 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-api</artifactId>
<version>@pom.version@</version>
<version>${plexus.compiler.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-eclipse</artifactId>
<version>@pom.version@</version>
<version>${plexus.compiler.version}</version>
</dependency>
</dependencies>
</plugin>
Expand Down
7 changes: 4 additions & 3 deletions plexus-compiler-its/src/main/it/simple-javac-fork/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<plexus.compiler.version>@pom.version@</plexus.compiler.version>
</properties>

<dependencies>
Expand All @@ -50,7 +51,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>@maven.compiler.version@</version>
<configuration>
<fork>true</fork>
<compilerArgs>
Expand All @@ -61,12 +62,12 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-api</artifactId>
<version>@pom.version@</version>
<version>${plexus.compiler.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-javac</artifactId>
<version>@pom.version@</version>
<version>${plexus.compiler.version}</version>
</dependency>
</dependencies>
</plugin>
Expand Down
9 changes: 5 additions & 4 deletions plexus-compiler-its/src/main/it/simple-javac/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<plexus.compiler.version>@pom.version@</plexus.compiler.version>
</properties>

<dependencies>
Expand All @@ -50,22 +51,22 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>@maven.compiler.version@</version>
<configuration>
<compilerArgs>
<compilerArg>-Xlint:-path</compilerArg>
</compilerArgs>
</configuration>
<dependencies>
<dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-api</artifactId>
<version>@pom.version@</version>
<version>${plexus.compiler.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-javac</artifactId>
<version>@pom.version@</version>
<version>${plexus.compiler.version}</version>
</dependency>
</dependencies>
</plugin>
Expand Down
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
<errorprone.version>2.14.0</errorprone.version>
<trimStackTrace>false</trimStackTrace>
<preparationGoals>clean install</preparationGoals>
<maven.compiler.version>3.10.1</maven.compiler.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -129,6 +130,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<release>8</release>
</configuration>
Expand Down

0 comments on commit 84e2dab

Please sign in to comment.