Skip to content

Commit ca6cf07

Browse files
gregturnodrotbohm
authored andcommitted
#375 - Make the new-issue-branch script resilient
Introduces a step where the maven plugins are quietly warmed up before using them.
1 parent b5d038b commit ca6cf07

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

etc/scripts/new-issue-branch

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@ if [ $# -gt 1 ]; then echo -e "ERROR: One argument maximum.\n$USAGE" >&2; exit 1
1111

1212
TICKET_ID=${1:?"TICKET_ID Parameter is missing!"}
1313

14-
OLD_VERSION_TMP=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev '^\[.*')
14+
# Warmup the maven plugins before actually using them (avoids "Downloading" messages getting in variables)
15+
echo "Warming up the Maven plugins..."
16+
mvn -q org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version
17+
mvn -q versions:help
18+
19+
# Now use the plugins to roll the version
20+
21+
echo "Looking up the current version..."
22+
OLD_VERSION_TMP=$(mvn -o org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev '^\[.*')
1523

1624
OLD_POM_VERSION=${OLD_VERSION_TMP:?"Could not extract current project version from pom.xml"}
1725

@@ -23,7 +31,7 @@ echo "Creating feature branch $TICKET_ID: $OLD_POM_VERSION -> $NEW_POM_VERSION"
2331

2432
echo "Stashing potential intermediate changes..." && git stash\
2533
&& git checkout -b $ISSUE_BRANCH\
26-
&& $(mvn $MAVEN_FLAGS -q versions:set -DgenerateBackupPoms=false -DnewVersion=$NEW_POM_VERSION)\
34+
&& $(mvn -o $MAVEN_FLAGS -q versions:set -DgenerateBackupPoms=false -DnewVersion=$NEW_POM_VERSION)\
2735
&& ( \
2836
(\
2937
git commit -am "$TICKET_ID - Prepare branch"\

0 commit comments

Comments
 (0)