diff --git a/bump-pom-scijava.sh b/bump-pom-scijava.sh index f0fc733..c143771 100755 --- a/bump-pom-scijava.sh +++ b/bump-pom-scijava.sh @@ -207,8 +207,9 @@ else p="$(sed_quote "$property")" v="$(sed_quote "$value")" + # Set the primary property version sed \ - -e "//,/<\/properties>/s/\(<$p>\)[^<]*\(<\/$p>\)/\1$v\2/" \ + -e "/<\!-- LIVE PROPERTIES START -->/,/<\!-- LIVE PROPERTIES END -->/s/\(<$p>\)[^<]*\(<\/$p>\)/\1$v\2/" \ $pom > $pom.new && if ! cmp $pom $pom.new then @@ -221,6 +222,25 @@ else mv $pom.new $pom || die "Failed to set property $property = $value" + # Set the profile snapshot version + if test "$ga" + value = "$(sh "$maven_helper" latest-version "$ga:SNAPSHOT")" + v="$(sed_quote "$value")" + sed \ + -e "//,/<\/profile>/s/\(<$p>\)[^<]*\(<\/$p>\)/\1$v\2/" \ + $pom > $pom.new && + if ! cmp $pom $pom.new + then + message="$(printf '%s\n\t%s = %s%s' \ + "$message" "$property" "$value" "$latest_message")" + elif test -n "$must_change" + then + die "Profile property $property not found in $pom" + fi && + mv $pom.new $pom || + die "Failed to set profile property $property = $value" + fi + shift shift done