Skip to content

An API incompatibility was encountered - Maven 4.0.0 RC 4 #244

@DevSnobo

Description

@DevSnobo

Affected version

4.0.0-beta-1

Bug description

While trying to test our build on Maven 4, I'm encountering some issues with plugins in our build. Currently, it is maven-source-plugin's turn.

I've tried using the currently released beta-1 version, and also compiled the current master for beta-2-SNAPSHOT, but the build keeps failing with the following error.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-source-plugin:4.0.0-beta-2-SNAPSHOT:jar-no-fork (attach-sources) on project redacted: Execution attach-sources of goal org.apache.maven.plugins:maven-source-plugin:4.0.0-beta-2-SNAPSHOT:jar-no-fork failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-source-plugin:4.0.0-beta-2-SNAPSHOT:jar-no-fork: 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-source-plugin:4.0.0-beta-2-SNAPSHOT
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/USER/.m2/repository/org/apache/maven/plugins/maven-source-plugin/4.0.0-beta-2-SNAPSHOT/maven-source-plugin-4.0.0-beta-2-SNAPSHOT.jar
[ERROR] urls[1] = file:/C:/Users/USER/.m2/repository/org/apache/maven/maven-archiver/4.0.0-beta-1/maven-archiver-4.0.0-beta-1.jar
[ERROR] urls[2] = file:/C:/Users/USER/.m2/repository/org/apache/maven/maven-api-meta/4.0.0-beta-3/maven-api-meta-4.0.0-beta-3.jar
[ERROR] urls[3] = file:/C:/Users/USER/.m2/repository/org/slf4j/slf4j-api/2.0.13/slf4j-api-2.0.13.jar
[ERROR] urls[4] = file:/C:/Users/USER/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.27/plexus-interpolation-1.27.jar
[ERROR] urls[5] = file:/C:/Users/USER/.m2/repository/org/codehaus/plexus/plexus-archiver/4.9.2/plexus-archiver-4.9.2.jar
[ERROR] urls[6] = file:/C:/Users/USER/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar
[ERROR] urls[7] = file:/C:/Users/USER/.m2/repository/org/codehaus/plexus/plexus-io/3.4.2/plexus-io-3.4.2.jar
[ERROR] urls[8] = file:/C:/Users/USER/.m2/repository/commons-io/commons-io/2.15.1/commons-io-2.15.1.jar
[ERROR] urls[9] = file:/C:/Users/USER/.m2/repository/org/apache/commons/commons-compress/1.26.2/commons-compress-1.26.2.jar
[ERROR] urls[10] = file:/C:/Users/USER/.m2/repository/org/apache/commons/commons-lang3/3.14.0/commons-lang3-3.14.0.jar
[ERROR] urls[11] = file:/C:/Users/USER/.m2/repository/commons-codec/commons-codec/1.16.1/commons-codec-1.16.1.jar
[ERROR] urls[12] = file:/C:/Users/USER/.m2/repository/org/iq80/snappy/snappy/0.4/snappy-0.4.jar
[ERROR] urls[13] = file:/C:/Users/USER/.m2/repository/org/tukaani/xz/1.9/xz-1.9.jar
[ERROR] urls[14] = file:/C:/Users/USER/.m2/repository/com/github/luben/zstd-jni/1.5.5-11/zstd-jni-1.5.5-11.jar
[ERROR] urls[15] = file:/C:/Users/USER/.m2/repository/org/codehaus/plexus/plexus-utils/4.0.2/plexus-utils-4.0.2.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api.v4, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------
[ERROR] 
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the '-e' switch
[ERROR] Re-run Maven using the '-X' switch to enable verbose output
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command

Is there anything more I can contribute? Please let me know!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions