Closed
Description
Affected version
4.0.0-beta-2
Bug description
When trying to compile Java code using Maven 4.0.0-RC3 a NoSuchMethodError
is thrown. This does not happen when using Maven 4.0.0-RC2.
The command I execute is
<path-to-my-maven-4-installation>/bin/mvn verify
Here is the full error message
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:4.0.0-beta-2:compile (default-compile) on project untitled: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:4.0.0-beta-2:compile failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-compiler-plugin:4.0.0-beta-2:compile: java.lang.NoSuchMethodError: 'java.util.List org.apache.maven.api.services.ProjectManager.getCompileSourceRoots(org.apache.maven.api.Project, org.apache.maven.api.ProjectScope)'
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-compiler-plugin:4.0.0-beta-2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/philip/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/4.0.0-beta-2/maven-compiler-plugin-4.0.0-beta-2.jar
[ERROR] urls[1] = file:/home/philip/.m2/repository/org/ow2/asm/asm/9.7.1/asm-9.7.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api.v4, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
This is the entirety of my pom
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.1.0 http://maven.apache.org/xsd/maven-4.1.0.xsd">
<modelVersion>4.1.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>untitled</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>4.0.0-beta-2</version>
<configuration>
<release>23</release>
</configuration>
</plugin>
</plugins>
</build>
</project>