public abstract class AbstractVersionsDependencyUpdaterMojo extends AbstractVersionsUpdaterMojo
| Modifier and Type | Field and Description |
|---|---|
protected static Pattern |
SNAPSHOT_REGEX
Pattern to match snapshot versions
|
aetherRepositorySystem, allowSnapshots, ignoredVersions, project, reactorProjects, repositorySystem, ruleSet, session, wagonMap| Modifier | Constructor and Description |
|---|---|
protected |
AbstractVersionsDependencyUpdaterMojo(org.apache.maven.repository.RepositorySystem repositorySystem,
org.eclipse.aether.RepositorySystem aetherRepositorySystem,
Map<String,org.apache.maven.wagon.Wagon> wagonMap,
Map<String,org.codehaus.mojo.versions.api.recording.ChangeRecorder> changeRecorders) |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.maven.artifact.Artifact |
findArtifact(org.apache.maven.model.Dependency dependency)
Try to find the dependency artifact that matches the given dependency.
|
protected org.apache.maven.model.Dependency |
getParentDependency()
Returns the
Dependency instance for the parent project |
protected boolean |
hasIncludes()
Indicates whether any includes were specified via the 'includes' or 'includesList' options.
|
boolean |
isExcludeReactor()
Should the artifacts produced in the current reactor be excluded from processing.
|
protected boolean |
isHandledByProperty(org.apache.maven.model.Dependency dependency)
Should the dependency be updated itself or is it handled by properties.
|
protected boolean |
isIncluded(org.apache.maven.artifact.Artifact artifact)
Determine if the artifact is included in the list of artifacts to be processed.
|
boolean |
isProcessingDependencies()
Should the project/dependencies section of the pom be processed.
|
boolean |
isProcessingDependencyManagement()
Should the project/dependencyManagement section of the pom be processed.
|
boolean |
isProcessingParent()
Should the project/parent section of the pom be processed.
|
protected boolean |
isProducedByReactor(org.apache.maven.model.Dependency dependency)
Returns
true if the dependency is produced by the current reactor. |
protected List<String> |
separatePatterns(String includeString)
To handle multiple includes with version range like "group:artifact:jar:[1.0.0,2.2)", we have to use a parsing a
little bit more complex than split().
|
protected org.apache.maven.artifact.Artifact |
toArtifact(org.apache.maven.model.Dependency dependency)
Try to find the dependency artifact that matches the given dependency.
|
protected org.apache.maven.artifact.Artifact |
toArtifact(org.apache.maven.model.Parent model) |
protected String |
toString(org.apache.maven.model.Dependency d) |
protected String |
toString(org.apache.maven.project.MavenProject project) |
protected boolean |
updateDependencyVersion(ModifiedPomXMLEventReader pom,
org.apache.maven.model.Dependency dep,
String newVersion,
org.codehaus.mojo.versions.api.recording.ChangeRecord.ChangeKind changeKind)
Attempts to update the dependency
dep to the given newVersion. |
execute, findLatestVersion, getChangeRecorder, getHelper, getProject, getPropertyValue, getVersion, newModifiedPomXER, process, saveChangeRecorderResults, setProject, shouldApplyUpdate, shouldApplyUpdate, update, updatePropertyToNewestVersion, validateInput, writeFileprotected static final Pattern SNAPSHOT_REGEX
@Inject
protected AbstractVersionsDependencyUpdaterMojo(org.apache.maven.repository.RepositorySystem repositorySystem,
org.eclipse.aether.RepositorySystem aetherRepositorySystem,
Map<String,org.apache.maven.wagon.Wagon> wagonMap,
Map<String,org.codehaus.mojo.versions.api.recording.ChangeRecorder> changeRecorders)
public boolean isProcessingDependencies()
true if the project/dependencies section of the pom should be processed.public boolean isProcessingDependencyManagement()
true if the project/dependencyManagement section of the pom should be processed.public boolean isProcessingParent()
true if the project/parent section of the pom should be processed.public boolean isExcludeReactor()
true if the artifacts produced in the current reactor
should be excluded from processing.protected boolean isHandledByProperty(org.apache.maven.model.Dependency dependency)
dependency - Dependencyprotected org.apache.maven.artifact.Artifact findArtifact(org.apache.maven.model.Dependency dependency)
dependency - Dependencyprotected org.apache.maven.artifact.Artifact toArtifact(org.apache.maven.model.Dependency dependency)
throws org.apache.maven.plugin.MojoExecutionException
dependency - Dependencyorg.apache.maven.plugin.MojoExecutionException - Mojo execution exceptionprotected org.apache.maven.artifact.Artifact toArtifact(org.apache.maven.model.Parent model)
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected org.apache.maven.model.Dependency getParentDependency()
Dependency instance for the parent projectDependency object for the parentprotected String toString(org.apache.maven.project.MavenProject project)
protected String toString(org.apache.maven.model.Dependency d)
protected boolean isProducedByReactor(org.apache.maven.model.Dependency dependency)
true if the dependency is produced by the current reactor.dependency - the dependency to heck.true if the dependency is produced by the current reactor.protected boolean isIncluded(org.apache.maven.artifact.Artifact artifact)
artifact - The artifact we want to check.protected boolean hasIncludes()
protected List<String> separatePatterns(String includeString)
includeString - the string to parseprotected boolean updateDependencyVersion(ModifiedPomXMLEventReader pom, org.apache.maven.model.Dependency dep, String newVersion, org.codehaus.mojo.versions.api.recording.ChangeRecord.ChangeKind changeKind) throws XMLStreamException, org.apache.maven.plugin.MojoExecutionException
dep to the given newVersion. The dependency can either
be the parent project or any given dependency.pom - ModifiedPomXMLEventReader instance to update the POM XML documentdep - dependency to be updated (can also be a dependency made from the parent)newVersion - new version to update the dependency tochangeKind - title for the ChangeRecorder logtrue if an update has been made, false otherwiseXMLStreamException - thrown if updating the XML doesn't succeedorg.apache.maven.plugin.MojoExecutionExceptionCopyright © 2008–2022 MojoHaus. All rights reserved.