Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 3.0-beta-1
-
Fix Version/s: 3.0-beta-2
-
Component/s: Artifacts and Repositories
-
Labels:None
-
Environment:HideC:\>mvn --version
Apache Maven 3.0-beta-1 (r935667; 2010-04-20 03:00:39+1000)
Java version: 1.5.0
Java home: C:\SCT\Programs\SDP70\jdk\jre
Default locale: en_AU, platform encoding: Cp1252
OS name: "windows xp" version: "5.1 build 2600 service pack 3" arch: "x86" Family: "dos"
ShowC:\>mvn --version Apache Maven 3.0-beta-1 (r935667; 2010-04-20 03:00:39+1000) Java version: 1.5.0 Java home: C:\SCT\Programs\SDP70\jdk\jre Default locale: en_AU, platform encoding: Cp1252 OS name: "windows xp" version: "5.1 build 2600 service pack 3" arch: "x86" Family: "dos"
-
Complexity:Intermediate
-
Number of attachments :
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()...).