feat: bump CXF version when bumping Camel version
We need CXF aligned to the Camel version so best align the CXF version
when we're changing the Camel version.
@@ -162,18 +162,25 @@ dev::run() {
appdir=$(appdir)
# test if the new camel version is available on maven repo
artifact_url=https://maven.repository.redhat.com/ga/org/apache/camel/camel-core/${camel_version}/camel-core-${camel_version}.pom
- artifact_ok=$(curl -k -X GET -I ${artifact_url} 2>/dev/null | head -n 1 | cut -d$' ' -f2)
+ artifact_ok=$(curl -X GET -I ${artifact_url} 2>/dev/null | head -n 1 | cut -d$' ' -f2)
if [ ${artifact_ok} != 200 ]; then
echo "Camel ${camel_version} is not available in ${artifact_url}"
echo "Camel version did not change."
exit 1
fi
current_camel=$(grep '<camel.version>' ${appdir}/pom.xml | head -1 | cut -d '>' -f 2|cut -d '<' -f 1)
- echo "Changing camel version from \"$current_camel\" to \"$camel_version\""
+ echo "Changing Camel version from \"$current_camel\" to \"$camel_version\""
sed -i "s/$current_camel/$camel_version/g" \
${appdir}/pom.xml \
${appdir}/extension/bom/pom.xml \
${appdir}/integration/bom/pom.xml
+ next_cxf_version=$(curl -s "https://maven.repository.redhat.com/ga/org/apache/camel/camel-parent/${camel_version}/camel-parent-${camel_version}.pom" | sed -n 's/^.*<cxf-version>\(.*\)<\/cxf-version>/\1/p')
+ current_cxf_version=$(sed -n 's/^.*<cxf\.version>\(.*\)<\/cxf\.version>/\1/p' "${appdir}/pom.xml")
+ if [ "$current_cxf_version" != "$next_cxf_version" ]; then
+ echo "Changing CXF version from \"$current_cxf_version\" to \"$next_cxf_version\""
+ sed -i "s/$current_cxf_version/$next_cxf_version/g" \
+ "${appdir}/pom.xml"
+ fi
git status
echo "You should use git to add the files and commit them"
elif [ $(hasflag --cookie) ]; then
