An API incompatibility was encountered - Maven 4.0.0 RC 4

Ouverte
#244 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
25/100
Type d'issue
Bug
Clarté
À clarifier
Activité
À l'abandon
Stack technique
java
Domaine
build-system

Piste de recherche

Le rapport identifie l’objectif jar-no-fork de maven-source-plugin et un NoSuchMethodError pour ProjectManager.getCompileSourceRoots(Project, ProjectScope), mais ne mentionne aucun fichier source ni test. Commencez par reproduire l’échec avec Maven 4.0.0 RC 4 et comparer les versions de l’API du plugin ; le travail est terminé lorsque l’objectif s’exécute sans l’incompatibilité d’API signalée.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

bug
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!

Langage dominant
Java
Étoiles
36
Forks
39
Merge moyen
1 j 9 h
PR mergées (30 j)
21

Préparer son environnement

  • Aucun Dockerfile ni fichier Docker Compose
  • Propose un modèle de pull request
  • Aucun guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de apache/maven-source-plugin

Toutes les issues de apache/maven-source-plugin

Issues similaires

Plus d'issues Java

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.