|
Forge - Parent 1.4.2-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.forge.project.facets.BaseFacet
org.jboss.forge.maven.facets.MavenDependencyFacet
@Dependent @Alias(value="forge.maven.MavenDependencyFacet") @RequiresFacet(value=MavenCoreFacet.class) public class MavenDependencyFacet
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.jboss.forge.project.facets.DependencyFacet |
---|
DependencyFacet.KnownRepository |
Field Summary |
---|
Fields inherited from class org.jboss.forge.project.facets.BaseFacet |
---|
project |
Constructor Summary | |
---|---|
MavenDependencyFacet(DependencyResolver resolver,
EventBus bus)
|
Method Summary | |
---|---|
void |
addDirectDependency(Dependency dep)
Add the given Dependency to this Project 's immediate list of dependencies. |
void |
addDirectManagedDependency(Dependency dep)
Add the given managed Dependency to this Project 's immediate list of managed dependencies. |
void |
addManagedDependency(Dependency manDep)
Add the given managed Dependency to this Project 's immediate list of managed dependencies. |
void |
addRepository(DependencyFacet.KnownRepository repository)
Add a DependencyFacet.KnownRepository to the project build system. |
void |
addRepository(String name,
String url)
Add a repository to the project build system. |
List<Dependency> |
getDependencies()
Return an immutable list of all direct Dependencies contained within this project. |
List<Dependency> |
getDependenciesInScopes(ScopeType... scopes)
Get a list of this Project 's dependencies of the given ScopeType .. |
Dependency |
getDirectDependency(Dependency dependency)
Attempt to locate the given Dependency , if it exists in the Project direct dependency list, and
return it. |
List<Dependency> |
getEffectiveDependencies()
Return an immutable list of all Dependencies contained anywhere within this project's dependency
hierarchy. |
List<Dependency> |
getEffectiveDependenciesInScopes(ScopeType... scopes)
Get a list of this Project 's dependencies of the given ScopeType , from anywhere in the dependency
hierarchy. |
Dependency |
getEffectiveDependency(Dependency manDep)
Attempt to locate the given Dependency , if it exists anywhere in the Project dependency hierarchy,
and return it. |
Dependency |
getEffectiveManagedDependency(Dependency manDep)
Searches Project and returns a managed dependency matching the given Dependency at any level of
the project hierarchy; return null otherwise. |
List<Dependency> |
getManagedDependencies()
Return an immutable list of all direct managed Dependencies contained within this project. |
Dependency |
getManagedDependency(Dependency manDep)
Attempt to locate the given managed Dependency , if it exists in the Project , and return it. |
Map<String,String> |
getProperties()
Return a list of all build dependency properties.(Build properties such, as ${my.version}, can be used anywhere in a dependency, and will be expanded during building to their property value.) |
String |
getProperty(String name)
Get a build property by name. |
List<DependencyRepository> |
getRepositories()
Get the list of repositories for which this project is currently configured to use in dependency resolution. |
boolean |
hasDirectDependency(Dependency dependency)
Return true if this Project contains a dependency matching the given Dependency ; return false
otherwise. |
boolean |
hasDirectManagedDependency(Dependency managedDependency)
Return true if this Project contains a managed dependency matching the given Dependency ; return
false otherwise. |
boolean |
hasEffectiveDependency(Dependency dependency)
Return true if the given Dependency exists anywhere in the project dependency hierarchy. |
boolean |
hasEffectiveManagedDependency(Dependency manDep)
Return true if this Project contains a managed dependency matching the given Dependency at any
level of the project hierarchy; return false otherwise. |
boolean |
hasRepository(DependencyFacet.KnownRepository repository)
Return true if the given DependencyFacet.KnownRepository is already registered in this project's build system. |
boolean |
hasRepository(String url)
Return true if the given repository URL is already registered in this project's build system. |
boolean |
install()
Perform necessary setup for this Facet to be considered installed in the given Project . |
boolean |
isInstalled()
Return true if the Facet is available for the given Project , false if otherwise. |
void |
removeDependency(Dependency dep)
Remove the given Dependency from this facet's Project . |
void |
removeManagedDependency(Dependency manDep)
Remove the given managed Dependency from this facet's Project . |
String |
removeProperty(String name)
Remove a build property by name. |
DependencyRepository |
removeRepository(String url)
Remove the given DependencyRepository from the current project. |
List<Dependency> |
resolveAvailableVersions(Dependency dep)
Given a Dependency with a populated groupId, versionId, and version range, identify the available
artifacts in all known repositories for this project. |
List<Dependency> |
resolveAvailableVersions(DependencyQuery query)
Using the given DependencyQuery , identify and resolve all matching Dependency results in
configured DependencyRepository instances for this Project . |
List<Dependency> |
resolveAvailableVersions(String gavs)
Given a groupid:versionid:version-range, identify and resolve all matching artifacts in all known DependencyRepository instances for this Project . |
Dependency |
resolveProperties(Dependency dependency)
Resolve properties in the given dependency, converting them to their actual values. |
void |
setProperty(String name,
String value)
Set a build dependency property. |
Methods inherited from class org.jboss.forge.project.facets.BaseFacet |
---|
equals, getProject, hashCode, setProject, uninstall |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jboss.forge.project.Facet |
---|
getProject, setProject, uninstall |
Constructor Detail |
---|
@Inject public MavenDependencyFacet(DependencyResolver resolver, EventBus bus)
Method Detail |
---|
public boolean isInstalled()
Facet
Facet
is available for the given Project
, false if otherwise.
isInstalled
in interface Facet
public boolean install()
Facet
Facet
to be considered installed in the given Project
. This
method should NOT register the facet; facet registration is handled by the project if installation is successful.
install
in interface Facet
public void addDirectDependency(Dependency dep)
DependencyFacet
Dependency
to this Project
's immediate list of dependencies. This method does not
check for existence of dependencies in the hierarchy, instead, directly adds or replaces a direct dependency.
See also: DependencyBuilder
.
addDirectDependency
in interface DependencyFacet
public boolean hasDirectDependency(Dependency dependency)
DependencyFacet
Project
contains a dependency matching the given Dependency
; return false
otherwise. This method ignores Dependency.getScopeType()
See also: DependencyBuilder
.
Notice: This method checks only the immediate project dependencies, meaning that if a dependency is
declared somewhere else in the hierarchy, it will not be detected by this method, even though by
#hasDependency(Dependency)
may return true.
hasDirectDependency
in interface DependencyFacet
public void removeDependency(Dependency dep)
DependencyFacet
Dependency
from this facet's Project
. This method ignores
Dependency.getScopeType()
See also: DependencyBuilder
.
Notice: This method operates only the immediate project dependencies, meaning that if a dependency is
declared somewhere else in the hierarchy, it will not be removable by this method. You should call
DependencyFacet.hasDirectDependency(Dependency)
first in order to check if the dependency exists in this projects
immediate dependencies.
removeDependency
in interface DependencyFacet
public List<Dependency> getDependencies()
DependencyFacet
Dependencies
contained within this project. (i.e.: all dependencies
for which DependencyFacet.hasDirectDependency(Dependency)
returns true;
getDependencies
in interface DependencyFacet
public Dependency getDirectDependency(Dependency dependency)
DependencyFacet
Dependency
, if it exists in the Project
direct dependency list, and
return it.
See also: DependencyBuilder
. See also: DependencyFacet.hasDirectDependency(Dependency)
. #hasDependency(Dependency)
may return true.
getDirectDependency
in interface DependencyFacet
public boolean hasEffectiveDependency(Dependency dependency)
DependencyFacet
Dependency
exists anywhere in the project dependency hierarchy. See also:
DependencyBuilder
. See also: DependencyFacet.getEffectiveDependency(Dependency)
.
hasEffectiveDependency
in interface DependencyFacet
public Dependency getEffectiveDependency(Dependency manDep)
DependencyFacet
Dependency
, if it exists anywhere in the Project
dependency hierarchy,
and return it.
See also: DependencyBuilder
. See also: DependencyFacet.hasEffectiveDependency(Dependency)
.
getEffectiveDependency
in interface DependencyFacet
public List<Dependency> getEffectiveDependencies()
DependencyFacet
Dependencies
contained anywhere within this project's dependency
hierarchy. (i.e.: all dependencies for which DependencyFacet.hasEffectiveDependency(Dependency)
returns
true;
getEffectiveDependencies
in interface DependencyFacet
public void addManagedDependency(Dependency manDep)
DependencyFacet
Dependency
to this Project
's immediate list of managed dependencies. This
method first calls DependencyFacet.hasEffectiveManagedDependency(Dependency)
before making changes to the managed
dependency list.
See also: DependencyBuilder
.
addManagedDependency
in interface DependencyFacet
public void addDirectManagedDependency(Dependency dep)
DependencyFacet
Dependency
to this Project
's immediate list of managed dependencies. This
method does not check for existence of managed dependencies in the hierarchy, instead, directly adds or replaces a
direct managed dependency.
See also: DependencyBuilder
.
addDirectManagedDependency
in interface DependencyFacet
public boolean hasEffectiveManagedDependency(Dependency manDep)
DependencyFacet
Project
contains a managed dependency matching the given Dependency
at any
level of the project hierarchy; return false otherwise. This method ignores Dependency.getScopeType()
See also: DependencyBuilder
.
Notice: This method checks the entire project managed dependency structure, meaning that if a managed
dependency is declared somewhere else in the hierarchy, it will not be detected by
#hasManagedDependency(Dependency)
and will not be removable via
DependencyFacet.removeManagedDependency(Dependency)
.
hasEffectiveManagedDependency
in interface DependencyFacet
public Dependency getEffectiveManagedDependency(Dependency manDep)
DependencyFacet
Project
and returns a managed dependency matching the given Dependency
at any level of
the project hierarchy; return null otherwise. This method ignores Dependency.getScopeType()
See also: DependencyBuilder
.
Notice: This method checks the entire project managed dependency structure, meaning that if a managed
dependency is declared somewhere else in the hierarchy, it will not be detected by
DependencyFacet.getManagedDependency(Dependency)
and will not be removable via
DependencyFacet.removeManagedDependency(Dependency)
.
getEffectiveManagedDependency
in interface DependencyFacet
public boolean hasDirectManagedDependency(Dependency managedDependency)
DependencyFacet
Project
contains a managed dependency matching the given Dependency
; return
false otherwise. This method ignores Dependency.getScopeType()
See also: DependencyBuilder
.
Notice: This method checks only the immediate project managed dependencies, meaning that if a managed
dependency is declared somewhere else in the hierarchy, it will not be detected by this method, even though
DependencyFacet.hasEffectiveManagedDependency(Dependency)
may return true.
hasDirectManagedDependency
in interface DependencyFacet
public void removeManagedDependency(Dependency manDep)
DependencyFacet
Dependency
from this facet's Project
. This method ignores
Dependency.getScopeType()
See also: DependencyBuilder
.
Notice: This method operates only the immediate project managed dependencies, meaning that if a managed
dependency is declared somewhere else in the hierarchy, it will not be removable by this method. You should call
#hasManagedDependency(Dependency)
first in order to check if the managed dependency exists in this
projects immediate managed dependencies.
removeManagedDependency
in interface DependencyFacet
public List<Dependency> getManagedDependencies()
DependencyFacet
Dependencies
contained within this project. (i.e.: all
managed dependencies for which ManagedDependencyFacet#hasManagedDependency(Dependency)
returns true;
getManagedDependencies
in interface DependencyFacet
public Dependency getManagedDependency(Dependency manDep)
DependencyFacet
Dependency
, if it exists in the Project
, and return it.
See also: DependencyBuilder
. See also: DependencyFacet.hasEffectiveManagedDependency(Dependency)
.
getManagedDependency
in interface DependencyFacet
public Map<String,String> getProperties()
DependencyFacet
getProperties
in interface DependencyFacet
public void setProperty(String name, String value)
DependencyFacet
setProperty
in interface DependencyFacet
public String getProperty(String name)
DependencyFacet
getProperty
in interface DependencyFacet
public Dependency resolveProperties(Dependency dependency)
DependencyFacet
resolveProperties
in interface DependencyFacet
public String removeProperty(String name)
DependencyFacet
removeProperty
in interface DependencyFacet
public List<Dependency> resolveAvailableVersions(String gavs)
DependencyFacet
DependencyRepository
instances for this Project
. By default, SNAPSHOT versions are excluded. For
example:
dependencyFacet.resolveAvailableVersions("org.jboss.forge:example:[1.0.0,]");
dependencyFacet.resolveAvailableVersions("org.jboss.forge:example:[1.0.0,)");
dependencyFacet.resolveAvailableVersions("org.jboss.forge:example:(1.0.0,3.0.0]");
dependencyFacet.resolveAvailableVersions("org.jboss.forge:example:[1.0.0,3.0.0]");
For more comprehensive resolution features, see DependencyFacet.resolveAvailableVersions(DependencyQuery)
or
DependencyResolver
resolveAvailableVersions
in interface DependencyFacet
public List<Dependency> resolveAvailableVersions(Dependency dep)
DependencyFacet
Dependency
with a populated groupId, versionId, and version range, identify the available
artifacts in all known repositories for this project. By default, SNAPSHOT versions are excluded.
See DependencyFacet.resolveAvailableVersions(String)
. For more comprehensive resolution features, see
DependencyResolver
resolveAvailableVersions
in interface DependencyFacet
public List<Dependency> resolveAvailableVersions(DependencyQuery query)
DependencyFacet
DependencyQuery
, identify and resolve all matching Dependency
results in
configured DependencyRepository
instances for this Project
. See also,
DependencyFacet.resolveAvailableVersions(String)
and DependencyFacet.resolveAvailableVersions(Dependency)
resolveAvailableVersions
in interface DependencyFacet
public void addRepository(String name, String url)
DependencyFacet
addRepository
in interface DependencyFacet
public void addRepository(DependencyFacet.KnownRepository repository)
DependencyFacet
DependencyFacet.KnownRepository
to the project build system. This is where dependencies can be found, downloaded,
and installed to the project build script.
addRepository
in interface DependencyFacet
public List<DependencyRepository> getRepositories()
DependencyFacet
getRepositories
in interface DependencyFacet
public boolean hasRepository(String url)
DependencyFacet
hasRepository
in interface DependencyFacet
public boolean hasRepository(DependencyFacet.KnownRepository repository)
DependencyFacet
DependencyFacet.KnownRepository
is already registered in this project's build system.
hasRepository
in interface DependencyFacet
public DependencyRepository removeRepository(String url)
DependencyFacet
DependencyRepository
from the current project. Return true if the repository was removed;
return false otherwise. Return the removed repository, or null if no repository was removed.
removeRepository
in interface DependencyFacet
public List<Dependency> getDependenciesInScopes(ScopeType... scopes)
DependencyFacet
Project
's dependencies of the given ScopeType
.. See also:
DependencyBuilder
. See also: #getDependency(Dependency)
.
getDependenciesInScopes
in interface DependencyFacet
public List<Dependency> getEffectiveDependenciesInScopes(ScopeType... scopes)
DependencyFacet
Project
's dependencies of the given ScopeType
, from anywhere in the dependency
hierarchy. See also: DependencyBuilder
. See also: DependencyFacet.getEffectiveDependency(Dependency)
.
getEffectiveDependenciesInScopes
in interface DependencyFacet
|
Forge - Parent 1.4.2-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |