ricardozanini commented on code in PR #3167:
URL:
https://github.com/apache/incubator-kie-tools/pull/3167#discussion_r2124336783
##########
packages/sonataflow-image-common/resources/modules/kogito-maven/common/module.yaml:
##########
@@ -23,16 +23,20 @@ version: "main"
envs:
- name: "MAVEN_VERSION"
description: "The Maven version to setup with this module"
+ value: "3.8.6"
- name: "MAVEN_HOME"
value: "/usr/share/maven"
- name: "MAVEN_CMD"
- value: "/usr/share/maven/bin/mvnw"
+ value: "/usr/share/maven/bin/mvn"
- name: "MAVEN_SETTINGS_PATH"
description: "The location of the settings.xml file"
value: "${KOGITO_HOME}/.m2/settings.xml"
- name: "MAVEN_CONTAINER_BUILD_SETTINGS_PATH"
description: "The location of the settings.xml file during container image
build"
value: "${KOGITO_HOME}/.m2/maven-m2-repo-via-http-settings.xml"
+ - name: "KOGITO_MAVEN_HOME"
Review Comment:
```suggestion
- name: "ALTERNATIVE_MAVEN_HOME"
```
I think this name improves understandability. 😅
##########
packages/sonataflow-image-common/resources/modules/kogito-maven/common/configure:
##########
@@ -22,24 +22,22 @@ set -e
SOURCES_DIR=/tmp/artifacts
SCRIPT_DIR=$(dirname "${0}")
-mvn_install_dir="/usr/share/maven"
+echo "---> Installing Apache Maven ${MAVEN_VERSION} to ${KOGITO_MAVEN_HOME}"
+
+tar -xzf "${SOURCES_DIR}/apache-maven-${MAVEN_VERSION}-bin.tar.gz" -C
/usr/share
# Verify if mvn is installed
-if [ ! -d ${mvn_install_dir} ] && ! command -v mvn > /dev/null 2>&1 ;
+if [ ! -d ${MAVEN_HOME} ] && ! command -v mvn > /dev/null 2>&1 ;
then
echo "---> Maven not found, downloading and installing it"
- tar xzf "${SOURCES_DIR}"/apache-maven-"${MAVEN_VERSION}"-bin.tar.gz -C
/usr/share
- mv /usr/share/apache-maven-"${MAVEN_VERSION}" ${mvn_install_dir}
+ mv /usr/share/apache-maven-"${MAVEN_VERSION}" ${MAVEN_HOME}
else
echo "---> Maven already present in the current context"
# TODO: Remove this temporary solution in favor of the
-DnoMavenVersionCheck flag once it's available
# https://github.com/quarkusio/quarkus/issues/46105
- # Installs Maven Wrapper for version 3.8.6 in order to be compatible with
the quarkus-maven-plugin minimum requirements (on Quarkus 3.15.3.1).
- echo "---> Installing Maven wrapper for Maven 3.8.6"
- cd "${MAVEN_HOME}"/bin
- mvn wrapper:wrapper -Dmaven=3.8.6 -Dtype=source
- echo "--> Validating Maven wrapper installation"
- ${MAVEN_CMD} --version
+ # Installs Maven for version 3.8.6 in order to be compatible with the
quarkus-maven-plugin minimum requirements (on Quarkus 3.15.3.1).
+ echo "---> Installing Maven 3.8.6"
+ ln -sf "${KOGITO_MAVEN_HOME}/bin/mvn" "${MAVEN_HOME}/bin/mvn"
Review Comment:
```suggestion
ln -sf "${ALTERNATIVE_MAVEN_HOME}/bin/mvn" "${MAVEN_HOME}/bin/mvn"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]