ricardozanini commented on code in PR #3167:
URL:
https://github.com/apache/incubator-kie-tools/pull/3167#discussion_r2116413335
##########
packages/sonataflow-image-common/resources/modules/kogito-maven/common/configure:
##########
@@ -22,25 +22,14 @@ set -e
SOURCES_DIR=/tmp/artifacts
SCRIPT_DIR=$(dirname "${0}")
-mvn_install_dir="/usr/share/maven"
+mvn_install_dir="/usr/share/maven-${MAVEN_VERSION}"
-# Verify if mvn is installed
-if [ ! -d ${mvn_install_dir} ] && ! 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}
-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
-fi
+echo "---> Installing Apache Maven ${MAVEN_VERSION} to ${mvn_install_dir}"
+
+tar -xzf "${SOURCES_DIR}/apache-maven-${MAVEN_VERSION}-bin.tar.gz" -C
/usr/share
+mv "/usr/share/apache-maven-${MAVEN_VERSION}" "${mvn_install_dir}"
Review Comment:
This path must also be an env var within this module.
##########
packages/sonataflow-image-common/resources/modules/kogito-maven/common/configure:
##########
@@ -22,25 +22,14 @@ set -e
SOURCES_DIR=/tmp/artifacts
SCRIPT_DIR=$(dirname "${0}")
-mvn_install_dir="/usr/share/maven"
+mvn_install_dir="/usr/share/maven-${MAVEN_VERSION}"
-# Verify if mvn is installed
-if [ ! -d ${mvn_install_dir} ] && ! 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}
-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
-fi
+echo "---> Installing Apache Maven ${MAVEN_VERSION} to ${mvn_install_dir}"
+
+tar -xzf "${SOURCES_DIR}/apache-maven-${MAVEN_VERSION}-bin.tar.gz" -C
/usr/share
+mv "/usr/share/apache-maven-${MAVEN_VERSION}" "${mvn_install_dir}"
+
+ln -sf "${mvn_install_dir}/bin/mvn" "/usr/share/maven/bin/mvn"
Review Comment:
Can you use ${MAVEN_HOME} instead of `/usr/share/maven`?
--
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]