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

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

There is a newer version: 4.1.2
Show newest version
// =================== DO NOT EDIT THIS FILE ====================
// Generated by Modello 1.9.1,
// any modifications will be overwritten.
// ==============================================================

package shaded.shaded.org.apache.maven.model;

/**
 * 
 *         
 *         The <dependency> element contains
 * information about a dependency
 *         of the project.
 *         
 *       
 * 
 * @version $Revision$ $Date$
 */
@SuppressWarnings( "all" )
public class Dependency
    implements java.io.Serializable, java.lang.Cloneable, shaded.shaded.org.apache.maven.model.InputLocationTracker
{

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

    /**
     * 
     *             
     *             The project group that produced the dependency,
     * e.g.
     *             shaded.shaded.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. 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 corresponds to the packaging
     * used, though this is also
     *             not always the case.
     *             Some examples are jar,
     * war, ejb-client
     *             and test-jar: see default
     *             artifact handlers for a list.
     *             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. It is appended
     * to
     *             the filename after the version. This allows:
     *             
    *
  • referring to attached artifact, for example * sources and javadoc: * see default artifact * handlers for a list,
  • *
  • distinguishing two artifacts * that belong to the same POM but were built * differently. * 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. The default scope is * compile. * * */ 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. Note: While the type * of this field is String for * technical reasons, the semantic type is actually * Boolean. Default value is * false. * * */ private String optional; /** * Field locations. */ private java.util.Map locations; //-----------/ //- Methods -/ //-----------/ /** * Method addExclusion. * * @param exclusion */ public void addExclusion( Exclusion exclusion ) { getExclusions().add( exclusion ); } //-- void addExclusion( Exclusion ) /** * Method clone. * * @return Dependency */ public Dependency clone() { try { Dependency copy = (Dependency) super.clone(); if ( this.exclusions != null ) { copy.exclusions = new java.util.ArrayList(); for ( Exclusion item : this.exclusions ) { copy.exclusions.add( ( (Exclusion) item).clone() ); } } if ( copy.locations != null ) { copy.locations = new java.util.LinkedHashMap( copy.locations ); } return copy; } catch ( java.lang.Exception ex ) { throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName() + " does not support clone()" ).initCause( ex ); } } //-- Dependency clone() /** * 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. It is appended to * the filename after the version. This allows: *
    *
  • referring to attached artifact, for example * sources and javadoc: * see default artifact * handlers for a list,
  • *
  • distinguishing two artifacts * that belong to the same POM but were built * differently. * 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. * shaded.shaded.org.apache.maven. * * @return String */ public String getGroupId() { return this.groupId; } //-- String getGroupId() /** * * * @param key * @return InputLocation */ public InputLocation getLocation( Object key ) { return ( locations != null ) ? locations.get( key ) : null; } //-- InputLocation getLocation( Object ) /** * 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. Note: While the type * of this field is String for * technical reasons, the semantic type is actually * Boolean. Default value is * false. * * @return String */ public String getOptional() { return this.optional; } //-- String getOptional() /** * 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. The default scope is * compile. * * @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. 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 corresponds to the packaging * used, though this is also * not always the case. * Some examples are jar, * war, ejb-client * and test-jar: see default * artifact handlers for a list. * 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() /** * Method removeExclusion. * * @param exclusion */ public void removeExclusion( Exclusion exclusion ) { 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. It is appended to * the filename after the version. This allows: *
    *
  • referring to attached artifact, for example * sources and javadoc: * see default artifact * handlers for a list,
  • *
  • distinguishing two artifacts * that belong to the same POM but were built * differently. * 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. * shaded.shaded.org.apache.maven. * * @param groupId */ public void setGroupId( String groupId ) { this.groupId = groupId; } //-- void setGroupId( String ) /** * * * @param key * @param location */ public void setLocation( Object key, InputLocation location ) { if ( location != null ) { if ( this.locations == null ) { this.locations = new java.util.LinkedHashMap(); } this.locations.put( key, location ); } } //-- void setLocation( Object, InputLocation ) /** * 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. Note: While the type * of this field is String for * technical reasons, the semantic type is actually * Boolean. Default value is * false. * * @param optional */ public void setOptional( String optional ) { this.optional = optional; } //-- void setOptional( String ) /** * 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. The default scope is * compile. * * @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. 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 corresponds to the packaging * used, though this is also * not always the case. * Some examples are jar, * war, ejb-client * and test-jar: see default * artifact handlers for a list. * 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 ) public boolean isOptional() { return ( optional != null ) ? Boolean.parseBoolean( optional ) : false; } public void setOptional( boolean optional ) { this.optional = String.valueOf( optional ); } /** * @see java.lang.Object#toString() */ public String toString() { return "Dependency {groupId=" + groupId + ", artifactId=" + artifactId + ", version=" + version + ", type=" + type + "}"; } private String managementKey; /** * @return the management key as groupId:artifactId:type */ public String getManagementKey() { if ( managementKey == null ) { managementKey = groupId + ":" + artifactId + ":" + type + ( classifier != null ? ":" + classifier : "" ); } return managementKey; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy