Description
Hi, there are multiple versions of org.codehaus.plexus:plexus-utils in karaf\tooling\karaf-maven-plugin. As shown in the following dependency tree, according to Maven's “nearest wins” strategy, only org.codehaus.plexus:plexus-utils:3.0.24 can be loaded, and org.codehaus.plexus:plexus-utils:3.2.1 will be shadowed.
As org.codehaus.plexus:plexus-utils:3.2.1 has not been loaded during the building process, several methods are missing. However, the missing methods:
1. org.codehaus.plexus.util.xml.Xpp3DomBuilder: org.codehaus.plexus.util.xml.Xpp3Dom build(org.codehaus.plexus.util.xml.pull.XmlPullParser,boolean,org.codehaus.plexus.util.xml.Xpp3DomBuilder$InputLocationBuilder)
<org.apache.karaf.tooling.features.GenerateDescriptorMojo: void execute()> karaf\tooling\karaf-maven-plugin\target\classes <org.apache.karaf.tooling.features.GenerateDescriptorMojo: void writeFeatures(java.io.PrintStream)> karaf\tooling\karaf-maven-plugin\target\classes <org.apache.karaf.tooling.features.GenerateDescriptorMojo: java.lang.String getVersionOrRange(java.lang.Object,java.lang.Object)> karaf\tooling\karaf-maven-plugin\target\classes <org.apache.karaf.tooling.features.GenerateDescriptorMojo: org.apache.maven.project.MavenProject resolveProject(java.lang.Object)> karaf\tooling\karaf-maven-plugin\target\classes <org.apache.maven.project.DefaultProjectBuilder: org.apache.maven.project.ProjectBuildingResult build(org.apache.maven.artifact.Artifact,org.apache.maven.project.ProjectBuildingRequest)> repository\org\apache\maven\maven-core\3.6.3\maven-core-3.6.3.jar <org.apache.maven.project.DefaultProjectBuilder: org.apache.maven.project.ProjectBuildingResult build(org.apache.maven.artifact.Artifact,boolean,org.apache.maven.project.ProjectBuildingRequest)> repository\org\apache\maven\maven-core\3.6.3\maven-core-3.6.3.jar <org.apache.maven.project.DefaultProjectBuilder: org.apache.maven.project.ProjectBuildingResult build(java.io.File,org.apache.maven.model.building.ModelSource,org.apache.maven.project.DefaultProjectBuilder$InternalConfig)> repository\org\apache\maven\maven-core\3.6.3\maven-core-3.6.3.jar <org.apache.maven.model.building.DefaultModelBuilder: org.apache.maven.model.building.ModelBuildingResult build(org.apache.maven.model.building.ModelBuildingRequest)> repository\org\apache\maven\maven-model-builder\3.6.3\maven-model-builder-3.6.3.jar <org.apache.maven.model.building.DefaultModelBuilder: org.apache.maven.model.Model readModel(org.apache.maven.model.building.ModelSource,java.io.File,org.apache.maven.model.building.ModelBuildingRequest,org.apache.maven.model.building.DefaultModelProblemCollector)> repository\org\apache\maven\maven-model-builder\3.6.3\maven-model-builder-3.6.3.jar <org.apache.maven.model.building.DefaultModelProcessor: org.apache.maven.model.Model read(java.io.InputStream,java.util.Map)> repository\org\apache\maven\maven-model-builder\3.6.3\maven-model-builder-3.6.3.jar <org.apache.maven.model.io.DefaultModelReader: org.apache.maven.model.Model read(java.io.InputStream,java.util.Map)> repository\org\apache\maven\maven-model-builder\3.6.3\maven-model-builder-3.6.3.jar <org.apache.maven.model.io.DefaultModelReader: org.apache.maven.model.Model read(java.io.Reader,boolean,org.apache.maven.model.InputSource)> repository\org\apache\maven\maven-model-builder\3.6.3\maven-model-builder-3.6.3.jar <org.apache.maven.model.io.xpp3.MavenXpp3ReaderEx: org.apache.maven.model.Model read(java.io.Reader,boolean,org.apache.maven.model.InputSource)> repository\org\apache\maven\maven-model\3.6.3\maven-model-3.6.3.jar <org.apache.maven.model.io.xpp3.MavenXpp3ReaderEx: org.apache.maven.model.Model read(org.codehaus.plexus.util.xml.pull.XmlPullParser,boolean,org.apache.maven.model.InputSource)> repository\org\apache\maven\maven-model\3.6.3\maven-model-3.6.3.jar <org.apache.maven.model.io.xpp3.MavenXpp3ReaderEx: org.apache.maven.model.Model parseModel(org.codehaus.plexus.util.xml.pull.XmlPullParser,boolean,org.apache.maven.model.InputSource)> repository\org\apache\maven\maven-model\3.6.3\maven-model-3.6.3.jar <org.codehaus.plexus.util.xml.Xpp3DomBuilder: org.codehaus.plexus.util.xml.Xpp3Dom build(org.codehaus.plexus.util.xml.pull.XmlPullParser,boolean,org.codehaus.plexus.util.xml.Xpp3DomBuilder$InputLocationBuilder)>
2. org.codehaus.plexus.util.xml.Xpp3Dom: void init (java.lang.String,java.lang.Object)
<org.apache.karaf.tooling.features.GenerateDescriptorMojo: void execute()> karaf\tooling\karaf-maven-plugin\target\classes <org.apache.karaf.tooling.features.GenerateDescriptorMojo: void writeFeatures(java.io.PrintStream)> karaf\tooling\karaf-maven-plugin\target\classes <org.apache.karaf.tooling.features.GenerateDescriptorMojo: java.lang.String getVersionOrRange(java.lang.Object,java.lang.Object)> karaf\tooling\karaf-maven-plugin\target\classes <org.apache.karaf.tooling.features.GenerateDescriptorMojo: org.apache.maven.project.MavenProject resolveProject(java.lang.Object)> karaf\tooling\karaf-maven-plugin\target\classes <org.apache.maven.project.DefaultProjectBuilder: org.apache.maven.project.ProjectBuildingResult build(org.apache.maven.artifact.Artifact,org.apache.maven.project.ProjectBuildingRequest)> repository\org\apache\maven\maven-core\3.6.3\maven-core-3.6.3.jar <org.apache.maven.project.DefaultProjectBuilder: org.apache.maven.project.ProjectBuildingResult build(org.apache.maven.artifact.Artifact,boolean,org.apache.maven.project.ProjectBuildingRequest)> repository\org\apache\maven\maven-core\3.6.3\maven-core-3.6.3.jar <org.apache.maven.project.DefaultProjectBuilder: org.apache.maven.project.ProjectBuildingResult build(java.io.File,org.apache.maven.model.building.ModelSource,org.apache.maven.project.DefaultProjectBuilder$InternalConfig)> repository\org\apache\maven\maven-core\3.6.3\maven-core-3.6.3.jar <org.apache.maven.model.building.DefaultModelBuilder: org.apache.maven.model.building.ModelBuildingResult build(org.apache.maven.model.building.ModelBuildingRequest)> repository\org\apache\maven\maven-model-builder\3.6.3\maven-model-builder-3.6.3.jar <org.apache.maven.model.building.DefaultModelBuilder: org.apache.maven.model.building.ModelBuildingResult build(org.apache.maven.model.building.ModelBuildingRequest,org.apache.maven.model.building.ModelBuildingResult)> repository\org\apache\maven\maven-model-builder\3.6.3\maven-model-builder-3.6.3.jar <org.apache.maven.model.building.DefaultModelBuilder: org.apache.maven.model.building.ModelBuildingResult build(org.apache.maven.model.building.ModelBuildingRequest,org.apache.maven.model.building.ModelBuildingResult,java.util.Collection)> repository\org\apache\maven\maven-model-builder\3.6.3\maven-model-builder-3.6.3.jar <org.apache.maven.model.plugin.DefaultReportingConverter: void convertReporting(org.apache.maven.model.Model,org.apache.maven.model.building.ModelBuildingRequest,org.apache.maven.model.building.ModelProblemCollector)> repository\org\apache\maven\maven-model-builder\3.6.3\maven-model-builder-3.6.3.jar <org.codehaus.plexus.util.xml.Xpp3Dom: void <init>(java.lang.String,java.lang.Object)>
The above missing methods are actually referenced by karaf\tooling\karaf-maven-plugin, which will cause “NoSuchMethodErrors” at runtime.
Suggested fixing solutions:
1. Upgrade dependency org.codehaus.plexus:plexus-utils from 3.0.24 to 3.2.0.
Thank you very much for your attention.
Best regards,
Dependency tree----
[INFO] org.apache.karaf.tooling:karaf-maven-plugin:maven-plugin:4.3.0-SNAPSHOT
[INFO] +- org.apache.maven:maven-core:jar:3.6.3:compile
[INFO] | +- org.apache.maven:maven-settings:jar:3.6.3:compile
[INFO] | | - (org.codehaus.plexus:plexus-utils:jar:3.2.1:compile - omitted for duplicate)
[INFO] | +- org.apache.maven:maven-settings-builder:jar:3.6.3:compile
[INFO] | | +- (org.codehaus.plexus:plexus-utils:jar:3.2.1:compile - omitted for duplicate)
[INFO] | | - org.sonatype.plexus:plexus-sec-dispatcher:jar:1.4:compile
[INFO] | | - (org.codehaus.plexus:plexus-utils:jar:1.5.5:compile - omitted for conflict with 3.2.1)
[INFO] | +- org.apache.maven:maven-repository-metadata:jar:3.6.3:compile
[INFO] | | - (org.codehaus.plexus:plexus-utils:jar:3.2.1:compile - omitted for duplicate)
[INFO] | +- org.apache.maven:maven-model-builder:jar:3.6.3:compile
[INFO] | | - (org.codehaus.plexus:plexus-utils:jar:3.2.1:compile - omitted for duplicate)
[INFO] | - (org.codehaus.plexus:plexus-utils:jar:3.2.1:compile - omitted for duplicate)
[INFO] +- org.codehaus.plexus:plexus-utils:jar:3.0.24:compile