Uploaded image for project: 'Jenkins Artifactory Plug-in'
  1. Jenkins Artifactory Plug-in
  2. HAP-923

Aether class is not found using the "Deploy artifacts to Artifactory" post-build action

    Details

    • Type: Bug
    • Status: Open
    • Priority: High
    • Resolution: Unresolved
    • Affects Version/s: 2.9.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Disclaimer: I'm not completely sure but maybe this issue is related to HAP-900.

      I had a maven build which ran SUCCESSFULLY but after adding the "Deploy artifacts to Artifactory" post build action, it started to fail with this message

      ...
      [ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.8:features-generate-descriptor (default-features-generate-descriptor) on project openhab-core: Execution default-features-generate-descriptor of goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.8:features-generate-descriptor failed: A required class was missing while executing org.apache.karaf.tooling:karaf-maven-plugin:4.0.8:features-generate-descriptor: org/sonatype/aether/RepositorySystem
      
      ...
      
      [ERROR] Number of foreign imports: 1
      [ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
      [ERROR]
      [ERROR] -----------------------------------------------------: org.sonatype.aether.RepositorySystem
      [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 full debug logging.
      [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/AetherClassNotFound
      ...
      

      Originally I was running maven-plugin:2.15.1 and artifactory:2.9.2 (with latest artifactory plugin version it fails also) but after downgrading to artifactory:2.9.1 the problem didn't expose anymore.

      It seems that the bug was introduced after updating the maven version plugin without taking into account the dependencies changed (see https://www.jfrog.com/jira/browse/HAP-889) in lib-jenkins-maven-embedder.

      If you make a checkout of the plugin (master branch) and then mvn dependency:list | grep aether | sort you will see the mix of aether dependencies

      [INFO]    org.apache.maven:maven-aether-provider:jar:3.1.0:compile
      [INFO]    org.eclipse.aether:aether-api:jar:1.1.0:compile
      [INFO]    org.eclipse.aether:aether-connector-basic:jar:1.1.0:compile
      [INFO]    org.eclipse.aether:aether-impl:jar:1.1.0:compile
      [INFO]    org.eclipse.aether:aether-spi:jar:1.1.0:compile
      [INFO]    org.eclipse.aether:aether-transport-wagon:jar:1.1.0:compile
      [INFO]    org.eclipse.aether:aether-util:jar:1.1.0:compile
      [INFO]    org.sonatype.aether:aether-api:jar:1.13.1:compile
      [INFO]    org.sonatype.aether:aether-impl:jar:1.13.1:compile
      [INFO]    org.sonatype.aether:aether-spi:jar:1.13.1:compile
      [INFO]    org.sonatype.aether:aether-util:jar:1.13.1:compile
      

      To reproduce the issue you need the Maven plugin 2.15.1 and artifactory 2.9.2 and follow the next steps:

      • Create a maven project using the pom.xml copied at the end
      • Run the maven project in Jenkins using a maven job adding an Artifactory post build action

      By the way, these are the workarounds that worked for me:

      • Downgrading the artifactory plugin to 2.9.1
      • Downgrading the maven plugin to 2.14
      • Adding an exclusion in the artifactory pom.xml
      ...
      <dependency>
          <groupId>org.jfrog.buildinfo</groupId>
          <artifactId>build-info-extractor-maven3</artifactId>
          <version>${buildinfo.maven3.version}</version>
          <exclusions>
              <exclusion>
                  <groupId>classworlds</groupId>
                  <artifactId>classworlds</artifactId>
              </exclusion>
              <exclusion>
                  <groupId>org.codehaus.plexus</groupId>
                  <artifactId>*</artifactId>
              </exclusion>
              <exclusion>
                  <groupId>org.sonatype.aether</groupId>
                  <artifactId>*</artifactId>
              </exclusion>
          </exclusions>
      </dependency>
      ...
      

      pom.xml to reproduce the issue

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
      
        <groupId>com.cloudbees</groupId>
        <artifactId>test-karaf-features</artifactId>
        <version>1.0-SNAPSHOT</version>
      
        <packaging>kar</packaging>
      
        <properties>
            <karaf.version>4.0.8</karaf.version>
        </properties>
      
        <build>
            <pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>org.apache.karaf.tooling</groupId>
                        <artifactId>karaf-maven-plugin</artifactId>
                        <version>${karaf.version}</version>
                        <extensions>true</extensions>
                    </plugin>
                </plugins>
            </pluginManagement>
            <plugins>
                  <plugin>
                      <groupId>org.apache.karaf.tooling</groupId>
                      <artifactId>karaf-maven-plugin</artifactId>
                  </plugin>
            </plugins>
        </build>
      
      </project>
      

        Attachments

          Activity

            People

            • Assignee:
              eyalb Eyal Ben Moshe
              Reporter:
              dvilladiego Dario Villadiego
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: