aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.devcontainer/Dockerfile10
-rw-r--r--.devcontainer/devcontainer.json50
-rw-r--r--.devcontainer/docker-compose.yml48
-rw-r--r--.dockerignore5
-rw-r--r--.gitignore57
-rw-r--r--.mvn/wrapper/maven-wrapper.jarbin58727 -> 0 bytes
-rw-r--r--.mvn/wrapper/maven-wrapper.properties2
-rw-r--r--.vscode/settings.json3
-rw-r--r--README.md56
-rw-r--r--liquibase.properties76
-rwxr-xr-xmvnw316
-rw-r--r--mvnw.cmd188
-rw-r--r--pom.xml220
-rw-r--r--src/main/docker/Dockerfile.jvm94
-rw-r--r--src/main/docker/Dockerfile.legacy-jar90
-rw-r--r--src/main/docker/Dockerfile.native27
-rw-r--r--src/main/docker/Dockerfile.native-micro30
-rw-r--r--src/main/java/dev/submelon/pantry/CustomControllerAdvice.java46
-rw-r--r--src/main/java/dev/submelon/pantry/ErrorResponse.java58
-rw-r--r--src/main/java/dev/submelon/pantry/PantryApplication.java15
-rw-r--r--src/main/java/dev/submelon/pantry/PantryItem.java40
-rw-r--r--src/main/java/dev/submelon/pantry/PantryItemController.java61
-rw-r--r--src/main/java/dev/submelon/pantry/PantryItemRepository.java11
-rw-r--r--src/main/java/dev/submelon/rest/json/PantryItem.java29
-rw-r--r--src/main/java/dev/submelon/rest/json/PantryItemResource.java59
-rw-r--r--src/main/resources/application.properties9
-rw-r--r--src/main/resources/db/changeLog.xml8
-rw-r--r--src/main/resources/db/changelogs/20220804-add-pantryitem.xml30
-rw-r--r--src/test/java/dev/submelon/pantry/ItemRepositoryTests.java51
-rw-r--r--src/test/java/dev/submelon/pantry/PantryApplicationTests.java13
30 files changed, 732 insertions, 970 deletions
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index 58ca2cb..a1aa4f0 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -1,4 +1,4 @@
-# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/java/.devcontainer/base.Dockerfile
+# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/java/.devcontainer/base.Dockerfile
# [Choice] Java version (use -bullseye variants on local arm64/Apple Silicon): 11, 17, 11-bullseye, 17-bullseye, 11-buster, 17-buster
ARG VARIANT="17-bullseye"
@@ -17,6 +17,14 @@ RUN if [ "${INSTALL_MAVEN}" = "true" ]; then su vscode -c "umask 0002 && . /usr/
ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
+# Liquibase CLI
+ARG LIQUIBASE_VERSION="4.14.0"
+RUN mkdir -p /opt/liquibase && cd /opt/liquibase \
+ && curl -GL https://github.com/liquibase/liquibase/releases/download/v${LIQUIBASE_VERSION}/liquibase-${LIQUIBASE_VERSION}.tar.gz -o ./liquibase.tar.gz \
+ && tar xvf ./liquibase.tar.gz \
+ && rm liquibase.tar.gz
+ENV PATH $PATH:/opt/liquibase
+
# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index cb0c829..e4580f7 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -1,34 +1,44 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
-// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/java
+// https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/java
{
"name": "Pantry",
- "dockerComposeFile": "docker-compose.yml",
- "service": "pantry",
- "workspaceFolder": "/workspaces/pantry",
-
- // Set *default* container specific settings.json values on container create.
- "settings": {
- "java.jdt.ls.java.home": "/docker-java-home"
+ "build": {
+ "dockerfile": "Dockerfile",
+ "args": {
+ "VARIANT": "17-bullseye",
+ "INSTALL_MAVEN": "true",
+ "INSTALL_GRADLE": "false",
+ "NODE_VERSION": "lts/*",
+ "LIQUIBASE_VERSION": "4.14.0"
+ }
},
-
- // Add the IDs of extensions you want installed when the container is created.
- "extensions": [
- "vscjava.vscode-java-pack",
- "gabrielbb.vscode-lombok",
- "redhat.vscode-yaml",
- "visualstudioexptteam.vscodeintellicode",
- "redhat.fabric8-analytics",
+
+ "mounts": [
+ // Pass through Maven settings and repository cache
+ "source=${localEnv:HOME}/.m2,target=/home/vscode/.m2,type=bind,consistency=cached"
],
- // Use 'forwardPorts' to make a list of ports inside the container available locally.
- // "forwardPorts": [],
+ "customizations": {
+ "vscode": {
+ "settings": {
+ },
+
+ "extensions": [
+ "vscjava.vscode-java-pack",
+ "redhat.vscode-yaml",
+ "visualstudioexptteam.vscodeintellicode",
+ "redhat.fabric8-analytics",
+ "redhat.vscode-quarkus"
+ ]
+ }
+ },
// Use 'postCreateCommand' to run commands after the container is created.
- "postCreateCommand": "mvn compile spring-boot:run",
+ // "postCreateCommand": "mvn compile",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"features": {
- "kubectl-helm-minikube": "1.22"
+ "docker-from-docker": "latest"
}
}
diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml
deleted file mode 100644
index 447dadc..0000000
--- a/.devcontainer/docker-compose.yml
+++ /dev/null
@@ -1,48 +0,0 @@
-version: '3'
-
-services:
- pantry:
- build:
- context: .
- dockerfile: Dockerfile
- args:
- # Volume directory for hosted files. This directory is created on image build with proper permissions. This is set as an env-var in the Dockerfile
- VARIANT: "11"
-
- # Options
- INSTALL_MAVEN: "true"
- INSTALL_GRADLE: "false"
- NODE_VERSION: "lts/*"
-
- environment:
- MARIADB_HOST: "pantry-db"
-
- volumes:
- - ..:/workspaces/pantry:cached
-
- # Overrides default command so things don't shut down after the process ends.
- command: sleep infinity
-
- # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
- network_mode: service:pantry-db
-
- # Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
- # (Adding the "ports" property to this file will not forward from a Codespace.)
-
- pantry-db:
- image: mariadb:10.7
- restart: unless-stopped
- volumes:
- - pantrydb-data:/var/lib/mysql
-
- environment:
- MARIADB_RANDOM_ROOT_PASSWORD: "true"
- MARIADB_DATABASE: "pantry-db"
- MARIADB_USER: "pantry-user"
- MARIADB_PASSWORD: "i2j9ds0g"
-
- # Add "forwardPorts": ["27017"] to **devcontainer.json** to forward MongoDB locally.
- # (Adding the "ports" property to this file will not forward from a Codespace.)
-
-volumes:
- pantrydb-data: \ No newline at end of file
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..94810d0
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,5 @@
+*
+!target/*-runner
+!target/*-runner.jar
+!target/lib/*
+!target/quarkus-app/* \ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 82d968e..c013b7e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,30 +1,41 @@
-HELP.md
+#Maven
target/
-!.mvn/wrapper/maven-wrapper.jar
-!**/src/main/**/target/
-!**/src/test/**/target/
+pom.xml.tag
+pom.xml.releaseBackup
+pom.xml.versionsBackup
+release.properties
+.flattened-pom.xml
+.mvn/
-### STS ###
-.apt_generated
-.classpath
-.factorypath
+# Eclipse
.project
-.settings
-.springBeans
-.sts4-cache
+.classpath
+.settings/
+bin/
-### IntelliJ IDEA ###
+# IntelliJ
.idea
-*.iws
-*.iml
*.ipr
+*.iml
+*.iws
+
+# NetBeans
+nb-configuration.xml
+
+# Visual Studio Code
+.vscode
+.factorypath
+
+# OSX
+.DS_Store
+
+# Vim
+*.swp
+*.swo
+
+# patch
+*.orig
+*.rej
-### NetBeans ###
-/nbproject/private/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
-build/
-!**/src/main/**/build/
-!**/src/test/**/build/
+# Local environment
+.env
diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar
deleted file mode 100644
index c1dd12f..0000000
--- a/.mvn/wrapper/maven-wrapper.jar
+++ /dev/null
Binary files differ
diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties
deleted file mode 100644
index b7cb93e..0000000
--- a/.mvn/wrapper/maven-wrapper.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
-wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
diff --git a/.vscode/settings.json b/.vscode/settings.json
index aa344eb..e0f15db 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,4 +1,3 @@
{
- "java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -javaagent:\"/home/vscode/.vscode-server/extensions/gabrielbb.vscode-lombok-1.0.1/server/lombok.jar\"",
- "java.configuration.updateBuildConfiguration": "interactive"
+ "java.configuration.updateBuildConfiguration": "automatic"
} \ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..df7d1d2
--- /dev/null
+++ b/README.md
@@ -0,0 +1,56 @@
+# pantry Project
+
+This project uses Quarkus, the Supersonic Subatomic Java Framework.
+
+If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ .
+
+## Running the application in dev mode
+
+You can run your application in dev mode that enables live coding using:
+```shell script
+./mvnw compile quarkus:dev
+```
+
+> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.
+
+## Packaging and running the application
+
+The application can be packaged using:
+```shell script
+./mvnw package
+```
+It produces the `quarkus-run.jar` file in the `target/quarkus-app/` directory.
+Be aware that it’s not an _über-jar_ as the dependencies are copied into the `target/quarkus-app/lib/` directory.
+
+The application is now runnable using `java -jar target/quarkus-app/quarkus-run.jar`.
+
+If you want to build an _über-jar_, execute the following command:
+```shell script
+./mvnw package -Dquarkus.package.type=uber-jar
+```
+
+The application, packaged as an _über-jar_, is now runnable using `java -jar target/*-runner.jar`.
+
+## Creating a native executable
+
+You can create a native executable using:
+```shell script
+./mvnw package -Pnative
+```
+
+Or, if you don't have GraalVM installed, you can run the native executable build in a container using:
+```shell script
+./mvnw package -Pnative -Dquarkus.native.container-build=true
+```
+
+You can then execute your native executable with: `./target/pantry-1.0.0-SNAPSHOT-runner`
+
+If you want to learn more about building native executables, please consult https://quarkus.io/guides/maven-tooling.
+
+## Related Guides
+
+- SmallRye OpenAPI ([guide](https://quarkus.io/guides/openapi-swaggerui)): Document your REST APIs with OpenAPI - comes with Swagger UI
+- Liquibase ([guide](https://quarkus.io/guides/liquibase)): Handle your database schema migrations with Liquibase
+- SmallRye JWT ([guide](https://quarkus.io/guides/security-jwt)): Secure your applications with JSON Web Token
+- Reactive PostgreSQL client ([guide](https://quarkus.io/guides/reactive-sql-clients)): Connect to the PostgreSQL database using the reactive pattern
+- SmallRye Health ([guide](https://quarkus.io/guides/microprofile-health)): Monitor service health
diff --git a/liquibase.properties b/liquibase.properties
new file mode 100644
index 0000000..a3a381e
--- /dev/null
+++ b/liquibase.properties
@@ -0,0 +1,76 @@
+#### _ _ _ _
+## | | (_) (_) |
+## | | _ __ _ _ _ _| |__ __ _ ___ ___
+## | | | |/ _` | | | | | '_ \ / _` / __|/ _ \
+## | |___| | (_| | |_| | | |_) | (_| \__ \ __/
+## \_____/_|\__, |\__,_|_|_.__/ \__,_|___/\___|
+## | |
+## |_|
+##
+## The liquibase.properties file stores properties which do not change often,
+## such as database connection information. Properties stored here save time
+## and reduce risk of mistyped command line arguments.
+## Learn more: https://docs.liquibase.com/concepts/connections/creating-config-properties.html
+####
+####
+## Note about relative and absolute paths:
+## The liquibase.properties file requires paths for some properties.
+## The classpath is the path/to/resources (ex. src/main/resources).
+## The changeLogFile path is relative to the classpath.
+## The url H2 example below is relative to 'pwd' resource.
+####
+# Enter the path for your changelog file.
+changeLogFile=src/main/resources/db/changeLog.xml
+
+#### Enter the Target database 'url' information ####
+liquibase.command.url=jdbc:postgresql://172.17.0.1:49167/quarkus?loggerLevel=OFF
+
+# Enter the username for your Target database.
+liquibase.command.username: quarkus
+
+# Enter the password for your Target database.
+liquibase.command.password: quarkus
+
+#### Enter the Source Database 'referenceUrl' information ####
+## The source database is the baseline or reference against which your target database is compared for diff/diffchangelog commands.
+
+# Enter URL for the source database
+#liquibase.command.referenceUrl: jdbc:h2:tcp://localhost:9090/mem:integration
+
+# Enter the username for your source database
+#liquibase.command.referenceUsername: dbuser
+
+# Enter the password for your source database
+#liquibase.command.referencePassword: letmein
+
+# Logging Configuration
+# logLevel controls the amount of logging information generated. If not set, the default logLevel is INFO.
+# Valid values, from least amount of logging to most, are:
+# OFF, ERROR, WARN, INFO, DEBUG, TRACE, ALL
+# If you are having problems, setting the logLevel to DEBUG and re-running the command can be helpful.
+# logLevel: DEBUG
+
+# The logFile property controls where logging messages are sent. If this is not set, then logging messages are
+# displayed on the console. If this is set, then messages will be sent to a file with the given name.
+# logFile: liquibase.log
+
+
+#### Liquibase Pro Key Information ####
+# Learn more, contact support, or get or renew a Pro Key at https://www.liquibase.com/trial
+# liquibase.licenseKey:
+
+#### Liquibase Hub Information ####
+# Liquibase Hub is a free secure SaaS portal providing status reporting, monitoring & insights
+# into your Liquibase database release automation.
+# https://hub.liquibase.com
+
+## Add your free Hub API key here
+# liquibase.hub.apikey:
+# liquibase.hub.mode:all
+
+
+
+
+## Get documentation at docs.liquibase.com ##
+## Get certified courses at learn.liquibase.com ##
+## Get support at liquibase.com/support ##
diff --git a/mvnw b/mvnw
deleted file mode 100755
index 8a8fb22..0000000
--- a/mvnw
+++ /dev/null
@@ -1,316 +0,0 @@
-#!/bin/sh
-# ----------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# ----------------------------------------------------------------------------
-
-# ----------------------------------------------------------------------------
-# Maven Start Up Batch script
-#
-# Required ENV vars:
-# ------------------
-# JAVA_HOME - location of a JDK home dir
-#
-# Optional ENV vars
-# -----------------
-# M2_HOME - location of maven2's installed home dir
-# MAVEN_OPTS - parameters passed to the Java VM when running Maven
-# e.g. to debug Maven itself, use
-# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-# ----------------------------------------------------------------------------
-
-if [ -z "$MAVEN_SKIP_RC" ] ; then
-
- if [ -f /usr/local/etc/mavenrc ] ; then
- . /usr/local/etc/mavenrc
- fi
-
- if [ -f /etc/mavenrc ] ; then
- . /etc/mavenrc
- fi
-
- if [ -f "$HOME/.mavenrc" ] ; then
- . "$HOME/.mavenrc"
- fi
-
-fi
-
-# OS specific support. $var _must_ be set to either true or false.
-cygwin=false;
-darwin=false;
-mingw=false
-case "`uname`" in
- CYGWIN*) cygwin=true ;;
- MINGW*) mingw=true;;
- Darwin*) darwin=true
- # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
- # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
- if [ -z "$JAVA_HOME" ]; then
- if [ -x "/usr/libexec/java_home" ]; then
- export JAVA_HOME="`/usr/libexec/java_home`"
- else
- export JAVA_HOME="/Library/Java/Home"
- fi
- fi
- ;;
-esac
-
-if [ -z "$JAVA_HOME" ] ; then
- if [ -r /etc/gentoo-release ] ; then
- JAVA_HOME=`java-config --jre-home`
- fi
-fi
-
-if [ -z "$M2_HOME" ] ; then
- ## resolve links - $0 may be a link to maven's home
- PRG="$0"
-
- # need this for relative symlinks
- while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG="`dirname "$PRG"`/$link"
- fi
- done
-
- saveddir=`pwd`
-
- M2_HOME=`dirname "$PRG"`/..
-
- # make it fully qualified
- M2_HOME=`cd "$M2_HOME" && pwd`
-
- cd "$saveddir"
- # echo Using m2 at $M2_HOME
-fi
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched
-if $cygwin ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --unix "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
-fi
-
-# For Mingw, ensure paths are in UNIX format before anything is touched
-if $mingw ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME="`(cd "$M2_HOME"; pwd)`"
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
-fi
-
-if [ -z "$JAVA_HOME" ]; then
- javaExecutable="`which javac`"
- if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
- # readlink(1) is not available as standard on Solaris 10.
- readLink=`which readlink`
- if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
- if $darwin ; then
- javaHome="`dirname \"$javaExecutable\"`"
- javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
- else
- javaExecutable="`readlink -f \"$javaExecutable\"`"
- fi
- javaHome="`dirname \"$javaExecutable\"`"
- javaHome=`expr "$javaHome" : '\(.*\)/bin'`
- JAVA_HOME="$javaHome"
- export JAVA_HOME
- fi
- fi
-fi
-
-if [ -z "$JAVACMD" ] ; then
- if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- else
- JAVACMD="`\\unset -f command; \\command -v java`"
- fi
-fi
-
-if [ ! -x "$JAVACMD" ] ; then
- echo "Error: JAVA_HOME is not defined correctly." >&2
- echo " We cannot execute $JAVACMD" >&2
- exit 1
-fi
-
-if [ -z "$JAVA_HOME" ] ; then
- echo "Warning: JAVA_HOME environment variable is not set."
-fi
-
-CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
-
-# traverses directory structure from process work directory to filesystem root
-# first directory with .mvn subdirectory is considered project base directory
-find_maven_basedir() {
-
- if [ -z "$1" ]
- then
- echo "Path not specified to find_maven_basedir"
- return 1
- fi
-
- basedir="$1"
- wdir="$1"
- while [ "$wdir" != '/' ] ; do
- if [ -d "$wdir"/.mvn ] ; then
- basedir=$wdir
- break
- fi
- # workaround for JBEAP-8937 (on Solaris 10/Sparc)
- if [ -d "${wdir}" ]; then
- wdir=`cd "$wdir/.."; pwd`
- fi
- # end of workaround
- done
- echo "${basedir}"
-}
-
-# concatenates all lines of a file
-concat_lines() {
- if [ -f "$1" ]; then
- echo "$(tr -s '\n' ' ' < "$1")"
- fi
-}
-
-BASE_DIR=`find_maven_basedir "$(pwd)"`
-if [ -z "$BASE_DIR" ]; then
- exit 1;
-fi
-
-##########################################################################################
-# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
-# This allows using the maven wrapper in projects that prohibit checking in binary data.
-##########################################################################################
-if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
- if [ "$MVNW_VERBOSE" = true ]; then
- echo "Found .mvn/wrapper/maven-wrapper.jar"
- fi
-else
- if [ "$MVNW_VERBOSE" = true ]; then
- echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
- fi
- if [ -n "$MVNW_REPOURL" ]; then
- jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
- else
- jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
- fi
- while IFS="=" read key value; do
- case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
- esac
- done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
- if [ "$MVNW_VERBOSE" = true ]; then
- echo "Downloading from: $jarUrl"
- fi
- wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
- if $cygwin; then
- wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
- fi
-
- if command -v wget > /dev/null; then
- if [ "$MVNW_VERBOSE" = true ]; then
- echo "Found wget ... using wget"
- fi
- if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
- wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
- else
- wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
- fi
- elif command -v curl > /dev/null; then
- if [ "$MVNW_VERBOSE" = true ]; then
- echo "Found curl ... using curl"
- fi
- if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
- curl -o "$wrapperJarPath" "$jarUrl" -f
- else
- curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
- fi
-
- else
- if [ "$MVNW_VERBOSE" = true ]; then
- echo "Falling back to using Java to download"
- fi
- javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
- # For Cygwin, switch paths to Windows format before running javac
- if $cygwin; then
- javaClass=`cygpath --path --windows "$javaClass"`
- fi
- if [ -e "$javaClass" ]; then
- if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
- if [ "$MVNW_VERBOSE" = true ]; then
- echo " - Compiling MavenWrapperDownloader.java ..."
- fi
- # Compiling the Java class
- ("$JAVA_HOME/bin/javac" "$javaClass")
- fi
- if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
- # Running the downloader
- if [ "$MVNW_VERBOSE" = true ]; then
- echo " - Running MavenWrapperDownloader.java ..."
- fi
- ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
- fi
- fi
- fi
-fi
-##########################################################################################
-# End of extension
-##########################################################################################
-
-export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
-if [ "$MVNW_VERBOSE" = true ]; then
- echo $MAVEN_PROJECTBASEDIR
-fi
-MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --path --windows "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
- [ -n "$MAVEN_PROJECTBASEDIR" ] &&
- MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
-fi
-
-# Provide a "standardized" way to retrieve the CLI args that will
-# work with both Windows and non-Windows executions.
-MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
-export MAVEN_CMD_LINE_ARGS
-
-WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-exec "$JAVACMD" \
- $MAVEN_OPTS \
- $MAVEN_DEBUG_OPTS \
- -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
- "-Dmaven.home=${M2_HOME}" \
- "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
- ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
diff --git a/mvnw.cmd b/mvnw.cmd
deleted file mode 100644
index 1d8ab01..0000000
--- a/mvnw.cmd
+++ /dev/null
@@ -1,188 +0,0 @@
-@REM ----------------------------------------------------------------------------
-@REM Licensed to the Apache Software Foundation (ASF) under one
-@REM or more contributor license agreements. See the NOTICE file
-@REM distributed with this work for additional information
-@REM regarding copyright ownership. The ASF licenses this file
-@REM to you under the Apache License, Version 2.0 (the
-@REM "License"); you may not use this file except in compliance
-@REM with the License. You may obtain a copy of the License at
-@REM
-@REM https://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing,
-@REM software distributed under the License is distributed on an
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-@REM KIND, either express or implied. See the License for the
-@REM specific language governing permissions and limitations
-@REM under the License.
-@REM ----------------------------------------------------------------------------
-
-@REM ----------------------------------------------------------------------------
-@REM Maven Start Up Batch script
-@REM
-@REM Required ENV vars:
-@REM JAVA_HOME - location of a JDK home dir
-@REM
-@REM Optional ENV vars
-@REM M2_HOME - location of maven2's installed home dir
-@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
-@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
-@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
-@REM e.g. to debug Maven itself, use
-@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-@REM ----------------------------------------------------------------------------
-
-@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
-@echo off
-@REM set title of command window
-title %0
-@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
-@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
-
-@REM set %HOME% to equivalent of $HOME
-if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
-
-@REM Execute a user defined script before this one
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
-@REM check for pre script, once with legacy .bat ending and once with .cmd ending
-if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
-if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
-:skipRcPre
-
-@setlocal
-
-set ERROR_CODE=0
-
-@REM To isolate internal variables from possible post scripts, we use another setlocal
-@setlocal
-
-@REM ==== START VALIDATION ====
-if not "%JAVA_HOME%" == "" goto OkJHome
-
-echo.
-echo Error: JAVA_HOME not found in your environment. >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-:OkJHome
-if exist "%JAVA_HOME%\bin\java.exe" goto init
-
-echo.
-echo Error: JAVA_HOME is set to an invalid directory. >&2
-echo JAVA_HOME = "%JAVA_HOME%" >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-@REM ==== END VALIDATION ====
-
-:init
-
-@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
-@REM Fallback to current working directory if not found.
-
-set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
-IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
-
-set EXEC_DIR=%CD%
-set WDIR=%EXEC_DIR%
-:findBaseDir
-IF EXIST "%WDIR%"\.mvn goto baseDirFound
-cd ..
-IF "%WDIR%"=="%CD%" goto baseDirNotFound
-set WDIR=%CD%