Open jorsol opened 1 year ago
Hit the same error testing maven alpha, can try to make a minimal project to reproduces if needed
Maven core issue https://issues.apache.org/jira/browse/MNG-7642
Maven 4.0.0-alpha-5
Execution default of goal org.codehaus.mojo:flatten-maven-plugin:1.4.1-SNAPSHOT:flatten failed:
An API incompatibility was encountered while executing org.codehaus.mojo:flatten-maven-plugin:1.4.1-SNAPSHOT:flatten:
java.lang.AbstractMethodError: Receiver class org.codehaus.mojo.flatten.model.resolution.FlattenModelResolver does not define or inherit an implementation of the resolved method 'abstract org.apache.maven.model.building.ModelSource resolveModel(org.apache.maven.model.Dependency)' of interface org.apache.maven.model.resolution.ModelResolver.
After #351 - only a few test are failed with 4.0.0-alpha-5
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.3.0:shade (shade) on project flatten-shaded-drp:
Execution shade of goal org.apache.maven.plugins:maven-shade-plugin:3.3.0:shade
failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-shade-plugin:3.3.0:shade: java.lang.NoSuchMethodError: 'java.lang.Object org.apache.maven.model.Model.getReports()'
complete-multimodule-parent-pom-cifriendly/pom.xml
legacy-property-support/pom.xml
resolve-properties-ci/pom.xml
resolve-properties-ci-do-not-interpolate-profile-activation-file/pom.xml
issue-348-repository-from-project/pom.xml
Unrecognised tag: 'goals' (position: START_TAG seen ...</version>\n <goals>... @77:16) @ io.netty:netty-bom:4.1.84.Final
at org.apache.maven.model.building.DefaultModelProblemCollector.newModelBuildingException (DefaultModelProblemCollector.java:176)
at org.apache.maven.model.building.DefaultModelBuilder.build (DefaultModelBuilder.java:937)
at org.apache.maven.model.building.DefaultModelBuilder.build (DefaultModelBuilder.java:664)
at org.apache.maven.model.building.DefaultModelBuilder.build (DefaultModelBuilder.java:645)
at org.codehaus.mojo.flatten.ModelBuilderThreadSafetyWorkaround.build (ModelBuilderThreadSafetyWorkaround.java:132)
complete-multimodule-parent-pom-direct-dependencies/pom.xml
I only list failed tests - without more investigation
But I confirm generally is working with Maven 4
flatten-shaded-drp
fixed in #355
Running mvn clean install -Dquickly
(using Maven 4.0.0-alpha-5) on Apache Camel (https://github.com/apache/camel/tree/c57398568f9db0c7ec6bb5eb2b0964bb8a5c8794) gives:
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.stream()" because "dependencies" is null
at org.apache.maven.model.ModelBase.setDependencies (ModelBase.java:164)
at org.codehaus.mojo.flatten.FlattenMojo.createCleanPom (FlattenMojo.java:686)
at org.codehaus.mojo.flatten.FlattenMojo.createFlattenedPom (FlattenMojo.java:554)
at org.codehaus.mojo.flatten.FlattenMojo.execute (FlattenMojo.java:406)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:143)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:336)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:324)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:77)
at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:114)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:60)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:132)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:313)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:228)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:153)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:865)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:284)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:201)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:568)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Works fine on Maven 3.9.2.
@ammachado can you extract a simple project which reproduce your issue?
Running a project with Apache Maven 4.0.0-alpha-3 gives the following error: