Search in sources :

Example 6 with ReleasePhase

use of com.itemis.maven.plugins.unleash.ReleasePhase in project unleash-maven-plugin by shillner.

the class SetNextDevVersion method setParentVersion.

private void setParentVersion(MavenProject project, Document document) {
    Parent parent = project.getModel().getParent();
    if (parent != null) {
        Map<ReleasePhase, ArtifactCoordinates> coordinatesByPhase = this.metadata.getArtifactCoordinatesByPhase(parent.getGroupId(), parent.getArtifactId());
        ArtifactCoordinates oldCoordinates = coordinatesByPhase.get(ReleasePhase.RELEASE);
        ArtifactCoordinates newCoordinates = coordinatesByPhase.get(ReleasePhase.POST_RELEASE);
        // for it
        if (newCoordinates != null) {
            this.log.debug("\t\tUpdate of parent version of module '" + project.getGroupId() + ":" + project.getArtifact() + "' [" + oldCoordinates.getVersion() + " => " + newCoordinates.getVersion() + "]");
            PomUtil.setParentVersion(project.getModel(), document, newCoordinates.getVersion());
        }
    }
}
Also used : Parent(org.apache.maven.model.Parent) ReleasePhase(com.itemis.maven.plugins.unleash.ReleasePhase) ArtifactCoordinates(com.itemis.maven.aether.ArtifactCoordinates)

Example 7 with ReleasePhase

use of com.itemis.maven.plugins.unleash.ReleasePhase in project unleash-maven-plugin by shillner.

the class SetReleaseVersions method setParentVersion.

private void setParentVersion(MavenProject project, Document document) {
    Parent parent = project.getModel().getParent();
    if (parent != null) {
        Map<ReleasePhase, ArtifactCoordinates> coordinatesByPhase = this.metadata.getArtifactCoordinatesByPhase(parent.getGroupId(), parent.getArtifactId());
        ArtifactCoordinates oldCoordinates = coordinatesByPhase.get(ReleasePhase.PRE_RELEASE);
        ArtifactCoordinates newCoordinates = coordinatesByPhase.get(ReleasePhase.RELEASE);
        // for it
        if (newCoordinates != null) {
            this.log.debug("\tUpdate of parent version of module '" + project.getGroupId() + ":" + project.getArtifact() + "' [" + oldCoordinates.getVersion() + " => " + newCoordinates.getVersion() + "]");
            PomUtil.setParentVersion(project.getModel(), document, newCoordinates.getVersion());
        }
    }
}
Also used : Parent(org.apache.maven.model.Parent) ReleasePhase(com.itemis.maven.plugins.unleash.ReleasePhase) ArtifactCoordinates(com.itemis.maven.aether.ArtifactCoordinates)

Example 8 with ReleasePhase

use of com.itemis.maven.plugins.unleash.ReleasePhase in project unleash-maven-plugin by shillner.

the class SetReleaseVersions method setProjectVersion.

private void setProjectVersion(MavenProject project, Document document) {
    Map<ReleasePhase, ArtifactCoordinates> coordinatesByPhase = this.metadata.getArtifactCoordinatesByPhase(project.getGroupId(), project.getArtifactId());
    String oldVerion = coordinatesByPhase.get(ReleasePhase.PRE_RELEASE).getVersion();
    String newVersion = coordinatesByPhase.get(ReleasePhase.RELEASE).getVersion();
    this.log.debug("\tUpdate of module version '" + project.getGroupId() + ":" + project.getArtifact() + "' [" + oldVerion + " => " + newVersion + "]");
    PomUtil.setProjectVersion(project.getModel(), document, newVersion);
}
Also used : ReleasePhase(com.itemis.maven.plugins.unleash.ReleasePhase) ArtifactCoordinates(com.itemis.maven.aether.ArtifactCoordinates) ProjectToString(com.itemis.maven.plugins.unleash.util.functions.ProjectToString)

Example 9 with ReleasePhase

use of com.itemis.maven.plugins.unleash.ReleasePhase in project unleash-maven-plugin by shillner.

the class TagScm method init.

private void init() {
    this.scmProvider = this.scmProviderRegistry.getProvider();
    Map<ReleasePhase, ArtifactCoordinates> coordinates = this.metadata.getArtifactCoordinatesByPhase(this.project.getGroupId(), this.project.getArtifactId());
    ArtifactCoordinates postReleaseCoordinates = coordinates.get(ReleasePhase.RELEASE);
    this.globalReleaseVersion = postReleaseCoordinates.getVersion();
    this.cachedPOMs = Maps.newHashMap();
}
Also used : ReleasePhase(com.itemis.maven.plugins.unleash.ReleasePhase) ArtifactCoordinates(com.itemis.maven.aether.ArtifactCoordinates)

Aggregations

ArtifactCoordinates (com.itemis.maven.aether.ArtifactCoordinates)9 ReleasePhase (com.itemis.maven.plugins.unleash.ReleasePhase)9 ProjectToString (com.itemis.maven.plugins.unleash.util.functions.ProjectToString)6 Parent (org.apache.maven.model.Parent)2 MavenProject (org.apache.maven.project.MavenProject)2 IOException (java.io.IOException)1 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)1 MojoFailureException (org.apache.maven.plugin.MojoFailureException)1 VersionsEngine (org.eclipse.tycho.versions.engine.VersionsEngine)1 PomFile (org.eclipse.tycho.versions.pom.PomFile)1 Document (org.w3c.dom.Document)1