File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,9 @@ install_jdk() {
104104 printf -v " $dest_var " ' %s' " $home "
105105}
106106
107+ CN1_VERSION=$( awk -F' [<>]' ' /<version>/{print $3; exit}' maven/pom.xml)
108+ log " Detected Codename One snapshot version ${CN1_VERSION} "
109+
107110log " Ensuring JDK 8 is available"
108111if [ -z " ${JAVA_HOME:- } " ] || [ ! -x " $JAVA_HOME /bin/java" ] || ! " $JAVA_HOME /bin/java" -version 2>&1 | grep -q ' 8\.0' ; then
109112 log " Provisioning JDK 8..."
215218set -e
216219
217220if [ " ${skip_archetypes:- 0} " -eq 0 ]; then
218- (cd cn1-maven-archetypes && " $MAVEN_HOME /bin/mvn" -DskipTests -DskipITs=true -Dinvoker.skip=true install) || \
219- log " Archetype mvn install failed; continuing."
221+ (
222+ cd cn1-maven-archetypes
223+ current_version=$( " $MAVEN_HOME /bin/mvn" -q -DforceStdout help:evaluate -Dexpression=project.version | tr -d ' \r' | tail -n 1)
224+ if [ -z " $current_version " ]; then
225+ log " Unable to determine cn1-maven-archetypes version; proceeding with defaults"
226+ elif [ " $current_version " != " $CN1_VERSION " ]; then
227+ log " Updating cn1-maven-archetypes version from $current_version to $CN1_VERSION to match local snapshot"
228+ " $MAVEN_HOME /bin/mvn" -q -B versions:set -DnewVersion=" $CN1_VERSION " -DgenerateBackupPoms=false
229+ fi
230+ " $MAVEN_HOME /bin/mvn" -DskipTests -DskipITs=true -Dinvoker.skip=true install
231+ ) || log " Archetype mvn install failed; continuing."
220232fi
You can’t perform that action at this time.
0 commit comments