Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions src/it/CHANGES_v3_to_v4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<!---
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.
-->

# Changes in integration tests since Maven 3
This section describes noticeable changes in the tests of Maven Compiler Plugin 4
compared to the tests of Maven Compiler Plugin 3.
The purpose of this section is to help the port of new tests added to the Maven Compiler Plugin 3
by documenting which tests to ignore and what to modify in new tests.

## Changes in POM parameters
Moved or added the following configuration parameters in the `pom.xml` files of some tests:

* The `<outputDirectory>` and `<testOutputDirectory>` parameters declared under `<configuration>`
moved to `<build>`, because those properties are read-only in the configuration.
* Many `<source>` and `<target>` parameters have been either removed or replaced by `<release>`.
* For some tests using a non-modular JAR in a modular project,
`<type>modular-jar</type>` has been added in the dependency declaration.

## Changes to met new plugin assumptions
The plugin incremental compilation algorithm depends on the convention that
Java source files are located in directories of the same name as their package names,
with the `.` separator replaced by path separator (`/` or `\`).
This is a very common convention, but not strictly required by the Java compiler.
For example, if the `src/main/java/MyCode.java` file contains the `package foo` statement,
the compiled class will be located in `target/classes/foo/MyCode.class` — note the `foo` additional directory.
In such case, the incremental build algorithm will not track correctly the changes.
The following tests have been made compliant with the convention for allowing the algorithm to work:

* `mcompiler-182` in integration tests.

Note that due to [MCOMPILER-209](https://jira.codehaus.org/browse/MCOMPILER-209),
the old algorithm was compiling everything without really detecting change.
So this issue is maybe not really a regression.
To reproduce the old behavior, users can just disable the incremental compilation.

## Removed integration tests
The tests in the following directories were already disabled and have been removed:

* `MCOMPILER-197` because it ran only on Java 8 while the build now requires Java 17.
* `groovy-project-with-new-plexus-compiler` because it ran only on Java 8 and the plexus compiler has been removed.

The tests in the following directores are not supported anymore and have been removed:

* `release-without-profile` because the plugin no longer try to chose automatically
which parameters to use between `--source` and `--release`. This is justified by
the fact that the plugin cannot run on Java 8.
* `release-without-profile-fork` for the same reason as above.
* `MCOMPILER-190`, which has been replaced by `MCOMPILER-609`.
They are compilation tests using the Eclipse compiler, but the former test depended on Nexus.
It has been replaced by a test that depends on `javax.tools`.


## Removed JUnit tests
Removed the following directories and associated test methods:

* `compiler-one-output-file-test2` because it was redundant with `compiler-one-output-file-test`.

The only difference was the addition of include/exclude filters, but that difference had
no effect because the compiler mock used in this test was ignoring all sources anyway.
This test has been replaced by `compiler-modular-project`.
Comment on lines +67 to +74
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think no one will care in the future about this. This is appropriate for this PR / issue to mention once, but for future use it is probably uninteresting.

Copy link
Contributor Author

@desruisseaux desruisseaux Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose of this file is to document the differences between the 3.x and 4.0 branches. The compiler-one-output-file-test2 directory is still present in the 3.x branch. Because some tests have been added in the 3.x branch without being ported yet to the 4.0 branch (e.g., MCOMPILER-538), in the future we may want to compare the two branches for checking which tests present in one branch are missing in the other branch. This note is for remembering to not port that directory.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I thought that should be obvious when browsing through the history, as the history would now have a reference to an issue. But now that you mention it, your commits do not have an issue linked, it seems.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I'm lazily mixing two works in this same pull request. The work that really solves the issue described in this issue is the "Fix: annotation processor not always detected when specified with processor" commit. But since this commit adds a new integration test, this pull request opportunistically does some cleanup in those tests first. Those cleanups are in separated commits, with the intend to not squash them. The README.md file is added as part of this cleanup, but it describes changes that were actually done long ago.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I'm lazily mixing two works in this same pull request.

then why all those renames :D :D :D 💋

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is because some integration tests were using the install goal. I replaced some install by verify in this commit but a few remain if I remember right. The use of install goal in integration tests pollutes the ~/.m2/repository/ directory. By using the org.apache.maven.plugins.compiler.it groupId for all tests, we ensure that if some install goals are used again for whatever reason, at least we have a single place to cleanup in the .m2/repository directory.

2 changes: 1 addition & 1 deletion src/it/MCOMPILER-157/annotation-processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ under the License.
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.issue</groupId>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>compiler-test</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
Expand Down
4 changes: 2 additions & 2 deletions src/it/MCOMPILER-157/annotation-user/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ under the License.
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.issue</groupId>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>compiler-test</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
Expand All @@ -30,7 +30,7 @@ under the License.

<dependencies>
<dependency>
<groupId>org.issue</groupId>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>annotation-processor</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
Expand Down
2 changes: 1 addition & 1 deletion src/it/MCOMPILER-157/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ under the License.
<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.issue</groupId>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>compiler-test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
Expand Down
7 changes: 3 additions & 4 deletions src/it/MCOMPILER-192/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ specific language governing permissions and limitations
under the License.
-->
<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>blah</groupId>
<artifactId>blah</artifactId>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>MCOMPILER-192</artifactId>
<version>1.0</version>
<packaging>jar</packaging>

Expand All @@ -34,7 +33,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>@pom.version@</version>
<version>@project.version@</version>
<configuration>
<fork>true</fork>
<includes>
Expand Down
2 changes: 1 addition & 1 deletion src/it/MCOMPILER-192/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def causedByExpected = content.contains ( 'Caused by: org.apache.maven.plugin.co
def twoFilesBeingCompiled = content.contains ( 'Compiling all files' )
def checkResult = content.contains ( 'BUILD FAILURE' )
def compilationFailure1 = content.contains( '[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:')
def compilationFailure2 = content.contains( ':compile (default-compile) on project blah: Cannot compile')
def compilationFailure2 = content.contains( ':compile (default-compile) on project MCOMPILER-192: Cannot compile')

println "Jenkins: causedByExpected:${causedByExpected} twoFilesBeingCompiled:${twoFilesBeingCompiled} checkResult: ${checkResult} compilationFailure1: ${compilationFailure1} compilationFailure2: ${compilationFailure2}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ under the License.
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.issue</groupId>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>compiler-test</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
Expand Down
4 changes: 2 additions & 2 deletions src/it/MCOMPILER-203-processorpath/annotation-user/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ under the License.
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.issue</groupId>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>compiler-test</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
Expand Down Expand Up @@ -52,7 +52,7 @@ under the License.
</annotationProcessors>
<annotationProcessorPaths>
<path>
<groupId>org.issue</groupId>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>annotation-processor</artifactId>
<version>1.0-SNAPSHOT</version>
</path>
Expand Down
2 changes: 1 addition & 1 deletion src/it/MCOMPILER-203-processorpath/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ under the License.
<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.issue</groupId>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>compiler-test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
Expand Down
7 changes: 3 additions & 4 deletions src/it/MCOMPILER-205/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ specific language governing permissions and limitations
under the License.
-->
<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>blah</groupId>
<artifactId>blah</artifactId>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>MCOMPILER-205</artifactId>
<version>1.0</version>
<packaging>jar</packaging>

Expand All @@ -34,7 +33,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>@pom.version@</version>
<version>@project.version@</version>
<configuration>
<createMissingPackageInfoClass>true</createMissingPackageInfoClass>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion src/it/MCOMPILER-224/annotation-processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ under the License.
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.issue</groupId>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>compiler-test</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
Expand Down
6 changes: 3 additions & 3 deletions src/it/MCOMPILER-224/annotation-user/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ under the License.
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.issue</groupId>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>compiler-test</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
Expand All @@ -30,7 +30,7 @@ under the License.

<dependencies>
<dependency>
<groupId>org.issue</groupId>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>annotation-processor</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
Expand All @@ -50,7 +50,7 @@ under the License.
</configuration>
<dependencies>
<dependency>
<groupId>org.issue</groupId>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>annotation-processor</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion src/it/MCOMPILER-224/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ under the License.
<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.issue</groupId>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>compiler-test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion src/it/MCOMPILER-228/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ under the License.
<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.its</groupId>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>mcompiler228</artifactId>
<version>1.0-SNAPSHOT</version>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# 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
Expand Down
3 changes: 2 additions & 1 deletion src/it/MCOMPILER-346/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.basilcrow</groupId>

<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>MCOMPILER-346-mre</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion src/it/MCOMPILER-373_mrjar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ under the License.
<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.maven.bug</groupId>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>mcompiler373</artifactId>
<version>1.0-SNAPSHOT</version>

Expand Down
4 changes: 2 additions & 2 deletions src/it/MCOMPILER-481-requires-static-included/app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ under the License.

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.example</groupId>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>compiler-bug</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>compiler-bug-app</artifactId>

<dependencies>
<dependency>
<groupId>org.example</groupId>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>compiler-bug-service</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
Expand Down
3 changes: 2 additions & 1 deletion src/it/MCOMPILER-481-requires-static-included/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ under the License.
-->
<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.example</groupId>

<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>compiler-bug</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ under the License.

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.example</groupId>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>compiler-bug</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
Expand Down
7 changes: 3 additions & 4 deletions src/it/MCOMPILER-485/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ specific language governing permissions and limitations
under the License.
-->
<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>blah</groupId>
<artifactId>blah</artifactId>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>MCOMPILER-485</artifactId>
<version>1.0</version>
<packaging>jar</packaging>

Expand All @@ -34,7 +33,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>@pom.version@</version>
<version>@project.version@</version>
<configuration>
<createMissingPackageInfoClass>true</createMissingPackageInfoClass>
</configuration>
Expand Down
6 changes: 3 additions & 3 deletions src/it/MCOMPILER-495/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ under the License.

<modelVersion>4.0.0</modelVersion>

<groupId>blah</groupId>
<artifactId>blah</artifactId>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>MCOMPILER-495</artifactId>
<version>1.0</version>
<packaging>jar</packaging>

Expand All @@ -34,7 +34,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>@pom.version@</version>
<version>@project.version@</version>
<configuration>
<createMissingPackageInfoClass>true</createMissingPackageInfoClass>
</configuration>
Expand Down
5 changes: 2 additions & 3 deletions src/it/MCOMPILER-500-package-info-incr/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ specific language governing permissions and limitations
under the License.
-->
<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</groupId>
<groupId>org.apache.maven.plugins.compiler.it</groupId>
<artifactId>maven-compiler-plugin-it-package-info-incr</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
Expand All @@ -34,7 +33,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>@pom.version@</version>
<version>@project.version@</version>
<configuration>
<createMissingPackageInfoClass>false</createMissingPackageInfoClass>
<incrementalExcludes>
Expand Down
Loading