All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.maven.model.Dependency Maven / Gradle / Ivy

Go to download

Statistical sampling library for use in virtdata libraries, based on apache commons math 4

There is a newer version: 5.17.0
Show newest version
/*
 =================== DO NOT EDIT THIS FILE ====================
 Generated by Modello 1.0.1 on 2009-08-06 15:13:09,
 any modifications will be overwritten.
 ==============================================================
 */

package org.apache.maven.model;

/**
 * 
 *         
 *         The <dependency> element contains
 * information about a dependency
 *         of the project.
 *         
 *       
 * 
 * @version $Revision$ $Date$
 */
public class Dependency
    implements java.io.Serializable
{

      //--------------------------/
     //- Class/Member Variables -/
    //--------------------------/

    /**
     * 
     *             
     *             The project group that produced the dependency,
     * e.g.
     *             org.apache.maven.
     *             
     *           
     */
    private String groupId;

    /**
     * 
     *             
     *             The unique id for an artifact produced by the
     * project group, e.g.
     *             maven-artifact.
     *             
     *           
     */
    private String artifactId;

    /**
     * 
     *             
     *             The version of the dependency, e.g.
     * 3.2.1. In Maven 2, this can also be
     *             specified as a range of versions.
     *             
     *           
     */
    private String version;

    /**
     * 
     *             
     *             The type of dependency. This defaults to
     * jar. While it
     *             usually represents the extension on the filename
     * of the dependency,
     *             that is not always the case. A type can be
     * mapped to a different
     *             extension and a classifier.
     *             The type often correspongs to the packaging
     * used, though this is also
     *             not always the case.
     *             Some examples are jar,
     * war, ejb-client
     *             and test-jar.
     *             New types can be defined by plugins that set
     *             extensions to true, so
     * this is not a complete list.
     *             
     *           
     */
    private String type = "jar";

    /**
     * 
     *             
     *             The classifier of the dependency. This allows
     * distinguishing two artifacts
     *             that belong to the same POM but were built
     * differently, and is appended to
     *             the filename after the version. For example,
     * jdk14 and jdk15.
     *             
     *           
     */
    private String classifier;

    /**
     * 
     *             
     *             The scope of the dependency -
     * compile, runtime,
     *             test, system, and
     * provided. Used to
     *             calculate the various classpaths used for
     * compilation, testing, and so on.
     *             It also assists in determining which artifacts
     * to include in a distribution of
     *             this project. For more information, see
     *             the
     *             dependency mechanism.
     *             
     *           
     */
    private String scope;

    /**
     * 
     *             
     *             FOR SYSTEM SCOPE ONLY. Note that use of this
     * property is discouraged
     *             and may be replaced in later versions. This
     * specifies the path on the filesystem
     *             for this dependency.
     *             Requires an absolute path for the value, not
     * relative.
     *             Use a property that gives the machine specific
     * absolute path,
     *             e.g. ${java.home}.
     *             
     *           
     */
    private String systemPath;

    /**
     * Field exclusions.
     */
    private java.util.List exclusions;

    /**
     * Indicates the dependency is optional for use of this
     * library. While the
     *             version of the dependency will be taken into
     * account for dependency calculation if the
     *             library is used elsewhere, it will not be passed
     * on transitively.
     */
    private boolean optional = false;


      //-----------/
     //- Methods -/
    //-----------/

    /**
     * Method addExclusion.
     * 
     * @param exclusion
     */
    public void addExclusion( Exclusion exclusion )
    {
        if ( !(exclusion instanceof Exclusion) )
        {
            throw new ClassCastException( "Dependency.addExclusions(exclusion) parameter must be instanceof " + Exclusion.class.getName() );
        }
        getExclusions().add( exclusion );
    } //-- void addExclusion( Exclusion )

    /**
     * Get the unique id for an artifact produced by the project
     * group, e.g.
     *             maven-artifact.
     * 
     * @return String
     */
    public String getArtifactId()
    {
        return this.artifactId;
    } //-- String getArtifactId()

    /**
     * Get the classifier of the dependency. This allows
     * distinguishing two artifacts
     *             that belong to the same POM but were built
     * differently, and is appended to
     *             the filename after the version. For example,
     * jdk14 and jdk15.
     * 
     * @return String
     */
    public String getClassifier()
    {
        return this.classifier;
    } //-- String getClassifier()

    /**
     * Method getExclusions.
     * 
     * @return List
     */
    public java.util.List getExclusions()
    {
        if ( this.exclusions == null )
        {
            this.exclusions = new java.util.ArrayList();
        }

        return this.exclusions;
    } //-- java.util.List getExclusions()

    /**
     * Get the project group that produced the dependency, e.g.
     *             org.apache.maven.
     * 
     * @return String
     */
    public String getGroupId()
    {
        return this.groupId;
    } //-- String getGroupId()

    /**
     * Get the scope of the dependency - compile,
     * runtime,
     *             test, system, and
     * provided. Used to
     *             calculate the various classpaths used for
     * compilation, testing, and so on.
     *             It also assists in determining which artifacts
     * to include in a distribution of
     *             this project. For more information, see
     *             the
     *             dependency mechanism.
     * 
     * @return String
     */
    public String getScope()
    {
        return this.scope;
    } //-- String getScope()

    /**
     * Get fOR SYSTEM SCOPE ONLY. Note that use of this property is
     * discouraged
     *             and may be replaced in later versions. This
     * specifies the path on the filesystem
     *             for this dependency.
     *             Requires an absolute path for the value, not
     * relative.
     *             Use a property that gives the machine specific
     * absolute path,
     *             e.g. ${java.home}.
     * 
     * @return String
     */
    public String getSystemPath()
    {
        return this.systemPath;
    } //-- String getSystemPath()

    /**
     * Get the type of dependency. This defaults to
     * jar. While it
     *             usually represents the extension on the filename
     * of the dependency,
     *             that is not always the case. A type can be
     * mapped to a different
     *             extension and a classifier.
     *             The type often correspongs to the packaging
     * used, though this is also
     *             not always the case.
     *             Some examples are jar,
     * war, ejb-client
     *             and test-jar.
     *             New types can be defined by plugins that set
     *             extensions to true, so
     * this is not a complete list.
     * 
     * @return String
     */
    public String getType()
    {
        return this.type;
    } //-- String getType()

    /**
     * Get the version of the dependency, e.g. 3.2.1.
     * In Maven 2, this can also be
     *             specified as a range of versions.
     * 
     * @return String
     */
    public String getVersion()
    {
        return this.version;
    } //-- String getVersion()

    /**
     * Get indicates the dependency is optional for use of this
     * library. While the
     *             version of the dependency will be taken into
     * account for dependency calculation if the
     *             library is used elsewhere, it will not be passed
     * on transitively.
     * 
     * @return boolean
     */
    public boolean isOptional()
    {
        return this.optional;
    } //-- boolean isOptional()

    /**
     * Method removeExclusion.
     * 
     * @param exclusion
     */
    public void removeExclusion( Exclusion exclusion )
    {
        if ( !(exclusion instanceof Exclusion) )
        {
            throw new ClassCastException( "Dependency.removeExclusions(exclusion) parameter must be instanceof " + Exclusion.class.getName() );
        }
        getExclusions().remove( exclusion );
    } //-- void removeExclusion( Exclusion )

    /**
     * Set the unique id for an artifact produced by the project
     * group, e.g.
     *             maven-artifact.
     * 
     * @param artifactId
     */
    public void setArtifactId( String artifactId )
    {
        this.artifactId = artifactId;
    } //-- void setArtifactId( String )

    /**
     * Set the classifier of the dependency. This allows
     * distinguishing two artifacts
     *             that belong to the same POM but were built
     * differently, and is appended to
     *             the filename after the version. For example,
     * jdk14 and jdk15.
     * 
     * @param classifier
     */
    public void setClassifier( String classifier )
    {
        this.classifier = classifier;
    } //-- void setClassifier( String )

    /**
     * Set lists a set of artifacts that should be excluded from
     * this dependency's
     *             artifact list when it comes to calculating
     * transitive dependencies.
     * 
     * @param exclusions
     */
    public void setExclusions( java.util.List exclusions )
    {
        this.exclusions = exclusions;
    } //-- void setExclusions( java.util.List )

    /**
     * Set the project group that produced the dependency, e.g.
     *             org.apache.maven.
     * 
     * @param groupId
     */
    public void setGroupId( String groupId )
    {
        this.groupId = groupId;
    } //-- void setGroupId( String )

    /**
     * Set indicates the dependency is optional for use of this
     * library. While the
     *             version of the dependency will be taken into
     * account for dependency calculation if the
     *             library is used elsewhere, it will not be passed
     * on transitively.
     * 
     * @param optional
     */
    public void setOptional( boolean optional )
    {
        this.optional = optional;
    } //-- void setOptional( boolean )

    /**
     * Set the scope of the dependency - compile,
     * runtime,
     *             test, system, and
     * provided. Used to
     *             calculate the various classpaths used for
     * compilation, testing, and so on.
     *             It also assists in determining which artifacts
     * to include in a distribution of
     *             this project. For more information, see
     *             the
     *             dependency mechanism.
     * 
     * @param scope
     */
    public void setScope( String scope )
    {
        this.scope = scope;
    } //-- void setScope( String )

    /**
     * Set fOR SYSTEM SCOPE ONLY. Note that use of this property is
     * discouraged
     *             and may be replaced in later versions. This
     * specifies the path on the filesystem
     *             for this dependency.
     *             Requires an absolute path for the value, not
     * relative.
     *             Use a property that gives the machine specific
     * absolute path,
     *             e.g. ${java.home}.
     * 
     * @param systemPath
     */
    public void setSystemPath( String systemPath )
    {
        this.systemPath = systemPath;
    } //-- void setSystemPath( String )

    /**
     * Set the type of dependency. This defaults to
     * jar. While it
     *             usually represents the extension on the filename
     * of the dependency,
     *             that is not always the case. A type can be
     * mapped to a different
     *             extension and a classifier.
     *             The type often correspongs to the packaging
     * used, though this is also
     *             not always the case.
     *             Some examples are jar,
     * war, ejb-client
     *             and test-jar.
     *             New types can be defined by plugins that set
     *             extensions to true, so
     * this is not a complete list.
     * 
     * @param type
     */
    public void setType( String type )
    {
        this.type = type;
    } //-- void setType( String )

    /**
     * Set the version of the dependency, e.g. 3.2.1.
     * In Maven 2, this can also be
     *             specified as a range of versions.
     * 
     * @param version
     */
    public void setVersion( String version )
    {
        this.version = version;
    } //-- void setVersion( String )


            
    /**
     * @see java.lang.Object#toString()
     */
    public String toString()
    {
        return "Dependency {groupId=" + groupId + ", artifactId=" + artifactId + ", version=" + version + ", type=" + type + "}";
    }
            
          
            
    /**
     * @return the management key as groupId:artifactId:type
     */
    public String getManagementKey()
    {
        return groupId + ":" + artifactId + ":" + type + ( classifier != null ? ":" + classifier : "" );
    }
            
          
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy