Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-3210

karaf:features-generate-descriptor fails with Maven 3.1.x and 3.2.x : required class was missing ... org/sonatype/aether/RepositorySystem

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.2, 4.0.0.M2, 4.0.0.M3
    • Component/s: karaf
    • Labels:
      None

      Description

      Appears to be a regression that affects the latest 3.0.x and master branches. Note this is subtly different to KARAF-2395 which was an exception due to a missing component whereas this an exception due to a missing/hidden class.

      Switching over to the hasComponent(String) method solves the problem:

      diff --git a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/DependencyHelperFactory.java b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/DependencyHelperFactory.java
      index f054c6c..1287dc8 100644
      --- a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/DependencyHelperFactory.java
      +++ b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/DependencyHelperFactory.java
      @@ -51,12 +51,12 @@ public class DependencyHelperFactory {
            */
           public static DependencyHelper createDependencyHelper(PlexusContainer container, MavenProject mavenProject, MavenSession mavenSession, Log log) throws MojoExecutionException {
               try {
      -            if (container.hasComponent(org.sonatype.aether.RepositorySystem.class)) {
      +            if (container.hasComponent("org.sonatype.aether.RepositorySystem")) {
                       org.sonatype.aether.RepositorySystem system = container.lookup(org.sonatype.aether.RepositorySystem.class);
                       org.sonatype.aether.RepositorySystemSession session = mavenSession.getRepositorySession();
                       List<RemoteRepository> repositories = mavenProject.getRemoteProjectRepositories();
                       return new Dependency30Helper(repositories, session, system);
      -            } else if (container.hasComponent(org.eclipse.aether.RepositorySystem.class)) {
      +            } else if (container.hasComponent("org.eclipse.aether.RepositorySystem")) {
                       org.eclipse.aether.RepositorySystem system = container.lookup(org.eclipse.aether.RepositorySystem.class);
                       Object session;
                       try {
      

        Attachments

          Activity

            People

            • Assignee:
              jbonofre Jean-Baptiste Onofré
              Reporter:
              mcculls Stuart McCulloch
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: