Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-4718

[regression] Missing Class in 3.0-beta-1: org.apache.maven.project.artifact.AttachedArtifact

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0-beta-1
    • 3.0-beta-2
    • None

    Description

      I have a custom plugin that I wrote to support WebSphere Message Broker BAR files.
      It works fine under 2.0.9, 2.0.11 and 2.2.1. I tried it under 3.0-beta-1 and got:

              at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:129)
              ... 20 more
      Caused by: java.lang.NoClassDefFoundError: org.apache.maven.project.artifact.AttachedArtifact
              at com.ibm.issw.maven.plugins.messagebroker.AbstractMessageBrokerMojo.addAttachedArtifact(AbstractMessageBrokerMojo.java:48)
              at com.ibm.issw.maven.plugins.messagebroker.GenerateDeploymentPackages.generateDeploymentPackages(GenerateDeploymentPackages.java:204)
              at com.ibm.issw.maven.plugins.messagebroker.GenerateDeploymentPackages.execute(GenerateDeploymentPackages.java:62)
              at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:105)
              ... 20 more

      The code that is calling it is:

          /**
           * Add an additional file artefact to the Maven project.
           * @param artefactFile The file to add.
           * @param classifier A classifier.
           * @param extension The file type extension.
           */
          protected void addAttachedArtifact(String artefactFile, String classifier, final String extension)
          {
              Artifact artifact = new AttachedArtifact(project.getArtifact(), project.getPackaging(), classifier, new DefaultArtifactHandler()
              {
                  public String getExtension()
                  {
                      return extension;
                  }
              });
              artifact.setFile(new File(artefactFile));
              artifact.setResolved(true);
              project.addAttachedArtifact(artifact);
          }

      It's failing on the first line of the method (new AttachedArtifact()...).

      Attachments

        1. build.log
          285 kB
          Chris Graham

        Activity

          People

            bentmann Benjamin Bentmann
            chrisgwarp Chris Graham
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: