Skip to content

Commit

Permalink
allow to inject jboss-parent in serverless-workflow-project/pom.xml v…
Browse files Browse the repository at this point in the history
…ia build-quarkus-app.sh script
  • Loading branch information
rgdoliveira committed Sep 1, 2023
1 parent 7efbbd6 commit b04c0b5
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion scripts/logic/build-quarkus-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ quarkus_platform_groupid="${2}"
quarkus_platform_version="${3}"
kogito_version="${KOGITO_VERSION:-${4}}"

# jboss-parent version to be injected as parent of serverless-workflow-project project
jboss_parent_version="39"

# arch specific dependencies
quarkus_extensions_arch_specific="com.aayushatharva.brotli4j:native-linux-aarch64:1.8.0"
# common extensions used by the kogito-swf-builder and kogito-swf-devmode
Expand Down Expand Up @@ -74,6 +77,9 @@ mvn ${MAVEN_OPTIONS} \
-Dextensions="${quarkus_extensions}" \
"${quarkus_platform_groupid}":quarkus-maven-plugin:"${quarkus_platform_version}":create

# backup original pom
cp serverless-workflow-project/pom.xml serverless-workflow-project/pom.xml.bak

# Fix as we cannot rely on Quarkus platform
# Should be removed once https://issues.redhat.com/browse/KOGITO-9120 is implemented
if [ ! -z ${kogito_version} ]; then
Expand All @@ -89,7 +95,27 @@ if [ ! -z ${kogito_version} ]; then
replace_3=" <version>${kogito_version}<\/version>\n"
complete_replace="$replace_1$replace_2$replace_3"

sed -i.bak -e "/$pattern_1/{
sed -i -e "/$pattern_1/{
N;N;N
s/$complete_pattern/$complete_replace/
}" serverless-workflow-project/pom.xml
fi

if [ ! -z ${jboss_parent_version} ]; then
echo "Adding jboss-parent ${jboss_parent_version} as project parent"
# [ ]* -> is a regexp pattern to match any number of spaces
pattern_1="[ ]*<\/modelVersion>"
complete_pattern="$pattern_1"

replace_1="<\/modelVersion>\n"
replace_2=" <parent>\n"
replace_3=" <groupId>org.jboss<\/groupId>\n"
replace_4=" <artifactId>jboss-parent<\/artifactId>\n"
replace_5=" <version>${jboss_parent_version}<\/version>\n"
replace_6=" <\/parent>"
complete_replace="$replace_1$replace_2$replace_3$replace_4$replace_5$replace_6"

sed -i -e "/$pattern_1/{
N;N;N
s/$complete_pattern/$complete_replace/
}" serverless-workflow-project/pom.xml
Expand Down

0 comments on commit b04c0b5

Please sign in to comment.