org.jboss.forge.project.facets
Interface DependencyFacet

All Superinterfaces:
Facet

public interface DependencyFacet
extends Facet

Author:
Lincoln Baxter, III

Nested Class Summary
static class DependencyFacet.KnownRepository
           
 
Method Summary
 void addDependency(Dependency dependency)
          Add the given Dependency to this Project's immediate list of 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 getDependency(Dependency dependency)
          Attempt to locate the given Dependency, if it exists in the Project, 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 hasDependency(Dependency dependency)
          Return true if this Project contains a dependency matching the given Dependency at any level of the project hierarchy; return false otherwise.
 boolean hasDirectDependency(Dependency dependency)
          Return true if this Project contains a 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 hasManagedDependency(Dependency managedDependency)
          Return true if this Project contains a managed dependency matching the given Dependency; 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(String gavs)
          Given a groupid:versionid:version-range, identify the available artifacts in all known repositories 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

hasDependency

boolean hasDependency(Dependency dependency)
Return true if this Project contains a 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 dependency structure, meaning that if a dependency is declared somewhere else in the hierarchy, it will not be detected by hasDirectDependency(Dependency) and will not be removable via removeDependency(Dependency).


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.


addDependency

void addDependency(Dependency dependency)
Add the given Dependency to this Project's immediate list of dependencies. This method first calls hasDependency(Dependency) before making changes to the dependency list.

See also: DependencyBuilder.


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.


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;


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;


getDependency

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

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

Returns:

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:

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


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


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


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


hasManagedDependency

boolean hasManagedDependency(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.


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.


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.


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


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


resolveProperties

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


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


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


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


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.


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.


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.


getRepositories

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


resolveAvailableVersions

List<Dependency> resolveAvailableVersions(String gavs)
Given a groupid:versionid:version-range, identify the available artifacts in all known repositories for this project. 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 DependencyResolver


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. See resolveAvailableVersions(String). For more comprehensive resolution features, see DependencyResolver



Copyright © 2011 Seam Framework. All Rights Reserved.