|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.dna.maven.MavenDependency
public class MavenDependency
The cornerstone of Maven is its dependency list. Most every project depends upon others to build and run correctly, and if all Maven does for you is manage this list for you, you have gained a lot. Maven downloads and links the dependencies for you on compilation and other goals that require them. As an added bonus, Maven brings in the dependencies of those dependencies (transitive dependencies), allowing your list to focus solely on the dependencies your project requires.
Nested Class Summary | |
---|---|
static class |
MavenDependency.Scope
The scope of the dependency - compile , runtime , test , system ,
and provided . |
Field Summary | |
---|---|
static boolean |
DEFAULT_OPTIONAL
|
static String |
DEFAULT_TYPE
|
Constructor Summary | |
---|---|
MavenDependency(MavenId id)
|
|
MavenDependency(String coordinates)
|
|
MavenDependency(String groupId,
String artifactId,
String version)
|
|
MavenDependency(String groupId,
String artifactId,
String version,
String classifier)
|
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
Set<MavenId> |
getExclusions()
Exclusions explicitly tell Maven that you don't want to include the specified project that is a dependency of this dependency (in other words, its transitive dependency). |
MavenId |
getId()
The identifier of the artifact for this dependency. |
MavenDependency.Scope |
getScope()
The scope of the dependency - compile , runtime , test , system ,
and provided . |
String |
getSystemPath()
FOR SYSTEM SCOPE ONLY. |
String |
getType()
The type of dependency. |
int |
hashCode()
|
boolean |
isOptional()
Indicates the dependency is optional for use of this library. |
void |
setOptional(boolean optional)
|
void |
setScope(MavenDependency.Scope scope)
|
void |
setScope(String text)
|
void |
setSystemPath(String systemPath)
|
void |
setType(String type)
Set the type of dependency. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_TYPE
public static final boolean DEFAULT_OPTIONAL
Constructor Detail |
---|
public MavenDependency(String coordinates)
public MavenDependency(MavenId id)
public MavenDependency(String groupId, String artifactId, String version)
public MavenDependency(String groupId, String artifactId, String version, String classifier)
Method Detail |
---|
public MavenId getId()
public String getType()
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.
public void setType(String type)
type
- the new dependency type. If null, then the type will be set to the
default dependency type
.public MavenDependency.Scope getScope()
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.
public void setScope(MavenDependency.Scope scope)
scope
- Sets scope to the specified value.public void setScope(String text)
public String getSystemPath()
${java.home}
.
public void setSystemPath(String systemPath)
systemPath
- Sets systemPath to the specified value.public boolean isOptional()
public void setOptional(boolean optional)
optional
- Sets optional to the specified value.public Set<MavenId> getExclusions()
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |