Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Commit

Permalink
Make mvnw usage optional on java presence
Browse files Browse the repository at this point in the history
  • Loading branch information
Ozzy Osborne committed Sep 9, 2019
1 parent 6b03d88 commit 22ddd81
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
mvnw install -Denforcer.skip=true
setlocal
set JAVA_FOUND=0
where java >nul 2>nul
if %ERRORLEVEL% EQU 0 set JAVA_FOUND=1
if defined JAVA_HOME set JAVA_FOUND=1
if "%JAVA_FOUND%"==1 mvnw install -Denforcer.skip=true
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
#!/bin/bash
./mvnw install -Denforcer.skip=true
which java 2>&1 >/dev/null ; JAVA_KNOWN=$?
if [ ! -z "$JAVA_HOME" ] || [ $JAVA_KNOWN = "0" ]; then
./mvnw install -Denforcer.skip=true
fi
7 changes: 6 additions & 1 deletion incubator/java-microprofile/image/project/.appsody-init.bat
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
mvnw install -Denforcer.skip=true
setlocal
set JAVA_FOUND=0
where java >nul 2>nul
if %ERRORLEVEL% EQU 0 set JAVA_FOUND=1
if defined JAVA_HOME set JAVA_FOUND=1
if "%JAVA_FOUND%"==1 mvnw install -Denforcer.skip=true
5 changes: 4 additions & 1 deletion incubator/java-microprofile/image/project/.appsody-init.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
#!/bin/bash
./mvnw install -Denforcer.skip=true
which java 2>&1 >/dev/null ; JAVA_KNOWN=$?
if [ ! -z "$JAVA_HOME" ] || [ $JAVA_KNOWN = "0" ]; then
./mvnw install -Denforcer.skip=true
fi
7 changes: 6 additions & 1 deletion incubator/java-spring-boot2/image/project/.appsody-init.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
if not exist %SystemDrive%%HOMEPATH%\.m2\repository\ (
mkdir %SystemDrive%%HOMEPATH%\.m2\repository
)
mvnw install -q -f ./appsody-boot2-pom.xml
setlocal
set JAVA_FOUND=0
where java >nul 2>nul
if %ERRORLEVEL% EQU 0 set JAVA_FOUND=1
if defined JAVA_HOME set JAVA_FOUND=1
if "%JAVA_FOUND%"==1 mvnw install -q -f ./appsody-boot2-pom.xml
5 changes: 4 additions & 1 deletion incubator/java-spring-boot2/image/project/.appsody-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ if [ ! -d ~/.m2/repository ]; then
mkdir -p ~/.m2/repository
fi

./mvnw install -q -f ./appsody-boot2-pom.xml
which java 2>&1 >/dev/null ; JAVA_KNOWN=$?
if [ ! -z "$JAVA_HOME" ] || [ $JAVA_KNOWN = "0" ]; then
./mvnw install -q -f project/appsody-boot2-pom.xml
fi

0 comments on commit 22ddd81

Please sign in to comment.