Skip to content

Commit 59c2423

Browse files
committed
Detect parent snapshot when releasing
1 parent c954ddf commit 59c2423

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Version 2.3.2 (2017-02-06)
2+
3+
* [new] Detect and use the latest version of Maven archetype plugin when generating a project.
4+
* [new] Abort release if parent is still a SNAPSHOT.
5+
16
# Version 2.3.1 (2017-01-09)
27

38
* [fix] Fix auto-detection of possible project archetypes.

src/license/THIRD-PARTY.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# Please fill the missing licenses for dependencies :
1313
#
1414
#
15-
#Mon Feb 06 10:18:48 CET 2017
15+
#Mon Feb 06 10:34:27 CET 2017
1616
classworlds--classworlds--1.1-alpha-2=
1717
commons-collections--commons-collections--3.1=
1818
dom4j--dom4j--1.6.1=

src/main/java/org/seedstack/maven/ReleaseMojo.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,19 @@ public void execute() throws MojoExecutionException, MojoFailureException {
5959
String currentVersion = executionMavenProject.getVersion();
6060

6161
if (isProjectDirty(getReactorModules("", executionMavenProject))) {
62-
throw new MojoFailureException("A POM transformation is already in progress, commit and revert it before executing the release goal");
62+
throw new MojoFailureException("Cannot continue, a POM transformation is already in progress, commit and revert it before executing the release goal");
6363
}
6464

6565
if (!executionMavenProject.equals(getLocalRoot(executionMavenProject))) {
66-
throw new MojoFailureException("Release goal must be executed from the local project root");
66+
throw new MojoFailureException("Cannot continue, release goal must be executed from the local project root");
6767
}
6868

6969
if (!currentVersion.endsWith(SNAPSHOT_SUFFIX)) {
70-
throw new MojoFailureException("Project version is not a SNAPSHOT, aborting");
70+
throw new MojoFailureException("Cannot continue, project version is not a SNAPSHOT");
71+
}
72+
73+
if (executionMavenProject.hasParent() && executionMavenProject.getParent().getVersion().endsWith(SNAPSHOT_SUFFIX)) {
74+
throw new MojoFailureException("Cannot continue, parent project is still a SNAPSHOT");
7175
}
7276

7377
String newVersion = currentVersion.substring(0, currentVersion.length() - SNAPSHOT_SUFFIX.length());

0 commit comments

Comments
 (0)