|
||||||||||
| 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 MavenProjectBuilder |
projectBuilder
|
protected List |
reactorProjects
|
protected List |
remoteRepositories
|
protected ArtifactResolver |
resolver
|
| 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)
Finds the latest version of the specified artifact that matches the version range. |
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 ArtifactRepository localRepository
protected List remoteRepositories
protected ArtifactMetadataSource artifactMetadataSource
protected String comparisonMethod
maven or
numeric which will handle long version numbers provided all components are numeric.
protected Boolean allowSnapshots
protected List reactorProjects
| Constructor Detail |
|---|
public AbstractVersionsUpdaterMojo()
| Method Detail |
|---|
public 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)
throws MojoExecutionException
artifact - The artifact.versionRange - The version range.allowingSnapshots - null for no override, otherwise the local override to apply.
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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||