You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if [ "$(q -t -v 'count(/mvn:project/mvn:properties)'"$ROOT_POM"2>/dev/null ||echo 0)"="0" ];then
134
-
x -s "/mvn:project" -t elem -n properties -v """$ROOT_POM"
135
-
fi
136
-
if [ "$(q -t -v 'count(/mvn:project/mvn:properties/mvn:codenameone.version)'"$ROOT_POM"2>/dev/null ||echo 0)"="0" ];then
137
-
x -s "/mvn:project/mvn:properties" -t elem -n codenameone.version -v "$CN1_VERSION""$ROOT_POM"
138
-
else
139
-
x -u "/mvn:project/mvn:properties/mvn:codenameone.version" -v "$CN1_VERSION""$ROOT_POM"
140
-
fi
141
-
142
-
# 2) Parent must be a LITERAL version (no property allowed)
143
-
while IFS= read -r -d '' P;do
144
-
x -u "/mvn:project[mvn:parent/mvn:groupId='com.codenameone' and mvn:parent/mvn:artifactId='codenameone-maven-parent']/mvn:parent/mvn:version" -v "$CN1_VERSION""$P"||true
145
-
done<<(find "$APP_DIR" -type f -name pom.xml -print0)
146
-
147
-
# 3) Point com.codenameone deps/plugins to ${codenameone.version}
148
-
while IFS= read -r -d '' P;do
149
-
# Dependencies
150
-
x -u "/mvn:project//mvn:dependencies/mvn:dependency[starts-with(mvn:groupId,'com.codenameone')]/mvn:version" -v '${codenameone.version}'"$P"2>/dev/null ||true
151
-
# Plugins (regular)
152
-
x -u "/mvn:project//mvn:build/mvn:plugins/mvn:plugin[starts-with(mvn:groupId,'com.codenameone')]/mvn:version" -v '${codenameone.version}'"$P"2>/dev/null ||true
153
-
# Plugins (pluginManagement)
154
-
x -u "/mvn:project//mvn:build/mvn:pluginManagement/mvn:plugins/mvn:plugin[starts-with(mvn:groupId,'com.codenameone')]/mvn:version" -v '${codenameone.version}'"$P"2>/dev/null ||true
155
-
done<<(find "$APP_DIR" -type f -name pom.xml -print0)
156
-
157
-
# 4) Ensure common Maven plugins have a version (Maven requires it even if parent not yet resolved)
if [ "$(q -t -v "count(/mvn:project/mvn:build/mvn:plugins/mvn:plugin[mvn:groupId='$g' and mvn:artifactId='$a']/mvn:version)""$pom"2>/dev/null ||echo 0)"="0" ] &&
176
-
[ "$(q -t -v "count(/mvn:project/mvn:build/mvn:plugins/mvn:plugin[mvn:groupId='$g' and mvn:artifactId='$a'])""$pom"2>/dev/null ||echo 0)"!="0" ];then
177
-
x -s "/mvn:project/mvn:build/mvn:plugins/mvn:plugin[mvn:groupId='$g' and mvn:artifactId='$a']" -t elem -n version -v "$v""$pom"||true
178
-
fi
179
-
# pluginManagement/plugins
180
-
if [ "$(q -t -v "count(/mvn:project/mvn:build/mvn:pluginManagement/mvn:plugins/mvn:plugin[mvn:groupId='$g' and mvn:artifactId='$a']/mvn:version)""$pom"2>/dev/null ||echo 0)"="0" ] &&
181
-
[ "$(q -t -v "count(/mvn:project/mvn:build/mvn:pluginManagement/mvn:plugins/mvn:plugin[mvn:groupId='$g' and mvn:artifactId='$a'])""$pom"2>/dev/null ||echo 0)"!="0" ];then
182
-
x -s "/mvn:project/mvn:build/mvn:pluginManagement/mvn:plugins/mvn:plugin[mvn:groupId='$g' and mvn:artifactId='$a']" -t elem -n version -v "$v""$pom"||true
0 commit comments