Forge - Parent 1.2.3-SNAPSHOT

org.jboss.forge.project.facets
Interface DependencyFacet

All Superinterfaces:
Facet
All Known Implementing Classes:
MavenDependencyFacet

public interface DependencyFacet
extends Facet

Author:
Lincoln Baxter, III

Nested Class Summary
static class DependencyFacet.KnownRepository
           
 
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 managedDependency)
          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 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 Dependencies contained within this project.
 Dependency getManagedDependency(Dependency managedDependency)
          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 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(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.
 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.
 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 interface org.jboss.forge.project.Facet
getProject, install, isInstalled, setProject, uninstall
 

Method Detail

addDirectDependency

void addDirectDependency(Dependency dep)
Add the given 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.


addManagedDependency

void addManagedDependency(Dependency managedDependency)
Add the given managed 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.


addDirectManagedDependency

void addDirectManagedDependency(Dependency dep)
Add the given managed 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.


addRepository

void addRepository(DependencyFacet.KnownRepository repository)
Add a DependencyFacet.KnownRepository to the project build system. This is where dependencies can be found, downloaded, and installed to the project build script.


addRepository

void addRepository(String name,
                   String url)
Add a repository to the project build system. This is where dependencies can be found, downloaded, and installed to the project build script.


getDependencies

List<Dependency> getDependencies()
Return an immutable list of all direct Dependencies contained within this project. (i.e.: all dependencies for which hasDirectDependency(Dependency) returns true;


getDependenciesInScopes

List<Dependency> getDependenciesInScopes(ScopeType... scopes)
Get a list of this Project's dependencies of the given ScopeType.. See also: DependencyBuilder. See also: #getDependency(Dependency).


getDirectDependency

Dependency getDirectDependency(Dependency dependency)
Attempt to locate the given Dependency, if it exists in the Project direct dependency list, and return it.

See also: DependencyBuilder. See also: hasDirectDependency(Dependency).

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.

Returns:

getEffectiveDependencies

List<Dependency> getEffectiveDependencies()
Return an immutable list of all Dependencies contained anywhere within this project's dependency hierarchy. (i.e.: all dependencies for which hasEffectiveDependency(Dependency) returns true;


getEffectiveDependenciesInScopes

List<Dependency> getEffectiveDependenciesInScopes(ScopeType... scopes)
Get a list of this Project's dependencies of the given ScopeType, from anywhere in the dependency hierarchy. See also: DependencyBuilder. See also: getEffectiveDependency(Dependency).


getEffectiveDependency

Dependency getEffectiveDependency(Dependency dependency)
Attempt to locate the given Dependency, if it exists anywhere in the Project dependency hierarchy, and return it.

See also: DependencyBuilder. See also: hasEffectiveDependency(Dependency).

Returns:

getEffectiveManagedDependency

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. 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 getManagedDependency(Dependency) and will not be removable via removeManagedDependency(Dependency).


getManagedDependencies

List<Dependency> getManagedDependencies()
Return an immutable list of all direct managed Dependencies contained within this project. (i.e.: all managed dependencies for which ManagedDependencyFacet#hasManagedDependency(Dependency) returns true;


getManagedDependency

Dependency getManagedDependency(Dependency managedDependency)
Attempt to locate the given managed Dependency, if it exists in the Project, and return it.

See also: DependencyBuilder. See also: hasEffectiveManagedDependency(Dependency).

Returns:

getProperties

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.)


getProperty

String getProperty(String name)
Get a build property by name. (Build properties, such as ${my.version}, can be used anywhere in a dependency, and will be expanded during building to their property value.)


getRepositories

List<DependencyRepository> getRepositories()
Get the list of repositories for which this project is currently configured to use in dependency resolution.


hasDirectDependency

boolean hasDirectDependency(Dependency dependency)
Return true if this 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.


hasEffectiveDependency

boolean hasEffectiveDependency(Dependency dependency)
Return true if the given Dependency exists anywhere in the project dependency hierarchy. See also: DependencyBuilder. See also: getEffectiveDependency(Dependency).


hasEffectiveManagedDependency

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. 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).


hasDirectManagedDependency

boolean hasDirectManagedDependency(Dependency managedDependency)
Return true if this 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.


hasRepository

boolean hasRepository(DependencyFacet.KnownRepository repository)
Return true if the given DependencyFacet.KnownRepository is already registered in this project's build system.


hasRepository

boolean hasRepository(String url)
Return true if the given repository URL is already registered in this project's build system.


removeDependency

void removeDependency(Dependency dependency)
Remove the given 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.


removeManagedDependency

void removeManagedDependency(Dependency managedDependency)
Remove the given managed 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.


removeProperty

String removeProperty(String name)
Remove a build property by name. (Build properties, such as ${my.version}, can be used anywhere in a dependency, and will be expanded during building to their property value.)


removeRepository

DependencyRepository removeRepository(String url)
Remove the given 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.


resolveAvailableVersions

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. By default, SNAPSHOT versions are excluded. See resolveAvailableVersions(String). For more comprehensive resolution features, see DependencyResolver


resolveAvailableVersions

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. 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 resolveAvailableVersions(DependencyQuery) or DependencyResolver


resolveAvailableVersions

List<Dependency> resolveAvailableVersions(DependencyQuery query)
Using the given DependencyQuery, identify and resolve all matching Dependency results in configured DependencyRepository instances for this Project. See also, resolveAvailableVersions(String) and resolveAvailableVersions(Dependency)


resolveProperties

Dependency resolveProperties(Dependency dependency)
Resolve properties in the given dependency, converting them to their actual values.


setProperty

void setProperty(String name,
                 String value)
Set a build dependency property. (Build properties, such as ${my.version}, can be used anywhere in a dependency, and will be expanded during building to their property value.)


Forge - Parent 1.2.3-SNAPSHOT

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.