Class DefaultDependableCoordinate

java.lang.Object
org.apache.maven.shared.transfer.dependencies.DefaultDependableCoordinate
All Implemented Interfaces:
DependableCoordinate

public class DefaultDependableCoordinate extends Object implements DependableCoordinate
Common usage of an DependableCoordinate for a Mojo
 @Parameter
 private DefaultDependableCoordinate[] dependencies;
 
and
 private DefaultDependableCoordinate dependable = new DefaultDependableCoordinate();
 
 @Parameter( property = "groupId" )
 private String groupId;
 
 @Parameter( property = "artifactId" )
 private String artifactId;
 
 @Parameter( property = "version" )
 private String version;
 
 @Parameter( property = "classifier" )
 private String classifier;
 
 @Parameter( property = "type" )
 private String type;
 
 public void setGroupId( String groupId )
 {
   this.dependable.setGroupId( groupId );
 }
 
 public void setArtifactId( String artifactId )
 {
   this.dependable.setArtifactId( artifactId );
 }
 
 public void setVersion( String version )
 {
   this.dependable.setVersion( version );
 }
 
 public void setClassifier( String classifier )
 {
   this.dependable.setClassifier( classifier );
 }
 
 public void setType( String type )
 {
   this.dependable.setType( type );
 }
 
Note: type is not the same as extension! ArtifactHandlers are used to map a type to an extension.
Since:
3.0
Author:
Robert Scholte
  • Constructor Details

    • DefaultDependableCoordinate

      public DefaultDependableCoordinate()
  • Method Details

    • getGroupId

      public final String getGroupId()
      Specified by:
      getGroupId in interface DependableCoordinate
      Returns:
      the groupId of the coordinate
    • setGroupId

      public final void setGroupId(String groupId)
      Parameters:
      groupId - The groupId to be set.
    • getArtifactId

      public final String getArtifactId()
      Specified by:
      getArtifactId in interface DependableCoordinate
      Returns:
      the artifact of the coordinate
    • setArtifactId

      public final void setArtifactId(String artifactId)
      Parameters:
      artifactId - The artifactId to be set.
    • getVersion

      public final String getVersion()
      Description copied from interface: DependableCoordinate
      A version or versionRange
      Specified by:
      getVersion in interface DependableCoordinate
      Returns:
      the version
    • setVersion

      public final void setVersion(String version)
      Parameters:
      version - The version to be set.
    • getType

      public final String getType()
      Specified by:
      getType in interface DependableCoordinate
      Returns:
      the type of the coordinate
    • setType

      public void setType(String type)
      Parameters:
      type - The type to be set.
    • getClassifier

      public final String getClassifier()
      Specified by:
      getClassifier in interface DependableCoordinate
      Returns:
      the classifier or null
    • setClassifier

      public final void setClassifier(String classifier)
      Parameters:
      classifier - The classifier to be set.
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also:
      • DefaultArtifact.toString()