Skip to content

Commit 46b207b

Browse files
authored
Rewrite the plugin using standard javax.tools API instead of Plexus. (#271)
* Rewrite the plugin using standard `javax.tools` API instead of Plexus. Other aspects that are rewritten include incremental build mechanism and how the overwriting of `module-info.java` in tests is handled. For details and impact on users, see pull request description at #271 * Temporarily disable the MCOMPILER-346 integration test. It will be re-enabled after Maven 4.0.0-beta-6 release. apache/maven#1865 * Remove the replacement of `/` by `\` on the Windows platform in GLOB syntax. It appears that the GLOB matcher expects `/` even on Windows. * Add a log at the error level when the compiler threw an exception instead of returning the Boolean `false` value. Adjust what is the cause and what is the suppressed exception. * Set the `maven-plugin-testing-harness` version to 4.0.0-beta-2. * Dummy change for forcing a new CI build.
1 parent 72921a5 commit 46b207b

File tree

218 files changed

+6892
-4613
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+6892
-4613
lines changed

.github/workflows/maven-verify.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v4
2828
with:
2929
# maven-args: "-Dinvoker.parallelThreads=2" cannot do this as this generate some concurrent download issues
30-
ff-maven: "4.0.0-beta-3" # Maven version for fail-fast-build
30+
ff-maven: "4.0.0-beta-5" # Maven version for fail-fast-build
3131
jdk-distribution-matrix: '[ "temurin", "zulu", "microsoft", "adopt-openj9" ]'
3232
jdk-matrix: '[ "17", "21" ]'
33-
maven-matrix: '[ "4.0.0-beta-3" ]' # Maven versions matrix for verify builds
33+
maven-matrix: '[ "4.0.0-beta-5" ]' # Maven versions matrix for verify builds

pom.xml

Lines changed: 26 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ under the License.
2323
<parent>
2424
<groupId>org.apache.maven.plugins</groupId>
2525
<artifactId>maven-plugins</artifactId>
26-
<version>42</version>
26+
<version>43</version>
2727
<relativePath />
2828
</parent>
2929

@@ -39,6 +39,20 @@ under the License.
3939
<contributor>
4040
<name>Jan Sievers</name>
4141
</contributor>
42+
<contributor>
43+
<name>Trygve Laugstøl</name>
44+
<email>trygvis@inamo.no</email>
45+
</contributor>
46+
<contributor>
47+
<name>Jason van Zyl</name>
48+
<email>jason@maven.org</email>
49+
</contributor>
50+
<contributor>
51+
<name>Andreas Gudian</name>
52+
</contributor>
53+
<contributor>
54+
<name>Martin Desruisseaux</name>
55+
</contributor>
4256
</contributors>
4357

4458
<prerequisites>
@@ -68,7 +82,7 @@ under the License.
6882

6983
<properties>
7084
<javaVersion>17</javaVersion>
71-
<mavenVersion>4.0.0-beta-3</mavenVersion>
85+
<mavenVersion>4.0.0-beta-5</mavenVersion>
7286

7387
<asmVersion>9.7</asmVersion>
7488
<groovyVersion>2.4.21</groovyVersion>
@@ -78,33 +92,21 @@ under the License.
7892
<junit4Version>4.13.2</junit4Version>
7993
<junitVersion>5.10.1</junitVersion>
8094
<mockitoVersion>5.12.0</mockitoVersion>
81-
<mavenPluginTestingHarnessVersion>4.0.0-beta-2-SNAPSHOT</mavenPluginTestingHarnessVersion>
95+
<mavenPluginTestingHarnessVersion>4.0.0-beta-2</mavenPluginTestingHarnessVersion>
8296
<plexusCompilerVersion>2.15.0</plexusCompilerVersion>
8397
<plexusJavaVersion>1.2.0</plexusJavaVersion>
8498
<sisuPlexusVersion>0.9.0.M2</sisuPlexusVersion>
85-
<slf4jVersion>2.0.13</slf4jVersion>
8699
<surefire.version>3.2.1</surefire.version>
87100
<version.maven-invoker-plugin>3.7.0</version.maven-invoker-plugin>
88101
<version.maven-plugin-tools-3.x>3.13.1</version.maven-plugin-tools-3.x>
89-
<version.maven-plugin-tools>4.0.0-beta-2-SNAPSHOT</version.maven-plugin-tools>
90-
<version.plexus-xml>4.0.1</version.plexus-xml>
102+
<version.maven-plugin-tools>4.0.0-beta-1</version.maven-plugin-tools>
91103

92104
<invoker.junitPackageName>org.apache.maven.plugins.compiler.its</invoker.junitPackageName>
93105
<maven.it.failure.ignore>false</maven.it.failure.ignore>
94106

95-
<project.build.outputTimestamp>2024-06-26T08:45:58Z</project.build.outputTimestamp>
107+
<project.build.outputTimestamp>2024-11-14T13:00:00Z</project.build.outputTimestamp>
96108
</properties>
97109

98-
<dependencyManagement>
99-
<dependencies>
100-
<dependency>
101-
<groupId>com.google.guava</groupId>
102-
<artifactId>guava</artifactId>
103-
<version>32.0.1-jre</version>
104-
</dependency>
105-
</dependencies>
106-
</dependencyManagement>
107-
108110
<dependencies>
109111
<!-- Maven -->
110112
<dependency>
@@ -113,88 +115,11 @@ under the License.
113115
<version>${mavenVersion}</version>
114116
<scope>provided</scope>
115117
</dependency>
116-
<dependency>
117-
<groupId>org.apache.maven</groupId>
118-
<artifactId>maven-api-di</artifactId>
119-
<version>${mavenVersion}</version>
120-
<scope>provided</scope>
121-
</dependency>
122-
<dependency>
123-
<groupId>org.apache.maven</groupId>
124-
<artifactId>maven-api-meta</artifactId>
125-
<version>${mavenVersion}</version>
126-
<scope>provided</scope>
127-
</dependency>
128-
<dependency>
129-
<groupId>org.apache.maven</groupId>
130-
<artifactId>maven-api-model</artifactId>
131-
<version>${mavenVersion}</version>
132-
<scope>provided</scope>
133-
</dependency>
134-
<dependency>
135-
<groupId>org.apache.maven</groupId>
136-
<artifactId>maven-api-xml</artifactId>
137-
<version>${mavenVersion}</version>
138-
<scope>provided</scope>
139-
</dependency>
140-
<dependency>
141-
<groupId>org.codehaus.plexus</groupId>
142-
<artifactId>plexus-utils</artifactId>
143-
</dependency>
144-
<dependency>
145-
<groupId>org.eclipse.sisu</groupId>
146-
<artifactId>org.eclipse.sisu.plexus</artifactId>
147-
<version>${sisuPlexusVersion}</version>
148-
</dependency>
149-
<dependency>
150-
<groupId>org.codehaus.plexus</groupId>
151-
<artifactId>plexus-java</artifactId>
152-
<version>${plexusJavaVersion}</version>
153-
</dependency>
154118
<dependency>
155119
<groupId>org.ow2.asm</groupId>
156120
<artifactId>asm</artifactId>
157121
<version>${asmVersion}</version>
158122
</dependency>
159-
<dependency>
160-
<groupId>org.slf4j</groupId>
161-
<artifactId>slf4j-api</artifactId>
162-
<version>${slf4jVersion}</version>
163-
</dependency>
164-
165-
<dependency>
166-
<groupId>org.codehaus.plexus</groupId>
167-
<artifactId>plexus-compiler-api</artifactId>
168-
<version>${plexusCompilerVersion}</version>
169-
<exclusions>
170-
<exclusion>
171-
<groupId>org.codehaus.plexus</groupId>
172-
<artifactId>plexus-component-api</artifactId>
173-
</exclusion>
174-
</exclusions>
175-
</dependency>
176-
<dependency>
177-
<groupId>org.codehaus.plexus</groupId>
178-
<artifactId>plexus-compiler-manager</artifactId>
179-
<version>${plexusCompilerVersion}</version>
180-
<exclusions>
181-
<exclusion>
182-
<groupId>org.codehaus.plexus</groupId>
183-
<artifactId>plexus-component-api</artifactId>
184-
</exclusion>
185-
</exclusions>
186-
</dependency>
187-
<dependency>
188-
<groupId>org.codehaus.plexus</groupId>
189-
<artifactId>plexus-compiler-javac</artifactId>
190-
<version>${plexusCompilerVersion}</version>
191-
<exclusions>
192-
<exclusion>
193-
<groupId>org.codehaus.plexus</groupId>
194-
<artifactId>plexus-component-api</artifactId>
195-
</exclusion>
196-
</exclusions>
197-
</dependency>
198123

199124
<dependency>
200125
<groupId>org.apache.maven</groupId>
@@ -237,17 +162,18 @@ under the License.
237162
<artifactId>junit-jupiter-api</artifactId>
238163
<scope>test</scope>
239164
</dependency>
240-
<dependency>
241-
<groupId>org.slf4j</groupId>
242-
<artifactId>slf4j-simple</artifactId>
243-
<version>${slf4jVersion}</version>
244-
<scope>test</scope>
245-
</dependency>
246165
</dependencies>
247166

248167
<build>
249168
<pluginManagement>
250169
<plugins>
170+
<plugin>
171+
<groupId>org.apache.maven.plugins</groupId>
172+
<artifactId>maven-compiler-plugin</artifactId>
173+
<configuration>
174+
<release>${javaVersion}</release>
175+
</configuration>
176+
</plugin>
251177
<plugin>
252178
<groupId>com.diffplug.spotless</groupId>
253179
<artifactId>spotless-maven-plugin</artifactId>
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# Licensed to the Apache Software Foundation (ASF) under one
2-
# or more contributor license agreements. See the NOTICE file
3-
# distributed with this work for additional information
4-
# regarding copyright ownership. The ASF licenses this file
5-
# to you under the Apache License, Version 2.0 (the
6-
# "License"); you may not use this file except in compliance
7-
# with the License. You may obtain a copy of the License at
8-
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
11-
# Unless required by applicable law or agreed to in writing,
12-
# software distributed under the License is distributed on an
13-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14-
# KIND, either express or implied. See the License for the
15-
# specific language governing permissions and limitations
16-
# under the License.
17-
18-
invoker.goals = clean compile
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
invoker.goals = clean compile

src/it/MCOMPILER-129/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ under the License.
3333
<version>@project.version@</version>
3434
<configuration>
3535
<fork>true</fork>
36-
<!-- this has been deprecated, but still works
37-
<compilerArguments>
38-
<J-Duser.language>en_us</J-Duser.language>
39-
</compilerArguments>
40-
-->
4136
<compilerArgs>
4237
<compilerArg>-J-Duser.language=en_us</compilerArg>
4338
</compilerArgs>

src/it/MCOMPILER-157/annotation-processor/src/main/java/org/issue/SimpleAnnotationProcessor.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,19 @@
3636
import java.io.Writer;
3737
import java.util.Set;
3838

39-
@SupportedSourceVersion(SourceVersion.RELEASE_6)
39+
@SupportedSourceVersion(SourceVersion.RELEASE_17)
4040
@SupportedAnnotationTypes("org.issue.SimpleAnnotation")
4141
public class SimpleAnnotationProcessor extends AbstractProcessor {
4242

4343
@Override
4444
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
4545
Filer filer = processingEnv.getFiler();
46-
4746
Elements elementUtils = processingEnv.getElementUtils();
48-
4947
Set<? extends Element> elements = roundEnv.getElementsAnnotatedWith(SimpleAnnotation.class);
5048

5149
for (Element element : elements) {
5250
Name name = element.getSimpleName();
53-
5451
PackageElement packageElement = elementUtils.getPackageOf(element);
55-
5652
try {
5753
FileObject resource = filer.createResource(
5854
StandardLocation.SOURCE_OUTPUT, packageElement.getQualifiedName(), name + ".txt", element);
@@ -64,7 +60,6 @@ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment
6460
throw new RuntimeException(e);
6561
}
6662
}
67-
6863
return !elements.isEmpty();
6964
}
7065
}

