|
||||||||||
| 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 org.apache.maven.artifact.factory.ArtifactFactory |
artifactFactory
|
protected org.apache.maven.artifact.metadata.ArtifactMetadataSource |
artifactMetadataSource
The artifact metadata source to use. |
protected org.apache.maven.artifact.resolver.ArtifactResolver |
artifactResolver
|
protected org.apache.maven.artifact.repository.ArtifactRepository |
localRepository
|
protected org.apache.maven.project.path.PathTranslator |
pathTranslator
|
protected org.apache.maven.project.MavenProjectBuilder |
projectBuilder
|
protected List |
reactorProjects
|
protected List |
remoteArtifactRepositories
|
protected List |
remotePluginRepositories
|
protected org.apache.maven.artifact.resolver.ArtifactResolver |
resolver
|
protected org.apache.maven.execution.MavenSession |
session
The Maven Session. |
protected org.apache.maven.settings.Settings |
settings
|
| Fields inherited from interface org.apache.maven.plugin.Mojo |
|---|
ROLE |
| Constructor Summary | |
|---|---|
AbstractVersionsUpdaterMojo()
|
|
| Method Summary | |
|---|---|
protected int |
determineUnchangedSegment(Boolean allowMajorUpdates,
Boolean allowMinorUpdates,
Boolean allowIncrementalUpdates)
Based on the passed flags, determines which segment is unchangable. |
void |
execute()
|
protected org.apache.maven.artifact.versioning.ArtifactVersion |
findLatestVersion(org.apache.maven.artifact.Artifact artifact,
org.apache.maven.artifact.versioning.VersionRange versionRange,
Boolean allowingSnapshots,
boolean usePluginRepositories)
Finds the latest version of the specified artifact that matches the version range. |
VersionsHelper |
getHelper()
|
org.apache.maven.project.MavenProject |
getProject()
Getter for property 'project'. |
protected String |
getPropertyValue(StringBuffer pom,
String property)
Gets the property value that is defined in the pom. |
protected ModifiedPomXMLEventReader |
newModifiedPomXER(StringBuffer input)
Creates a ModifiedPomXMLEventReader from a StringBuffer. |
protected void |
process(File outFile)
Processes the specified file. |
void |
setProject(org.apache.maven.project.MavenProject project)
Setter for property 'project'. |
protected boolean |
shouldApplyUpdate(org.apache.maven.artifact.Artifact artifact,
String currentVersion,
org.apache.maven.artifact.versioning.ArtifactVersion updateVersion)
Returns true if the update should be applied. |
protected abstract void |
update(ModifiedPomXMLEventReader pom)
Updates the pom. |
protected void |
updatePropertyToNewestVersion(ModifiedPomXMLEventReader pom,
Property property,
PropertyVersions version,
String currentVersion)
|
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 org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
protected org.apache.maven.artifact.resolver.ArtifactResolver resolver
protected org.apache.maven.project.MavenProjectBuilder projectBuilder
protected List reactorProjects
protected org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource
protected List remoteArtifactRepositories
protected List remotePluginRepositories
protected org.apache.maven.artifact.repository.ArtifactRepository localRepository
protected org.apache.maven.settings.Settings settings
protected Boolean allowSnapshots
protected org.apache.maven.execution.MavenSession session
protected org.apache.maven.project.path.PathTranslator pathTranslator
protected org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver
| Constructor Detail |
|---|
public AbstractVersionsUpdaterMojo()
| Method Detail |
|---|
public VersionsHelper getHelper()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic org.apache.maven.project.MavenProject getProject()
public void setProject(org.apache.maven.project.MavenProject project)
project - Value to set for property 'project'.
public void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
protected org.apache.maven.artifact.versioning.ArtifactVersion findLatestVersion(org.apache.maven.artifact.Artifact artifact,
org.apache.maven.artifact.versioning.VersionRange versionRange,
Boolean allowingSnapshots,
boolean usePluginRepositories)
throws org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException,
org.apache.maven.plugin.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.
org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException - If the artifact metadata could not be found.
org.apache.maven.plugin.MojoExecutionException
protected String getPropertyValue(StringBuffer pom,
String property)
pom - The pom.property - The property.
null if not defined.
protected void process(File outFile)
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
outFile - The file to process.
org.apache.maven.plugin.MojoExecutionException - If things go wrong.
org.apache.maven.plugin.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 abstract void update(ModifiedPomXMLEventReader pom)
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException,
javax.xml.stream.XMLStreamException,
org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException
pom - The pom to update.
org.apache.maven.plugin.MojoExecutionException - If things go wrong.
org.apache.maven.plugin.MojoFailureException - If things go wrong.
javax.xml.stream.XMLStreamException - If things go wrong.
org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException
protected boolean shouldApplyUpdate(org.apache.maven.artifact.Artifact artifact,
String currentVersion,
org.apache.maven.artifact.versioning.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 int determineUnchangedSegment(Boolean allowMajorUpdates,
Boolean allowMinorUpdates,
Boolean allowIncrementalUpdates)
allowMajorUpdates - allowMinorUpdates - allowIncrementalUpdates -
protected void updatePropertyToNewestVersion(ModifiedPomXMLEventReader pom,
Property property,
PropertyVersions version,
String currentVersion)
throws org.apache.maven.plugin.MojoExecutionException,
javax.xml.stream.XMLStreamException
org.apache.maven.plugin.MojoExecutionException
javax.xml.stream.XMLStreamException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||