|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.maven.plugin.AbstractMojo
org.codehaus.mojo.versions.AbstractVersionsUpdaterMojo
public abstract class AbstractVersionsUpdaterMojo
Abstract base class for Versions Mojos.
| Field Summary | |
|---|---|
protected Boolean |
allowSnapshots
Whether to allow snapshots when searching for the latest version of an artifact. |
protected ArtifactFactory |
artifactFactory
|
protected ArtifactMetadataSource |
artifactMetadataSource
The artifact metadata source to use. |
protected String |
comparisonMethod
The versioning rule to use when comparing versions. |
protected ArtifactRepository |
localRepository
|
protected PathTranslator |
pathTranslator
|
protected MavenProjectBuilder |
projectBuilder
|
protected List |
reactorProjects
|
protected List |
remoteArtifactRepositories
|
protected List |
remotePluginRepositories
|
protected ArtifactResolver |
resolver
|
protected org.apache.maven.execution.MavenSession |
session
The Maven Project. |
| Fields inherited from interface org.apache.maven.plugin.Mojo |
|---|
ROLE |
| Constructor Summary | |
|---|---|
AbstractVersionsUpdaterMojo()
|
|
| Method Summary | |
|---|---|
void |
execute()
|
protected ArtifactVersion |
findLatestVersion(Artifact artifact,
VersionRange versionRange,
Boolean allowingSnapshots,
boolean usePluginRepositories)
Finds the latest version of the specified artifact that matches the version range. |
protected org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator |
getExpressionEvaluator()
|
VersionsHelper |
getHelper()
|
MavenProject |
getProject()
Getter for property 'project'. |
protected String |
getPropertyValue(StringBuffer pom,
String property)
Gets the property value that is defined in the pom. |
protected Comparator |
getVersionComparator()
Returns the version comparator to use. |
protected ModifiedPomXMLEventReader |
newModifiedPomXER(StringBuffer input)
Creates a ModifiedPomXMLEventReader from a StringBuffer. |
protected void |
process(File outFile)
Processes the specified file. |
protected StringBuffer |
readFile(File outFile)
Reads a file into a StringBuffer. |
void |
setProject(MavenProject project)
Setter for property 'project'. |
protected boolean |
shouldApplyUpdate(Artifact artifact,
String currentVersion,
ArtifactVersion updateVersion)
Returns true if the update should be applied. |
protected abstract void |
update(ModifiedPomXMLEventReader pom)
Updates the pom. |
protected void |
writeFile(File outFile,
StringBuffer input)
Writes a StringBuffer into a file. |
| Methods inherited from class org.apache.maven.plugin.AbstractMojo |
|---|
getLog, getPluginContext, setLog, setPluginContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ArtifactFactory artifactFactory
protected ArtifactResolver resolver
protected MavenProjectBuilder projectBuilder
protected List reactorProjects
protected ArtifactMetadataSource artifactMetadataSource
protected List remoteArtifactRepositories
protected List remotePluginRepositories
protected ArtifactRepository localRepository
protected String comparisonMethod
maven,
numeric which will handle long version numbers provided all components are numeric, or
mercury which will use the mercury version number comparison rules.
protected Boolean allowSnapshots
protected org.apache.maven.execution.MavenSession session
protected PathTranslator pathTranslator
| Constructor Detail |
|---|
public AbstractVersionsUpdaterMojo()
| Method Detail |
|---|
public VersionsHelper getHelper()
throws MojoExecutionException
MojoExecutionExceptionpublic MavenProject getProject()
public void setProject(MavenProject project)
project - Value to set for property 'project'.
public void execute()
throws MojoExecutionException,
MojoFailureException
MojoExecutionException
MojoFailureException
protected ArtifactVersion findLatestVersion(Artifact artifact,
VersionRange versionRange,
Boolean allowingSnapshots,
boolean usePluginRepositories)
throws MojoExecutionException
artifact - The artifact.versionRange - The version range.allowingSnapshots - null for no override, otherwise the local override to apply.usePluginRepositories -
null if no matching version could be found.
MojoExecutionException - If the artifact metadata could not be found.protected Comparator getVersionComparator()
protected String getPropertyValue(StringBuffer pom,
String property)
pom - The pom.property - The property.
null if not defined.
protected void process(File outFile)
throws MojoExecutionException,
MojoFailureException
outFile - The file to process.
MojoExecutionException - If things go wrong.
MojoFailureException - If things go wrong.protected final ModifiedPomXMLEventReader newModifiedPomXER(StringBuffer input)
ModifiedPomXMLEventReader from a StringBuffer.
input - The XML to read and modify.
ModifiedPomXMLEventReader.
protected final void writeFile(File outFile,
StringBuffer input)
throws IOException
outFile - The file to read.input - The contents of the file.
IOException - when things go wrong.
protected final StringBuffer readFile(File outFile)
throws IOException
outFile - The file to read.
IOException - when things go wrong.
protected abstract void update(ModifiedPomXMLEventReader pom)
throws MojoExecutionException,
MojoFailureException,
javax.xml.stream.XMLStreamException
pom - The pom to update.
MojoExecutionException - If things go wrong.
MojoFailureException - If things go wrong.
javax.xml.stream.XMLStreamException - If things go wrong.
protected boolean shouldApplyUpdate(Artifact artifact,
String currentVersion,
ArtifactVersion updateVersion)
true if the update should be applied.
artifact - The artifact.currentVersion - The current version of the artifact.updateVersion - The proposed new version of the artifact.
true if the update should be applied.protected org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator getExpressionEvaluator()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||