Mojo

ability to install/deploy multiple configurations artifact of the same project using classifier

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: native
  • Labels:
    None
  • Environment:
    multi platforms
  • Complexity:
    Intermediate
  • Number of attachments :
    0

Description

Add a new String classifier in linker mojo to provide cabablity to deploy release/debug artifact

Issue Links

Activity

Hide
Dan Tran added a comment -

Does not look like I can do this since maven does not allow to install/deploy primary artifact as classifier ;(

Show
Dan Tran added a comment - Does not look like I can do this since maven does not allow to install/deploy primary artifact as classifier ;(
Hide
Richard van der Hoff added a comment -

This is horrible, but does actually work:

String classifier; /* classifier to assign */

        Artifact artifact = project.getArtifact();

        DefaultArtifact clone = new DefaultArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersionRange().cloneOf(),
                artifact.getScope(), artifact.getType(), classifier,
                artifact.getArtifactHandler(), artifact.isOptional() );
        clone.setRelease( artifact.isRelease() );
        clone.setResolvedVersion( artifact.getVersion() );
        clone.setResolved( artifact.isResolved() );
        clone.setFile( artifact.getFile() );

        if(artifact.getAvailableVersions()!=null)
            clone.setAvailableVersions( new ArrayList(artifact.getAvailableVersions() ) );
        clone.setBaseVersion( artifact.getBaseVersion() );
        clone.setDependencyFilter( artifact.getDependencyFilter() );
        if(artifact.getDependencyTrail()!=null)
            clone.setDependencyTrail( new ArrayList(artifact.getDependencyTrail()) );
        clone.setDownloadUrl( artifact.getDownloadUrl() );
        clone.setRepository( artifact.getRepository() );

        project.setArtifact(clone);
Show
Richard van der Hoff added a comment - This is horrible, but does actually work:
String classifier; /* classifier to assign */

        Artifact artifact = project.getArtifact();

        DefaultArtifact clone = new DefaultArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersionRange().cloneOf(),
                artifact.getScope(), artifact.getType(), classifier,
                artifact.getArtifactHandler(), artifact.isOptional() );
        clone.setRelease( artifact.isRelease() );
        clone.setResolvedVersion( artifact.getVersion() );
        clone.setResolved( artifact.isResolved() );
        clone.setFile( artifact.getFile() );

        if(artifact.getAvailableVersions()!=null)
            clone.setAvailableVersions( new ArrayList(artifact.getAvailableVersions() ) );
        clone.setBaseVersion( artifact.getBaseVersion() );
        clone.setDependencyFilter( artifact.getDependencyFilter() );
        if(artifact.getDependencyTrail()!=null)
            clone.setDependencyTrail( new ArrayList(artifact.getDependencyTrail()) );
        clone.setDownloadUrl( artifact.getDownloadUrl() );
        clone.setRepository( artifact.getRepository() );

        project.setArtifact(clone);
Hide
Dan Tran added a comment -

fixed at rev 5852.

Show
Dan Tran added a comment - fixed at rev 5852.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: