|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codehaus.mojo.versions.api.DefaultVersionsHelper
public class DefaultVersionsHelper
Helper class that provides common functionality required by both the mojos and the reports.
| Constructor Summary | |
|---|---|
DefaultVersionsHelper(ArtifactFactory artifactFactory,
ArtifactMetadataSource artifactMetadataSource,
List remoteArtifactRepositories,
List remotePluginRepositories,
ArtifactRepository localRepository,
WagonManager wagonManager,
Settings settings,
String serverId,
String rulesUri,
String comparisonMethod,
Log log)
Constructs a new DefaultVersionsHelper. |
|
| Method Summary | |
|---|---|
Artifact |
createDependencyArtifact(Dependency dependency)
Shorthand method for getArtifactFactory().createDependencyArtifact(...) which extracts the
parameters from the Dependency instance. |
Artifact |
createDependencyArtifact(String groupId,
String artifactId,
VersionRange versionRange,
String type,
String classifier,
String scope,
boolean optional)
Shorthand method for getArtifactFactory().createDependencyArtifact(...). |
Artifact |
createPluginArtifact(String groupId,
String artifactId,
VersionRange versionRange)
Shorthand method for getArtifactFactory().createPluginArtifact(...). |
Set |
extractArtifacts(Collection mavenProjects)
Takes a List of MavenProject instances and converts it into a Set of Artifact instances. |
ArtifactFactory |
getArtifactFactory()
Returns the artifact factory to use. |
Log |
getLog()
Gets the logger used by this helper. |
Comparator |
getVersionComparator(Artifact artifact)
Returns the version comparator to use for the specified artifact. |
Comparator |
getVersionComparator(String groupId,
String artifactId)
Returns the version comparator to use for the specified groupId and artifactId. |
ArtifactVersions |
lookupArtifactVersions(Artifact artifact,
boolean usePluginRepositories)
Looks up the versions of the specified artifact that are available in either the local repository, or the appropriate remote repositories. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultVersionsHelper(ArtifactFactory artifactFactory,
ArtifactMetadataSource artifactMetadataSource,
List remoteArtifactRepositories,
List remotePluginRepositories,
ArtifactRepository localRepository,
WagonManager wagonManager,
Settings settings,
String serverId,
String rulesUri,
String comparisonMethod,
Log log)
throws MojoExecutionException
DefaultVersionsHelper.
artifactFactory - The artifact factory.artifactMetadataSource - The artifact metadata source to use.remoteArtifactRepositories - The remote artifact repositories to consult.remotePluginRepositories - The remote plugin repositories to consult.localRepository - The local repository to consult.wagonManager - The wagon manager (used if rules need to be retrieved).settings - The settings (used to provide proxy information to the wagon manager).serverId - The serverId hint for the wagon manager.rulesUri - The URL to retrieve the versioning rules from.comparisonMethod - The default comparison method.log - The Log to send log messages to. @since 1.0-alpha-3
MojoExecutionException - If things go wrong.| Method Detail |
|---|
public ArtifactFactory getArtifactFactory()
VersionsHelper
getArtifactFactory in interface VersionsHelperpublic Log getLog()
VersionsHelper
getLog in interface VersionsHelper
public ArtifactVersions lookupArtifactVersions(Artifact artifact,
boolean usePluginRepositories)
throws MojoExecutionException
VersionsHelper
lookupArtifactVersions in interface VersionsHelperartifact - The artifact to look for versions of.usePluginRepositories - true will consult the pluginRepositories, while false
will consult the repositories for normal dependencies.
MojoExecutionException - When things go wrong.public Comparator getVersionComparator(Artifact artifact)
VersionsHelper
getVersionComparator in interface VersionsHelperartifact - the artifact.
public Comparator getVersionComparator(String groupId,
String artifactId)
VersionsHelper
getVersionComparator in interface VersionsHelpergroupId - the groupId.artifactId - the artifactId.
public Artifact createPluginArtifact(String groupId,
String artifactId,
VersionRange versionRange)
VersionsHelpergetArtifactFactory().createPluginArtifact(...).
createPluginArtifact in interface VersionsHelpergroupId - The group Id.artifactId - The artifact Id.versionRange - The version range.
public Artifact createDependencyArtifact(String groupId,
String artifactId,
VersionRange versionRange,
String type,
String classifier,
String scope,
boolean optional)
VersionsHelpergetArtifactFactory().createDependencyArtifact(...).
createDependencyArtifact in interface VersionsHelpergroupId - The group id.artifactId - The artifact id.versionRange - The version (possibly a range)type - The type.classifier - The classifier.scope - The scope.optional - If optional or not.
public Artifact createDependencyArtifact(Dependency dependency)
throws InvalidVersionSpecificationException
VersionsHelpergetArtifactFactory().createDependencyArtifact(...) which extracts the
parameters from the Dependency instance.
createDependencyArtifact in interface VersionsHelperdependency - The dependency to create the artifact for.
InvalidVersionSpecificationException - if the version specified in the dependency is invalid.public Set extractArtifacts(Collection mavenProjects)
List of MavenProject instances and converts it into a Set of Artifact instances.
extractArtifacts in interface VersionsHelpermavenProjects - the List of MavenProject instances.
Set of Artifact instances.
InvalidVersionSpecificationException - if any of the MavenProject versions are invalid (should never happen).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||