From c29bda5bef2b9d33c0ad156c4c2e24bbc163f44b Mon Sep 17 00:00:00 2001 From: BarDweller Date: Wed, 11 Sep 2019 10:31:26 -0400 Subject: [PATCH] Mvnw optional on java --- .../java-microprofile/image/project/.appsody-init.bat | 7 ++++++- incubator/java-microprofile/image/project/.appsody-init.sh | 5 ++++- incubator/java-microprofile/image/project/pom.xml | 2 +- incubator/java-microprofile/stack.yaml | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/incubator/java-microprofile/image/project/.appsody-init.bat b/incubator/java-microprofile/image/project/.appsody-init.bat index 55427e14f..99d127673 100755 --- a/incubator/java-microprofile/image/project/.appsody-init.bat +++ b/incubator/java-microprofile/image/project/.appsody-init.bat @@ -1 +1,6 @@ -mvnw install -Denforcer.skip=true \ No newline at end of file +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 \ No newline at end of file diff --git a/incubator/java-microprofile/image/project/.appsody-init.sh b/incubator/java-microprofile/image/project/.appsody-init.sh index 8d200e71d..1458bb4d0 100755 --- a/incubator/java-microprofile/image/project/.appsody-init.sh +++ b/incubator/java-microprofile/image/project/.appsody-init.sh @@ -1,2 +1,5 @@ #!/bin/bash -./mvnw install -Denforcer.skip=true \ No newline at end of file +which java 2>&1 >/dev/null ; JAVA_KNOWN=$? +if [ ! -z "$JAVA_HOME" ] || [ $JAVA_KNOWN = "0" ]; then + ./mvnw install -Denforcer.skip=true +fi \ No newline at end of file diff --git a/incubator/java-microprofile/image/project/pom.xml b/incubator/java-microprofile/image/project/pom.xml index 98fcfd5c8..1e8de5b24 100644 --- a/incubator/java-microprofile/image/project/pom.xml +++ b/incubator/java-microprofile/image/project/pom.xml @@ -14,7 +14,7 @@ dev.appsody java-microprofile - 0.2.13 + 0.2.14 pom diff --git a/incubator/java-microprofile/stack.yaml b/incubator/java-microprofile/stack.yaml index 71fb1e278..616e64057 100644 --- a/incubator/java-microprofile/stack.yaml +++ b/incubator/java-microprofile/stack.yaml @@ -1,5 +1,5 @@ name: Eclipse MicroProfile® -version: 0.2.13 +version: 0.2.14 description: Eclipse MicroProfile on Open Liberty & OpenJ9 using Maven license: Apache-2.0 language: java