public interface DependencyFacet extends ProvidedProjectFacet
Modifier and Type | Method and Description |
---|---|
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 managedDependency)
Add the given managed
Dependency to this Project 's immediate list of managed dependencies. |
void |
addRepository(String name,
String url)
Add a repository to the project build system.
|
List<Dependency> |
getDependencies()
Return an immutable list of all direct
DependencyNodeUtil contained within this project. |
List<Dependency> |
getDependenciesInScopes(String... scopes)
Get a list of this
Project 's dependencies of the given scopes.. |
Dependency |
getDirectDependency(Dependency dependency)
Attempt to locate the given
Dependency , if it exists in the Project direct dependency list, and
return it. |
Dependency |
getDirectManagedDependency(Dependency managedDependency)
Attempt to locate the given managed
Dependency , if it exists in the Project , and return it. |
List<Dependency> |
getEffectiveDependencies()
Return an immutable list of all
DependencyNodeUtil contained anywhere within this project's dependency
hierarchy. |
List<Dependency> |
getEffectiveDependenciesInScopes(String... scopes)
Get a list of this
Project 's dependencies of the given scopes, from anywhere in the dependency hierarchy. |
Dependency |
getEffectiveDependency(Dependency dependency)
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
DependencyNodeUtil contained within this project. |
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 managedDependency)
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(String url)
Return true if the given repository URL is already registered in this project's build system.
|
void |
removeDependency(Dependency dependency)
Remove the given
Dependency from this facet's Project . |
void |
removeManagedDependency(Dependency managedDependency)
Remove the given managed
Dependency from this facet's Project . |
DependencyRepository |
removeRepository(String url)
Remove the given
DependencyRepository from the current project. |
List<Coordinate> |
resolveAvailableVersions(Dependency dep)
Given a
Dependency with a populated groupId, versionId, and version range, identify the available
Coordinate in all known repositories for this project. |
List<Coordinate> |
resolveAvailableVersions(DependencyQuery query)
Using the given
DependencyQuery , identify and resolve all matching Coordinate results in
configured DependencyRepository instances for this Project . |
List<Coordinate> |
resolveAvailableVersions(String gavs)
Given a groupid:versionid:version-range, identify and resolve all matching
Coordinate in all known
DependencyRepository instances for this Project . |
Dependency |
resolveProperties(Dependency dependency)
Resolve properties in the given dependency, converting them to their actual values.
|
getFaceted, install, isInstalled, uninstall
void addDirectDependency(Dependency dep)
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
.void addManagedDependency(Dependency managedDependency)
Dependency
to this Project
's immediate list of managed dependencies. This
method first calls hasEffectiveManagedDependency(Dependency)
before making changes to the managed
dependency list.
See also: DependencyBuilder
.void addDirectManagedDependency(Dependency dep)
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
.void addRepository(String name, String url)
List<Dependency> getDependencies()
DependencyNodeUtil
contained within this project. (i.e.: all
dependencies for which hasDirectDependency(Dependency)
returns true;List<Dependency> getDependenciesInScopes(String... scopes)
Project
's dependencies of the given scopes.. See also: DependencyBuilder
. See
also: #getDependency(Dependency)
.Dependency getDirectDependency(Dependency dependency)
Dependency
, if it exists in the Project
direct dependency list, and
return it.
See also: DependencyBuilder
. See also: hasDirectDependency(Dependency)
. #hasDependency(Dependency)
may return true.List<Dependency> getEffectiveDependencies()
DependencyNodeUtil
contained anywhere within this project's dependency
hierarchy. (i.e.: all dependencies for which hasEffectiveDependency(Dependency)
returns
true;List<Dependency> getEffectiveDependenciesInScopes(String... scopes)
Project
's dependencies of the given scopes, from anywhere in the dependency hierarchy.
See also: DependencyBuilder
. See also: getEffectiveDependency(Dependency)
.Dependency getEffectiveDependency(Dependency dependency)
Dependency
, if it exists anywhere in the Project
dependency hierarchy,
and return it.
See also: DependencyBuilder
. See also: hasEffectiveDependency(Dependency)
.Dependency getEffectiveManagedDependency(Dependency manDep)
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
getDirectManagedDependency(Dependency)
and will not be removable via
removeManagedDependency(Dependency)
.List<Dependency> getManagedDependencies()
DependencyNodeUtil
contained within this project. (i.e.:
all managed dependencies for which ManagedDependencyFacet#hasManagedDependency(Dependency)
returns true;Dependency getDirectManagedDependency(Dependency managedDependency)
Dependency
, if it exists in the Project
, and return it.
See also: DependencyBuilder
. See also: hasEffectiveManagedDependency(Dependency)
.List<DependencyRepository> getRepositories()
boolean hasDirectDependency(Dependency dependency)
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.boolean hasEffectiveDependency(Dependency dependency)
Dependency
exists anywhere in the project dependency hierarchy. See also:
DependencyBuilder
. See also: getEffectiveDependency(Dependency)
.boolean hasEffectiveManagedDependency(Dependency managedDependency)
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
removeManagedDependency(Dependency)
.boolean hasDirectManagedDependency(Dependency managedDependency)
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
hasEffectiveManagedDependency(Dependency)
may return true.boolean hasRepository(String url)
void removeDependency(Dependency dependency)
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
hasDirectDependency(Dependency)
first in order to check if the dependency exists in this projects
immediate dependencies.void removeManagedDependency(Dependency managedDependency)
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.DependencyRepository removeRepository(String url)
DependencyRepository
from the current project. Return true if the repository was removed;
return false otherwise. Return the removed repository, or if no repository was removed.List<Coordinate> resolveAvailableVersions(Dependency dep)
Dependency
with a populated groupId, versionId, and version range, identify the available
Coordinate
in all known repositories for this project. By default, SNAPSHOT versions are excluded.
See resolveAvailableVersions(String)
. For more comprehensive resolution features, see
DependencyResolver
List<Coordinate> resolveAvailableVersions(String gavs)
Coordinate
in all known
DependencyRepository
instances for this Project
. By default, SNAPSHOT versions are excluded. For
example:
dependencyFacet.resolveAvailableVersions("org.jboss.forge.addon:example:[1.0.0,]");
dependencyFacet.resolveAvailableVersions("org.jboss.forge.addon:example:[1.0.0,)");
dependencyFacet.resolveAvailableVersions("org.jboss.forge.addon:example:(1.0.0,3.0.0]");
dependencyFacet.resolveAvailableVersions("org.jboss.forge.addon:example:[1.0.0,3.0.0]");
For more comprehensive resolution features, see resolveAvailableVersions(DependencyQuery)
or
DependencyResolver
List<Coordinate> resolveAvailableVersions(DependencyQuery query)
DependencyQuery
, identify and resolve all matching Coordinate
results in
configured DependencyRepository
instances for this Project
. See also,
resolveAvailableVersions(String)
and resolveAvailableVersions(Dependency)
Dependency resolveProperties(Dependency dependency)
Copyright © 2014 JBoss by Red Hat. All rights reserved.