Support for classifier Deployable only works for dependencies, but not for the project itself

Description

With Issue CARGO-442, support for classifiers has been added for Deployable. However, the current implemtation does not consider, that the project itself may produce artifact(s) with qualifiers.
Example: A project with ear packaging may produce (depending on profiles) ears with qualifiers "-jboss" or "-weblogic".

The code in Deployable currently assumes, that for the project itself, there is only an artifact produced and this is without a qualifier:

protected String computeLocation(CargoProject project) throws MojoExecutionException
{
String location;

// If the groupId and artifactId match those of the project then we consider that the
// deployable is the artifact generated by the project. We also check that the defined
// Cargo type matches Maven's defined packaging. If it doesn't we look for the deployable
// in the project's dependency list.
if (project.getGroupId().equals(getGroupId())
&& project.getArtifactId().equals(getArtifactId())
&& isTypeCompatible(project))
{
// Compute default location.
location = new File(project.getBuildDirectory(), project.getFinalName() + "."
+ computeExtension(project.getPackaging())).getPath();
}

This should be changed and also take qualifier into account. (for instance, by simply appending it to the final name)
0

Status

Assignee

Matt Wringe

Reporter

Stefan Ocke

Components

Fix versions

Affects versions

1.0

Priority

Minor