src/it/MCOMPILER-157/invoker.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
# to you under the Apache License, Version 2.0 (the
66
# "License"); you may not use this file except in compliance
77
# with the License. You may obtain a copy of the License at
8-
#
8+
#
99
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
10+
#
1111
# Unless required by applicable law or agreed to in writing,
1212
# software distributed under the License is distributed on an
1313
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

src/it/MCOMPILER-170/invoker.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
# to you under the Apache License, Version 2.0 (the
66
# "License"); you may not use this file except in compliance
77
# with the License. You may obtain a copy of the License at
8-
#
8+
#
99
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
10+
#
1111
# Unless required by applicable law or agreed to in writing,
1212
# software distributed under the License is distributed on an
1313
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

src/it/MCOMPILER-190/invoker.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
# to you under the Apache License, Version 2.0 (the
66
# "License"); you may not use this file except in compliance
77
# with the License. You may obtain a copy of the License at
8-
#
8+
#
99
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
10+
#
1111
# Unless required by applicable law or agreed to in writing,
1212
# software distributed under the License is distributed on an
1313
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

src/it/MCOMPILER-190/pom.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ under the License.
3434
<version>@pom.version@</version>
3535
<configuration>
3636
<compilerId>eclipse</compilerId>
37-
<source>1.5</source>
38-
<target>1.5</target>
3937
</configuration>
4038
<dependencies>
4139
<dependency>

src/it/MCOMPILER-192/invoker.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
# to you under the Apache License, Version 2.0 (the
66
# "License"); you may not use this file except in compliance
77
# with the License. You may obtain a copy of the License at
8-
#
8+
#
99
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
10+
#
1111
# Unless required by applicable law or agreed to in writing,
1212
# software distributed under the License is distributed on an
1313
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

0 commit comments

Comments
 (0)