Add files using upload-large-folder tool
Browse files- benchmark/infrastructure/ejb-interceptor/quarkus/.dockerignore +41 -0
- benchmark/infrastructure/ejb-interceptor/quarkus/Dockerfile +33 -0
- benchmark/infrastructure/ejb-interceptor/quarkus/mvnw +295 -0
- benchmark/infrastructure/ejb-interceptor/quarkus/mvnw.cmd +189 -0
- benchmark/infrastructure/ejb-interceptor/quarkus/pom.xml +90 -0
- benchmark/infrastructure/ejb-interceptor/quarkus/test.sh +15 -0
- benchmark/infrastructure/ejb-interceptor/spring/.dockerignore +41 -0
- benchmark/infrastructure/ejb-interceptor/spring/Dockerfile +31 -0
- benchmark/infrastructure/ejb-timersession/jakarta/.dockerignore +41 -0
- benchmark/infrastructure/ejb-timersession/jakarta/.mvn/wrapper/maven-wrapper.properties +19 -0
- benchmark/infrastructure/ejb-timersession/jakarta/Dockerfile +28 -0
- benchmark/infrastructure/ejb-timersession/jakarta/mvnw +259 -0
- benchmark/infrastructure/ejb-timersession/jakarta/mvnw.cmd +149 -0
- benchmark/infrastructure/ejb-timersession/jakarta/pom.xml +82 -0
- benchmark/infrastructure/ejb-timersession/jakarta/src/main/java/jakarta/tutorial/timersession/ejb/TimerSessionBean.java +102 -0
- benchmark/infrastructure/ejb-timersession/jakarta/src/main/java/jakarta/tutorial/timersession/web/TimerManager.java +76 -0
- benchmark/infrastructure/ejb-timersession/jakarta/src/main/liberty/config/server.xml +17 -0
- benchmark/infrastructure/ejb-timersession/jakarta/src/main/webapp/WEB-INF/web.xml +49 -0
- benchmark/infrastructure/ejb-timersession/jakarta/src/main/webapp/timer-client.xhtml +38 -0
- benchmark/infrastructure/ejb-timersession/jakarta/src/main/webapp/timer.xhtml +34 -0
- benchmark/infrastructure/ejb-timersession/jakarta/test.sh +15 -0
- benchmark/infrastructure/ejb-timersession/quarkus/.dockerignore +41 -0
- benchmark/infrastructure/ejb-timersession/quarkus/.mvn/wrapper/maven-wrapper.properties +3 -0
- benchmark/infrastructure/ejb-timersession/quarkus/Dockerfile +33 -0
- benchmark/infrastructure/ejb-timersession/quarkus/mvnw +295 -0
- benchmark/infrastructure/ejb-timersession/quarkus/mvnw.cmd +189 -0
- benchmark/infrastructure/ejb-timersession/quarkus/pom.xml +142 -0
- benchmark/infrastructure/ejb-timersession/quarkus/src/main/java/jakarta/tutorial/timersession/ejb/TimerSessionBean.java +94 -0
- benchmark/infrastructure/ejb-timersession/quarkus/src/main/java/jakarta/tutorial/timersession/web/TimerManager.java +77 -0
- benchmark/infrastructure/ejb-timersession/quarkus/src/main/resources/META-INF/resources/timer-client.xhtml +38 -0
- benchmark/infrastructure/ejb-timersession/quarkus/src/main/resources/META-INF/resources/timer.xhtml +34 -0
- benchmark/infrastructure/ejb-timersession/quarkus/src/main/resources/META-INF/web.xml +49 -0
- benchmark/infrastructure/ejb-timersession/quarkus/src/main/resources/application.properties +6 -0
- benchmark/infrastructure/ejb-timersession/quarkus/test.sh +15 -0
- benchmark/infrastructure/ejb-timersession/spring/.dockerignore +41 -0
- benchmark/infrastructure/ejb-timersession/spring/.mvn/wrapper/maven-wrapper.properties +3 -0
- benchmark/infrastructure/ejb-timersession/spring/Dockerfile +31 -0
- benchmark/infrastructure/ejb-timersession/spring/mvnw +259 -0
- benchmark/infrastructure/ejb-timersession/spring/mvnw.cmd +149 -0
- benchmark/infrastructure/ejb-timersession/spring/pom.xml +55 -0
- benchmark/infrastructure/ejb-timersession/spring/src/main/java/jakarta/tutorial/timersession/Application.java +12 -0
- benchmark/infrastructure/ejb-timersession/spring/src/main/java/jakarta/tutorial/timersession/SchedulingConfig.java +20 -0
- benchmark/infrastructure/ejb-timersession/spring/src/main/java/jakarta/tutorial/timersession/ejb/TimerSessionService.java +59 -0
- benchmark/infrastructure/ejb-timersession/spring/src/main/java/jakarta/tutorial/timersession/web/TimerController.java +34 -0
- benchmark/infrastructure/ejb-timersession/spring/src/main/java/jakarta/tutorial/timersession/web/TimerManager.java +45 -0
- benchmark/infrastructure/ejb-timersession/spring/src/main/resources/application.properties +11 -0
- benchmark/infrastructure/ejb-timersession/spring/src/main/resources/templates/timer-client.html +27 -0
- benchmark/infrastructure/ejb-timersession/spring/src/main/resources/templates/timer.html +21 -0
- benchmark/infrastructure/ejb-timersession/spring/test.sh +15 -0
benchmark/infrastructure/ejb-interceptor/quarkus/.dockerignore
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# VCS
|
| 2 |
+
.git/
|
| 3 |
+
|
| 4 |
+
# Maven
|
| 5 |
+
.mvn/
|
| 6 |
+
**/.mvn/
|
| 7 |
+
mvnw
|
| 8 |
+
mvnw.cmd
|
| 9 |
+
**/mvnw
|
| 10 |
+
**/mvnw.cmd
|
| 11 |
+
target/
|
| 12 |
+
**/target/
|
| 13 |
+
pom.xml.tag
|
| 14 |
+
pom.xml.releaseBackup
|
| 15 |
+
pom.xml.versionsBackup
|
| 16 |
+
pom.xml.next
|
| 17 |
+
release.properties
|
| 18 |
+
dependency-reduced-pom.xml
|
| 19 |
+
buildNumber.properties
|
| 20 |
+
|
| 21 |
+
# IDE / Editor
|
| 22 |
+
.vscode/
|
| 23 |
+
**/.vscode/
|
| 24 |
+
.zed/
|
| 25 |
+
**/.zed/
|
| 26 |
+
.idea/
|
| 27 |
+
**/.idea/
|
| 28 |
+
*.iml
|
| 29 |
+
*.ipr
|
| 30 |
+
*.iws
|
| 31 |
+
|
| 32 |
+
# OS
|
| 33 |
+
.DS_Store
|
| 34 |
+
**/.DS_Store
|
| 35 |
+
Thumbs.db
|
| 36 |
+
ehthumbs.db
|
| 37 |
+
|
| 38 |
+
# Logs / temp
|
| 39 |
+
*.log
|
| 40 |
+
*.tmp
|
| 41 |
+
*.temp
|
benchmark/infrastructure/ejb-interceptor/quarkus/Dockerfile
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM maven:3.9.12-ibm-semeru-21-noble
|
| 2 |
+
|
| 3 |
+
USER root
|
| 4 |
+
# install uv
|
| 5 |
+
RUN apt-get update && apt-get install -y --no-install-recommends curl lsof python3-venv python3-full && curl -LsSf https://astral.sh/uv/install.sh | sh
|
| 6 |
+
|
| 7 |
+
ENV PATH="/root/.local/bin:$PATH"
|
| 8 |
+
|
| 9 |
+
# Shared browsers path so Chromium is cached once
|
| 10 |
+
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
|
| 11 |
+
RUN mkdir -p /ms-playwright && chmod 755 /ms-playwright
|
| 12 |
+
|
| 13 |
+
# create venv and install
|
| 14 |
+
RUN uv venv /opt/venv && uv pip install --python /opt/venv/bin/python playwright==1.47.0 pytest
|
| 15 |
+
|
| 16 |
+
ENV PATH="/opt/venv/bin:$PATH"
|
| 17 |
+
RUN playwright install --with-deps chromium
|
| 18 |
+
|
| 19 |
+
# Set working directory
|
| 20 |
+
WORKDIR /app
|
| 21 |
+
|
| 22 |
+
# Copy all the assets
|
| 23 |
+
COPY . .
|
| 24 |
+
|
| 25 |
+
# Build the application at image build time
|
| 26 |
+
RUN mvn clean install -DskipTests
|
| 27 |
+
|
| 28 |
+
COPY test.sh .
|
| 29 |
+
RUN chmod +x test.sh
|
| 30 |
+
|
| 31 |
+
RUN mvn clean install -DskipTests
|
| 32 |
+
|
| 33 |
+
CMD ["mvn", "quarkus:run"]
|
benchmark/infrastructure/ejb-interceptor/quarkus/mvnw
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
# ----------------------------------------------------------------------------
|
| 3 |
+
# Licensed to the Apache Software Foundation (ASF) under one
|
| 4 |
+
# or more contributor license agreements. See the NOTICE file
|
| 5 |
+
# distributed with this work for additional information
|
| 6 |
+
# regarding copyright ownership. The ASF licenses this file
|
| 7 |
+
# to you under the Apache License, Version 2.0 (the
|
| 8 |
+
# "License"); you may not use this file except in compliance
|
| 9 |
+
# with the License. You may obtain a copy of the License at
|
| 10 |
+
#
|
| 11 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 12 |
+
#
|
| 13 |
+
# Unless required by applicable law or agreed to in writing,
|
| 14 |
+
# software distributed under the License is distributed on an
|
| 15 |
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
| 16 |
+
# KIND, either express or implied. See the License for the
|
| 17 |
+
# specific language governing permissions and limitations
|
| 18 |
+
# under the License.
|
| 19 |
+
# ----------------------------------------------------------------------------
|
| 20 |
+
|
| 21 |
+
# ----------------------------------------------------------------------------
|
| 22 |
+
# Apache Maven Wrapper startup batch script, version 3.3.4
|
| 23 |
+
#
|
| 24 |
+
# Optional ENV vars
|
| 25 |
+
# -----------------
|
| 26 |
+
# JAVA_HOME - location of a JDK home dir, required when download maven via java source
|
| 27 |
+
# MVNW_REPOURL - repo url base for downloading maven distribution
|
| 28 |
+
# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
|
| 29 |
+
# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
|
| 30 |
+
# ----------------------------------------------------------------------------
|
| 31 |
+
|
| 32 |
+
set -euf
|
| 33 |
+
[ "${MVNW_VERBOSE-}" != debug ] || set -x
|
| 34 |
+
|
| 35 |
+
# OS specific support.
|
| 36 |
+
native_path() { printf %s\\n "$1"; }
|
| 37 |
+
case "$(uname)" in
|
| 38 |
+
CYGWIN* | MINGW*)
|
| 39 |
+
[ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
|
| 40 |
+
native_path() { cygpath --path --windows "$1"; }
|
| 41 |
+
;;
|
| 42 |
+
esac
|
| 43 |
+
|
| 44 |
+
# set JAVACMD and JAVACCMD
|
| 45 |
+
set_java_home() {
|
| 46 |
+
# For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
|
| 47 |
+
if [ -n "${JAVA_HOME-}" ]; then
|
| 48 |
+
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
|
| 49 |
+
# IBM's JDK on AIX uses strange locations for the executables
|
| 50 |
+
JAVACMD="$JAVA_HOME/jre/sh/java"
|
| 51 |
+
JAVACCMD="$JAVA_HOME/jre/sh/javac"
|
| 52 |
+
else
|
| 53 |
+
JAVACMD="$JAVA_HOME/bin/java"
|
| 54 |
+
JAVACCMD="$JAVA_HOME/bin/javac"
|
| 55 |
+
|
| 56 |
+
if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
|
| 57 |
+
echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
|
| 58 |
+
echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
|
| 59 |
+
return 1
|
| 60 |
+
fi
|
| 61 |
+
fi
|
| 62 |
+
else
|
| 63 |
+
JAVACMD="$(
|
| 64 |
+
'set' +e
|
| 65 |
+
'unset' -f command 2>/dev/null
|
| 66 |
+
'command' -v java
|
| 67 |
+
)" || :
|
| 68 |
+
JAVACCMD="$(
|
| 69 |
+
'set' +e
|
| 70 |
+
'unset' -f command 2>/dev/null
|
| 71 |
+
'command' -v javac
|
| 72 |
+
)" || :
|
| 73 |
+
|
| 74 |
+
if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
|
| 75 |
+
echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
|
| 76 |
+
return 1
|
| 77 |
+
fi
|
| 78 |
+
fi
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
# hash string like Java String::hashCode
|
| 82 |
+
hash_string() {
|
| 83 |
+
str="${1:-}" h=0
|
| 84 |
+
while [ -n "$str" ]; do
|
| 85 |
+
char="${str%"${str#?}"}"
|
| 86 |
+
h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
|
| 87 |
+
str="${str#?}"
|
| 88 |
+
done
|
| 89 |
+
printf %x\\n $h
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
verbose() { :; }
|
| 93 |
+
[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
|
| 94 |
+
|
| 95 |
+
die() {
|
| 96 |
+
printf %s\\n "$1" >&2
|
| 97 |
+
exit 1
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
trim() {
|
| 101 |
+
# MWRAPPER-139:
|
| 102 |
+
# Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
|
| 103 |
+
# Needed for removing poorly interpreted newline sequences when running in more
|
| 104 |
+
# exotic environments such as mingw bash on Windows.
|
| 105 |
+
printf "%s" "${1}" | tr -d '[:space:]'
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
scriptDir="$(dirname "$0")"
|
| 109 |
+
scriptName="$(basename "$0")"
|
| 110 |
+
|
| 111 |
+
# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
|
| 112 |
+
while IFS="=" read -r key value; do
|
| 113 |
+
case "${key-}" in
|
| 114 |
+
distributionUrl) distributionUrl=$(trim "${value-}") ;;
|
| 115 |
+
distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
|
| 116 |
+
esac
|
| 117 |
+
done <"$scriptDir/.mvn/wrapper/maven-wrapper.properties"
|
| 118 |
+
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
|
| 119 |
+
|
| 120 |
+
case "${distributionUrl##*/}" in
|
| 121 |
+
maven-mvnd-*bin.*)
|
| 122 |
+
MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
|
| 123 |
+
case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
|
| 124 |
+
*AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
|
| 125 |
+
:Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
|
| 126 |
+
:Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
|
| 127 |
+
:Linux*x86_64*) distributionPlatform=linux-amd64 ;;
|
| 128 |
+
*)
|
| 129 |
+
echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
|
| 130 |
+
distributionPlatform=linux-amd64
|
| 131 |
+
;;
|
| 132 |
+
esac
|
| 133 |
+
distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
|
| 134 |
+
;;
|
| 135 |
+
maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
|
| 136 |
+
*) MVN_CMD="mvn${scriptName#mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
|
| 137 |
+
esac
|
| 138 |
+
|
| 139 |
+
# apply MVNW_REPOURL and calculate MAVEN_HOME
|
| 140 |
+
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
|
| 141 |
+
[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
|
| 142 |
+
distributionUrlName="${distributionUrl##*/}"
|
| 143 |
+
distributionUrlNameMain="${distributionUrlName%.*}"
|
| 144 |
+
distributionUrlNameMain="${distributionUrlNameMain%-bin}"
|
| 145 |
+
MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
|
| 146 |
+
MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
|
| 147 |
+
|
| 148 |
+
exec_maven() {
|
| 149 |
+
unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
|
| 150 |
+
exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
if [ -d "$MAVEN_HOME" ]; then
|
| 154 |
+
verbose "found existing MAVEN_HOME at $MAVEN_HOME"
|
| 155 |
+
exec_maven "$@"
|
| 156 |
+
fi
|
| 157 |
+
|
| 158 |
+
case "${distributionUrl-}" in
|
| 159 |
+
*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
|
| 160 |
+
*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
|
| 161 |
+
esac
|
| 162 |
+
|
| 163 |
+
# prepare tmp dir
|
| 164 |
+
if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
|
| 165 |
+
clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
|
| 166 |
+
trap clean HUP INT TERM EXIT
|
| 167 |
+
else
|
| 168 |
+
die "cannot create temp dir"
|
| 169 |
+
fi
|
| 170 |
+
|
| 171 |
+
mkdir -p -- "${MAVEN_HOME%/*}"
|
| 172 |
+
|
| 173 |
+
# Download and Install Apache Maven
|
| 174 |
+
verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
|
| 175 |
+
verbose "Downloading from: $distributionUrl"
|
| 176 |
+
verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
|
| 177 |
+
|
| 178 |
+
# select .zip or .tar.gz
|
| 179 |
+
if ! command -v unzip >/dev/null; then
|
| 180 |
+
distributionUrl="${distributionUrl%.zip}.tar.gz"
|
| 181 |
+
distributionUrlName="${distributionUrl##*/}"
|
| 182 |
+
fi
|
| 183 |
+
|
| 184 |
+
# verbose opt
|
| 185 |
+
__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
|
| 186 |
+
[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
|
| 187 |
+
|
| 188 |
+
# normalize http auth
|
| 189 |
+
case "${MVNW_PASSWORD:+has-password}" in
|
| 190 |
+
'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
|
| 191 |
+
has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
|
| 192 |
+
esac
|
| 193 |
+
|
| 194 |
+
if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
|
| 195 |
+
verbose "Found wget ... using wget"
|
| 196 |
+
wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
|
| 197 |
+
elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
|
| 198 |
+
verbose "Found curl ... using curl"
|
| 199 |
+
curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
|
| 200 |
+
elif set_java_home; then
|
| 201 |
+
verbose "Falling back to use Java to download"
|
| 202 |
+
javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
|
| 203 |
+
targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
|
| 204 |
+
cat >"$javaSource" <<-END
|
| 205 |
+
public class Downloader extends java.net.Authenticator
|
| 206 |
+
{
|
| 207 |
+
protected java.net.PasswordAuthentication getPasswordAuthentication()
|
| 208 |
+
{
|
| 209 |
+
return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
|
| 210 |
+
}
|
| 211 |
+
public static void main( String[] args ) throws Exception
|
| 212 |
+
{
|
| 213 |
+
setDefault( new Downloader() );
|
| 214 |
+
java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
|
| 215 |
+
}
|
| 216 |
+
}
|
| 217 |
+
END
|
| 218 |
+
# For Cygwin/MinGW, switch paths to Windows format before running javac and java
|
| 219 |
+
verbose " - Compiling Downloader.java ..."
|
| 220 |
+
"$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
|
| 221 |
+
verbose " - Running Downloader.java ..."
|
| 222 |
+
"$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
|
| 223 |
+
fi
|
| 224 |
+
|
| 225 |
+
# If specified, validate the SHA-256 sum of the Maven distribution zip file
|
| 226 |
+
if [ -n "${distributionSha256Sum-}" ]; then
|
| 227 |
+
distributionSha256Result=false
|
| 228 |
+
if [ "$MVN_CMD" = mvnd.sh ]; then
|
| 229 |
+
echo "Checksum validation is not supported for maven-mvnd." >&2
|
| 230 |
+
echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
|
| 231 |
+
exit 1
|
| 232 |
+
elif command -v sha256sum >/dev/null; then
|
| 233 |
+
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c - >/dev/null 2>&1; then
|
| 234 |
+
distributionSha256Result=true
|
| 235 |
+
fi
|
| 236 |
+
elif command -v shasum >/dev/null; then
|
| 237 |
+
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
|
| 238 |
+
distributionSha256Result=true
|
| 239 |
+
fi
|
| 240 |
+
else
|
| 241 |
+
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
|
| 242 |
+
echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
|
| 243 |
+
exit 1
|
| 244 |
+
fi
|
| 245 |
+
if [ $distributionSha256Result = false ]; then
|
| 246 |
+
echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
|
| 247 |
+
echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
|
| 248 |
+
exit 1
|
| 249 |
+
fi
|
| 250 |
+
fi
|
| 251 |
+
|
| 252 |
+
# unzip and move
|
| 253 |
+
if command -v unzip >/dev/null; then
|
| 254 |
+
unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
|
| 255 |
+
else
|
| 256 |
+
tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
|
| 257 |
+
fi
|
| 258 |
+
|
| 259 |
+
# Find the actual extracted directory name (handles snapshots where filename != directory name)
|
| 260 |
+
actualDistributionDir=""
|
| 261 |
+
|
| 262 |
+
# First try the expected directory name (for regular distributions)
|
| 263 |
+
if [ -d "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" ]; then
|
| 264 |
+
if [ -f "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/bin/$MVN_CMD" ]; then
|
| 265 |
+
actualDistributionDir="$distributionUrlNameMain"
|
| 266 |
+
fi
|
| 267 |
+
fi
|
| 268 |
+
|
| 269 |
+
# If not found, search for any directory with the Maven executable (for snapshots)
|
| 270 |
+
if [ -z "$actualDistributionDir" ]; then
|
| 271 |
+
# enable globbing to iterate over items
|
| 272 |
+
set +f
|
| 273 |
+
for dir in "$TMP_DOWNLOAD_DIR"/*; do
|
| 274 |
+
if [ -d "$dir" ]; then
|
| 275 |
+
if [ -f "$dir/bin/$MVN_CMD" ]; then
|
| 276 |
+
actualDistributionDir="$(basename "$dir")"
|
| 277 |
+
break
|
| 278 |
+
fi
|
| 279 |
+
fi
|
| 280 |
+
done
|
| 281 |
+
set -f
|
| 282 |
+
fi
|
| 283 |
+
|
| 284 |
+
if [ -z "$actualDistributionDir" ]; then
|
| 285 |
+
verbose "Contents of $TMP_DOWNLOAD_DIR:"
|
| 286 |
+
verbose "$(ls -la "$TMP_DOWNLOAD_DIR")"
|
| 287 |
+
die "Could not find Maven distribution directory in extracted archive"
|
| 288 |
+
fi
|
| 289 |
+
|
| 290 |
+
verbose "Found extracted Maven distribution directory: $actualDistributionDir"
|
| 291 |
+
printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$actualDistributionDir/mvnw.url"
|
| 292 |
+
mv -- "$TMP_DOWNLOAD_DIR/$actualDistributionDir" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
|
| 293 |
+
|
| 294 |
+
clean || :
|
| 295 |
+
exec_maven "$@"
|
benchmark/infrastructure/ejb-interceptor/quarkus/mvnw.cmd
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<# : batch portion
|
| 2 |
+
@REM ----------------------------------------------------------------------------
|
| 3 |
+
@REM Licensed to the Apache Software Foundation (ASF) under one
|
| 4 |
+
@REM or more contributor license agreements. See the NOTICE file
|
| 5 |
+
@REM distributed with this work for additional information
|
| 6 |
+
@REM regarding copyright ownership. The ASF licenses this file
|
| 7 |
+
@REM to you under the Apache License, Version 2.0 (the
|
| 8 |
+
@REM "License"); you may not use this file except in compliance
|
| 9 |
+
@REM with the License. You may obtain a copy of the License at
|
| 10 |
+
@REM
|
| 11 |
+
@REM http://www.apache.org/licenses/LICENSE-2.0
|
| 12 |
+
@REM
|
| 13 |
+
@REM Unless required by applicable law or agreed to in writing,
|
| 14 |
+
@REM software distributed under the License is distributed on an
|
| 15 |
+
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
| 16 |
+
@REM KIND, either express or implied. See the License for the
|
| 17 |
+
@REM specific language governing permissions and limitations
|
| 18 |
+
@REM under the License.
|
| 19 |
+
@REM ----------------------------------------------------------------------------
|
| 20 |
+
|
| 21 |
+
@REM ----------------------------------------------------------------------------
|
| 22 |
+
@REM Apache Maven Wrapper startup batch script, version 3.3.4
|
| 23 |
+
@REM
|
| 24 |
+
@REM Optional ENV vars
|
| 25 |
+
@REM MVNW_REPOURL - repo url base for downloading maven distribution
|
| 26 |
+
@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
|
| 27 |
+
@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output
|
| 28 |
+
@REM ----------------------------------------------------------------------------
|
| 29 |
+
|
| 30 |
+
@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
|
| 31 |
+
@SET __MVNW_CMD__=
|
| 32 |
+
@SET __MVNW_ERROR__=
|
| 33 |
+
@SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
|
| 34 |
+
@SET PSModulePath=
|
| 35 |
+
@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
|
| 36 |
+
IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
|
| 37 |
+
)
|
| 38 |
+
@SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
|
| 39 |
+
@SET __MVNW_PSMODULEP_SAVE=
|
| 40 |
+
@SET __MVNW_ARG0_NAME__=
|
| 41 |
+
@SET MVNW_USERNAME=
|
| 42 |
+
@SET MVNW_PASSWORD=
|
| 43 |
+
@IF NOT "%__MVNW_CMD__%"=="" ("%__MVNW_CMD__%" %*)
|
| 44 |
+
@echo Cannot start maven from wrapper >&2 && exit /b 1
|
| 45 |
+
@GOTO :EOF
|
| 46 |
+
: end batch / begin powershell #>
|
| 47 |
+
|
| 48 |
+
$ErrorActionPreference = "Stop"
|
| 49 |
+
if ($env:MVNW_VERBOSE -eq "true") {
|
| 50 |
+
$VerbosePreference = "Continue"
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
|
| 54 |
+
$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
|
| 55 |
+
if (!$distributionUrl) {
|
| 56 |
+
Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
|
| 60 |
+
"maven-mvnd-*" {
|
| 61 |
+
$USE_MVND = $true
|
| 62 |
+
$distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
|
| 63 |
+
$MVN_CMD = "mvnd.cmd"
|
| 64 |
+
break
|
| 65 |
+
}
|
| 66 |
+
default {
|
| 67 |
+
$USE_MVND = $false
|
| 68 |
+
$MVN_CMD = $script -replace '^mvnw','mvn'
|
| 69 |
+
break
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
# apply MVNW_REPOURL and calculate MAVEN_HOME
|
| 74 |
+
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
|
| 75 |
+
if ($env:MVNW_REPOURL) {
|
| 76 |
+
$MVNW_REPO_PATTERN = if ($USE_MVND -eq $False) { "/org/apache/maven/" } else { "/maven/mvnd/" }
|
| 77 |
+
$distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace "^.*$MVNW_REPO_PATTERN",'')"
|
| 78 |
+
}
|
| 79 |
+
$distributionUrlName = $distributionUrl -replace '^.*/',''
|
| 80 |
+
$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
|
| 81 |
+
|
| 82 |
+
$MAVEN_M2_PATH = "$HOME/.m2"
|
| 83 |
+
if ($env:MAVEN_USER_HOME) {
|
| 84 |
+
$MAVEN_M2_PATH = "$env:MAVEN_USER_HOME"
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
if (-not (Test-Path -Path $MAVEN_M2_PATH)) {
|
| 88 |
+
New-Item -Path $MAVEN_M2_PATH -ItemType Directory | Out-Null
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
$MAVEN_WRAPPER_DISTS = $null
|
| 92 |
+
if ((Get-Item $MAVEN_M2_PATH).Target[0] -eq $null) {
|
| 93 |
+
$MAVEN_WRAPPER_DISTS = "$MAVEN_M2_PATH/wrapper/dists"
|
| 94 |
+
} else {
|
| 95 |
+
$MAVEN_WRAPPER_DISTS = (Get-Item $MAVEN_M2_PATH).Target[0] + "/wrapper/dists"
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
$MAVEN_HOME_PARENT = "$MAVEN_WRAPPER_DISTS/$distributionUrlNameMain"
|
| 99 |
+
$MAVEN_HOME_NAME = ([System.Security.Cryptography.SHA256]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
|
| 100 |
+
$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
|
| 101 |
+
|
| 102 |
+
if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
|
| 103 |
+
Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
|
| 104 |
+
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
|
| 105 |
+
exit $?
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
|
| 109 |
+
Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
# prepare tmp dir
|
| 113 |
+
$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
|
| 114 |
+
$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
|
| 115 |
+
$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
|
| 116 |
+
trap {
|
| 117 |
+
if ($TMP_DOWNLOAD_DIR.Exists) {
|
| 118 |
+
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
|
| 119 |
+
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
|
| 120 |
+
}
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null
|
| 124 |
+
|
| 125 |
+
# Download and Install Apache Maven
|
| 126 |
+
Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
|
| 127 |
+
Write-Verbose "Downloading from: $distributionUrl"
|
| 128 |
+
Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
|
| 129 |
+
|
| 130 |
+
$webclient = New-Object System.Net.WebClient
|
| 131 |
+
if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
|
| 132 |
+
$webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
|
| 133 |
+
}
|
| 134 |
+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
| 135 |
+
$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null
|
| 136 |
+
|
| 137 |
+
# If specified, validate the SHA-256 sum of the Maven distribution zip file
|
| 138 |
+
$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
|
| 139 |
+
if ($distributionSha256Sum) {
|
| 140 |
+
if ($USE_MVND) {
|
| 141 |
+
Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
|
| 142 |
+
}
|
| 143 |
+
Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
|
| 144 |
+
if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
|
| 145 |
+
Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
|
| 146 |
+
}
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
# unzip and move
|
| 150 |
+
Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
|
| 151 |
+
|
| 152 |
+
# Find the actual extracted directory name (handles snapshots where filename != directory name)
|
| 153 |
+
$actualDistributionDir = ""
|
| 154 |
+
|
| 155 |
+
# First try the expected directory name (for regular distributions)
|
| 156 |
+
$expectedPath = Join-Path "$TMP_DOWNLOAD_DIR" "$distributionUrlNameMain"
|
| 157 |
+
$expectedMvnPath = Join-Path "$expectedPath" "bin/$MVN_CMD"
|
| 158 |
+
if ((Test-Path -Path $expectedPath -PathType Container) -and (Test-Path -Path $expectedMvnPath -PathType Leaf)) {
|
| 159 |
+
$actualDistributionDir = $distributionUrlNameMain
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
# If not found, search for any directory with the Maven executable (for snapshots)
|
| 163 |
+
if (!$actualDistributionDir) {
|
| 164 |
+
Get-ChildItem -Path "$TMP_DOWNLOAD_DIR" -Directory | ForEach-Object {
|
| 165 |
+
$testPath = Join-Path $_.FullName "bin/$MVN_CMD"
|
| 166 |
+
if (Test-Path -Path $testPath -PathType Leaf) {
|
| 167 |
+
$actualDistributionDir = $_.Name
|
| 168 |
+
}
|
| 169 |
+
}
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
if (!$actualDistributionDir) {
|
| 173 |
+
Write-Error "Could not find Maven distribution directory in extracted archive"
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
Write-Verbose "Found extracted Maven distribution directory: $actualDistributionDir"
|
| 177 |
+
Rename-Item -Path "$TMP_DOWNLOAD_DIR/$actualDistributionDir" -NewName $MAVEN_HOME_NAME | Out-Null
|
| 178 |
+
try {
|
| 179 |
+
Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
|
| 180 |
+
} catch {
|
| 181 |
+
if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
|
| 182 |
+
Write-Error "fail to move MAVEN_HOME"
|
| 183 |
+
}
|
| 184 |
+
} finally {
|
| 185 |
+
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
|
| 186 |
+
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
|
benchmark/infrastructure/ejb-interceptor/quarkus/pom.xml
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
| 2 |
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
| 3 |
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
| 4 |
+
<modelVersion>4.0.0</modelVersion>
|
| 5 |
+
|
| 6 |
+
<groupId>jakarta.tutorial.interceptor</groupId>
|
| 7 |
+
<artifactId>interceptor-quarkus</artifactId>
|
| 8 |
+
<version>1.0.0-SNAPSHOT</version>
|
| 9 |
+
|
| 10 |
+
<properties>
|
| 11 |
+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
| 12 |
+
<maven.compiler.release>17</maven.compiler.release>
|
| 13 |
+
|
| 14 |
+
<!-- Use the PLATFORM BOM -->
|
| 15 |
+
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
|
| 16 |
+
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
|
| 17 |
+
<quarkus.platform.version>3.30.5</quarkus.platform.version>
|
| 18 |
+
</properties>
|
| 19 |
+
|
| 20 |
+
<dependencyManagement>
|
| 21 |
+
<dependencies>
|
| 22 |
+
<dependency>
|
| 23 |
+
<groupId>${quarkus.platform.group-id}</groupId>
|
| 24 |
+
<artifactId>${quarkus.platform.artifact-id}</artifactId>
|
| 25 |
+
<version>${quarkus.platform.version}</version>
|
| 26 |
+
<type>pom</type>
|
| 27 |
+
<scope>import</scope>
|
| 28 |
+
</dependency>
|
| 29 |
+
</dependencies>
|
| 30 |
+
</dependencyManagement>
|
| 31 |
+
|
| 32 |
+
<dependencies>
|
| 33 |
+
<!-- CDI / Interceptors -->
|
| 34 |
+
<dependency>
|
| 35 |
+
<groupId>io.quarkus</groupId>
|
| 36 |
+
<artifactId>quarkus-arc</artifactId>
|
| 37 |
+
</dependency>
|
| 38 |
+
|
| 39 |
+
<dependency>
|
| 40 |
+
<groupId>io.quarkus</groupId>
|
| 41 |
+
<artifactId>quarkus-rest</artifactId>
|
| 42 |
+
</dependency>
|
| 43 |
+
|
| 44 |
+
<dependency>
|
| 45 |
+
<groupId>org.apache.myfaces.core.extensions.quarkus</groupId>
|
| 46 |
+
<artifactId>myfaces-quarkus</artifactId>
|
| 47 |
+
<version>4.1.2</version>
|
| 48 |
+
</dependency>
|
| 49 |
+
|
| 50 |
+
<!-- Tests -->
|
| 51 |
+
<dependency>
|
| 52 |
+
<groupId>io.quarkus</groupId>
|
| 53 |
+
<artifactId>quarkus-junit5</artifactId>
|
| 54 |
+
<scope>test</scope>
|
| 55 |
+
</dependency>
|
| 56 |
+
<dependency>
|
| 57 |
+
<groupId>io.rest-assured</groupId>
|
| 58 |
+
<artifactId>rest-assured</artifactId>
|
| 59 |
+
<scope>test</scope>
|
| 60 |
+
</dependency>
|
| 61 |
+
</dependencies>
|
| 62 |
+
|
| 63 |
+
<build>
|
| 64 |
+
<plugins>
|
| 65 |
+
<plugin>
|
| 66 |
+
<groupId>io.quarkus</groupId>
|
| 67 |
+
<artifactId>quarkus-maven-plugin</artifactId>
|
| 68 |
+
<version>${quarkus.platform.version}</version>
|
| 69 |
+
<executions>
|
| 70 |
+
<execution>
|
| 71 |
+
<goals>
|
| 72 |
+
<goal>generate-code</goal>
|
| 73 |
+
<goal>generate-code-tests</goal>
|
| 74 |
+
<goal>build</goal>
|
| 75 |
+
</goals>
|
| 76 |
+
</execution>
|
| 77 |
+
</executions>
|
| 78 |
+
</plugin>
|
| 79 |
+
|
| 80 |
+
<plugin>
|
| 81 |
+
<groupId>org.apache.maven.plugins</groupId>
|
| 82 |
+
<artifactId>maven-compiler-plugin</artifactId>
|
| 83 |
+
<version>3.11.0</version>
|
| 84 |
+
<configuration>
|
| 85 |
+
<release>${maven.compiler.release}</release>
|
| 86 |
+
</configuration>
|
| 87 |
+
</plugin>
|
| 88 |
+
</plugins>
|
| 89 |
+
</build>
|
| 90 |
+
</project>
|
benchmark/infrastructure/ejb-interceptor/quarkus/test.sh
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
set -euo pipefail
|
| 3 |
+
|
| 4 |
+
BASE_URL="${BASE_URL:-http://localhost:9080}"
|
| 5 |
+
|
| 6 |
+
echo "Health check: ${BASE_URL}/"
|
| 7 |
+
HTTP_STATUS=$(curl -sL -o /dev/null -w "%{http_code}" "${BASE_URL}/")
|
| 8 |
+
|
| 9 |
+
if [ "$HTTP_STATUS" -eq 200 ]; then
|
| 10 |
+
echo "PASS - got HTTP ${HTTP_STATUS}"
|
| 11 |
+
exit 0
|
| 12 |
+
else
|
| 13 |
+
echo "FAIL - got HTTP ${HTTP_STATUS}"
|
| 14 |
+
exit 1
|
| 15 |
+
fi
|
benchmark/infrastructure/ejb-interceptor/spring/.dockerignore
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# VCS
|
| 2 |
+
.git/
|
| 3 |
+
|
| 4 |
+
# Maven
|
| 5 |
+
.mvn/
|
| 6 |
+
**/.mvn/
|
| 7 |
+
mvnw
|
| 8 |
+
mvnw.cmd
|
| 9 |
+
**/mvnw
|
| 10 |
+
**/mvnw.cmd
|
| 11 |
+
target/
|
| 12 |
+
**/target/
|
| 13 |
+
pom.xml.tag
|
| 14 |
+
pom.xml.releaseBackup
|
| 15 |
+
pom.xml.versionsBackup
|
| 16 |
+
pom.xml.next
|
| 17 |
+
release.properties
|
| 18 |
+
dependency-reduced-pom.xml
|
| 19 |
+
buildNumber.properties
|
| 20 |
+
|
| 21 |
+
# IDE / Editor
|
| 22 |
+
.vscode/
|
| 23 |
+
**/.vscode/
|
| 24 |
+
.zed/
|
| 25 |
+
**/.zed/
|
| 26 |
+
.idea/
|
| 27 |
+
**/.idea/
|
| 28 |
+
*.iml
|
| 29 |
+
*.ipr
|
| 30 |
+
*.iws
|
| 31 |
+
|
| 32 |
+
# OS
|
| 33 |
+
.DS_Store
|
| 34 |
+
**/.DS_Store
|
| 35 |
+
Thumbs.db
|
| 36 |
+
ehthumbs.db
|
| 37 |
+
|
| 38 |
+
# Logs / temp
|
| 39 |
+
*.log
|
| 40 |
+
*.tmp
|
| 41 |
+
*.temp
|
benchmark/infrastructure/ejb-interceptor/spring/Dockerfile
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM maven:3.9.12-ibm-semeru-21-noble
|
| 2 |
+
|
| 3 |
+
USER root
|
| 4 |
+
# install uv
|
| 5 |
+
RUN apt-get update && apt-get install -y --no-install-recommends curl python3-venv python3-full && curl -LsSf https://astral.sh/uv/install.sh | sh
|
| 6 |
+
|
| 7 |
+
ENV PATH="/root/.local/bin:$PATH"
|
| 8 |
+
|
| 9 |
+
# Shared browsers path so Chromium is cached once
|
| 10 |
+
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
|
| 11 |
+
RUN mkdir -p /ms-playwright && chmod 755 /ms-playwright
|
| 12 |
+
|
| 13 |
+
# create venv and install
|
| 14 |
+
RUN uv venv /opt/venv && uv pip install --python /opt/venv/bin/python playwright==1.47.0 pytest
|
| 15 |
+
|
| 16 |
+
ENV PATH="/opt/venv/bin:$PATH"
|
| 17 |
+
RUN playwright install --with-deps chromium
|
| 18 |
+
|
| 19 |
+
# Set working directory
|
| 20 |
+
WORKDIR /app
|
| 21 |
+
|
| 22 |
+
# Copy all the assets
|
| 23 |
+
COPY . .
|
| 24 |
+
|
| 25 |
+
COPY test.sh .
|
| 26 |
+
RUN chmod +x test.sh
|
| 27 |
+
|
| 28 |
+
# Build application at image build time
|
| 29 |
+
RUN mvn clean install -DskipTests
|
| 30 |
+
|
| 31 |
+
CMD ["mvn", "spring-boot:run"]
|
benchmark/infrastructure/ejb-timersession/jakarta/.dockerignore
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# VCS
|
| 2 |
+
.git/
|
| 3 |
+
|
| 4 |
+
# Maven
|
| 5 |
+
.mvn/
|
| 6 |
+
**/.mvn/
|
| 7 |
+
mvnw
|
| 8 |
+
mvnw.cmd
|
| 9 |
+
**/mvnw
|
| 10 |
+
**/mvnw.cmd
|
| 11 |
+
target/
|
| 12 |
+
**/target/
|
| 13 |
+
pom.xml.tag
|
| 14 |
+
pom.xml.releaseBackup
|
| 15 |
+
pom.xml.versionsBackup
|
| 16 |
+
pom.xml.next
|
| 17 |
+
release.properties
|
| 18 |
+
dependency-reduced-pom.xml
|
| 19 |
+
buildNumber.properties
|
| 20 |
+
|
| 21 |
+
# IDE / Editor
|
| 22 |
+
.vscode/
|
| 23 |
+
**/.vscode/
|
| 24 |
+
.zed/
|
| 25 |
+
**/.zed/
|
| 26 |
+
.idea/
|
| 27 |
+
**/.idea/
|
| 28 |
+
*.iml
|
| 29 |
+
*.ipr
|
| 30 |
+
*.iws
|
| 31 |
+
|
| 32 |
+
# OS
|
| 33 |
+
.DS_Store
|
| 34 |
+
**/.DS_Store
|
| 35 |
+
Thumbs.db
|
| 36 |
+
ehthumbs.db
|
| 37 |
+
|
| 38 |
+
# Logs / temp
|
| 39 |
+
*.log
|
| 40 |
+
*.tmp
|
| 41 |
+
*.temp
|
benchmark/infrastructure/ejb-timersession/jakarta/.mvn/wrapper/maven-wrapper.properties
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Licensed to the Apache Software Foundation (ASF) under one
|
| 2 |
+
# or more contributor license agreements. See the NOTICE file
|
| 3 |
+
# distributed with this work for additional information
|
| 4 |
+
# regarding copyright ownership. The ASF licenses this file
|
| 5 |
+
# to you under the Apache License, Version 2.0 (the
|
| 6 |
+
# "License"); you may not use this file except in compliance
|
| 7 |
+
# with the License. You may obtain a copy of the License at
|
| 8 |
+
#
|
| 9 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
#
|
| 11 |
+
# Unless required by applicable law or agreed to in writing,
|
| 12 |
+
# software distributed under the License is distributed on an
|
| 13 |
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
| 14 |
+
# KIND, either express or implied. See the License for the
|
| 15 |
+
# specific language governing permissions and limitations
|
| 16 |
+
# under the License.
|
| 17 |
+
wrapperVersion=3.3.2
|
| 18 |
+
distributionType=only-script
|
| 19 |
+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
|
benchmark/infrastructure/ejb-timersession/jakarta/Dockerfile
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM maven:3.9.12-ibm-semeru-21-noble
|
| 2 |
+
|
| 3 |
+
USER root
|
| 4 |
+
# install uv
|
| 5 |
+
RUN apt-get update && apt-get install -y --no-install-recommends curl python3-venv python3-full && curl -LsSf https://astral.sh/uv/install.sh | sh
|
| 6 |
+
|
| 7 |
+
ENV PATH="/root/.local/bin:$PATH"
|
| 8 |
+
|
| 9 |
+
# Shared browsers path so Chromium is cached once
|
| 10 |
+
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
|
| 11 |
+
RUN mkdir -p /ms-playwright && chmod 755 /ms-playwright
|
| 12 |
+
|
| 13 |
+
# create venv and install
|
| 14 |
+
RUN uv venv /opt/venv && uv pip install --python /opt/venv/bin/python playwright==1.47.0 pytest
|
| 15 |
+
|
| 16 |
+
ENV PATH="/opt/venv/bin:$PATH"
|
| 17 |
+
RUN playwright install --with-deps chromium
|
| 18 |
+
|
| 19 |
+
# Set working directory
|
| 20 |
+
WORKDIR /app
|
| 21 |
+
|
| 22 |
+
# Copy all the assets
|
| 23 |
+
COPY . .
|
| 24 |
+
|
| 25 |
+
COPY test.sh .
|
| 26 |
+
RUN chmod +x test.sh
|
| 27 |
+
RUN mvn clean install -DskipTests
|
| 28 |
+
CMD [ "mvn", "liberty:run" ]
|
benchmark/infrastructure/ejb-timersession/jakarta/mvnw
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
# ----------------------------------------------------------------------------
|
| 3 |
+
# Licensed to the Apache Software Foundation (ASF) under one
|
| 4 |
+
# or more contributor license agreements. See the NOTICE file
|
| 5 |
+
# distributed with this work for additional information
|
| 6 |
+
# regarding copyright ownership. The ASF licenses this file
|
| 7 |
+
# to you under the Apache License, Version 2.0 (the
|
| 8 |
+
# "License"); you may not use this file except in compliance
|
| 9 |
+
# with the License. You may obtain a copy of the License at
|
| 10 |
+
#
|
| 11 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 12 |
+
#
|
| 13 |
+
# Unless required by applicable law or agreed to in writing,
|
| 14 |
+
# software distributed under the License is distributed on an
|
| 15 |
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
| 16 |
+
# KIND, either express or implied. See the License for the
|
| 17 |
+
# specific language governing permissions and limitations
|
| 18 |
+
# under the License.
|
| 19 |
+
# ----------------------------------------------------------------------------
|
| 20 |
+
|
| 21 |
+
# ----------------------------------------------------------------------------
|
| 22 |
+
# Apache Maven Wrapper startup batch script, version 3.3.2
|
| 23 |
+
#
|
| 24 |
+
# Optional ENV vars
|
| 25 |
+
# -----------------
|
| 26 |
+
# JAVA_HOME - location of a JDK home dir, required when download maven via java source
|
| 27 |
+
# MVNW_REPOURL - repo url base for downloading maven distribution
|
| 28 |
+
# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
|
| 29 |
+
# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
|
| 30 |
+
# ----------------------------------------------------------------------------
|
| 31 |
+
|
| 32 |
+
set -euf
|
| 33 |
+
[ "${MVNW_VERBOSE-}" != debug ] || set -x
|
| 34 |
+
|
| 35 |
+
# OS specific support.
|
| 36 |
+
native_path() { printf %s\\n "$1"; }
|
| 37 |
+
case "$(uname)" in
|
| 38 |
+
CYGWIN* | MINGW*)
|
| 39 |
+
[ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
|
| 40 |
+
native_path() { cygpath --path --windows "$1"; }
|
| 41 |
+
;;
|
| 42 |
+
esac
|
| 43 |
+
|
| 44 |
+
# set JAVACMD and JAVACCMD
|
| 45 |
+
set_java_home() {
|
| 46 |
+
# For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
|
| 47 |
+
if [ -n "${JAVA_HOME-}" ]; then
|
| 48 |
+
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
|
| 49 |
+
# IBM's JDK on AIX uses strange locations for the executables
|
| 50 |
+
JAVACMD="$JAVA_HOME/jre/sh/java"
|
| 51 |
+
JAVACCMD="$JAVA_HOME/jre/sh/javac"
|
| 52 |
+
else
|
| 53 |
+
JAVACMD="$JAVA_HOME/bin/java"
|
| 54 |
+
JAVACCMD="$JAVA_HOME/bin/javac"
|
| 55 |
+
|
| 56 |
+
if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
|
| 57 |
+
echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
|
| 58 |
+
echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
|
| 59 |
+
return 1
|
| 60 |
+
fi
|
| 61 |
+
fi
|
| 62 |
+
else
|
| 63 |
+
JAVACMD="$(
|
| 64 |
+
'set' +e
|
| 65 |
+
'unset' -f command 2>/dev/null
|
| 66 |
+
'command' -v java
|
| 67 |
+
)" || :
|
| 68 |
+
JAVACCMD="$(
|
| 69 |
+
'set' +e
|
| 70 |
+
'unset' -f command 2>/dev/null
|
| 71 |
+
'command' -v javac
|
| 72 |
+
)" || :
|
| 73 |
+
|
| 74 |
+
if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
|
| 75 |
+
echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
|
| 76 |
+
return 1
|
| 77 |
+
fi
|
| 78 |
+
fi
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
# hash string like Java String::hashCode
|
| 82 |
+
hash_string() {
|
| 83 |
+
str="${1:-}" h=0
|
| 84 |
+
while [ -n "$str" ]; do
|
| 85 |
+
char="${str%"${str#?}"}"
|
| 86 |
+
h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
|
| 87 |
+
str="${str#?}"
|
| 88 |
+
done
|
| 89 |
+
printf %x\\n $h
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
verbose() { :; }
|
| 93 |
+
[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
|
| 94 |
+
|
| 95 |
+
die() {
|
| 96 |
+
printf %s\\n "$1" >&2
|
| 97 |
+
exit 1
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
trim() {
|
| 101 |
+
# MWRAPPER-139:
|
| 102 |
+
# Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
|
| 103 |
+
# Needed for removing poorly interpreted newline sequences when running in more
|
| 104 |
+
# exotic environments such as mingw bash on Windows.
|
| 105 |
+
printf "%s" "${1}" | tr -d '[:space:]'
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
|
| 109 |
+
while IFS="=" read -r key value; do
|
| 110 |
+
case "${key-}" in
|
| 111 |
+
distributionUrl) distributionUrl=$(trim "${value-}") ;;
|
| 112 |
+
distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
|
| 113 |
+
esac
|
| 114 |
+
done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
|
| 115 |
+
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties"
|
| 116 |
+
|
| 117 |
+
case "${distributionUrl##*/}" in
|
| 118 |
+
maven-mvnd-*bin.*)
|
| 119 |
+
MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
|
| 120 |
+
case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
|
| 121 |
+
*AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
|
| 122 |
+
:Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
|
| 123 |
+
:Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
|
| 124 |
+
:Linux*x86_64*) distributionPlatform=linux-amd64 ;;
|
| 125 |
+
*)
|
| 126 |
+
echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
|
| 127 |
+
distributionPlatform=linux-amd64
|
| 128 |
+
;;
|
| 129 |
+
esac
|
| 130 |
+
distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
|
| 131 |
+
;;
|
| 132 |
+
maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
|
| 133 |
+
*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
|
| 134 |
+
esac
|
| 135 |
+
|
| 136 |
+
# apply MVNW_REPOURL and calculate MAVEN_HOME
|
| 137 |
+
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
|
| 138 |
+
[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
|
| 139 |
+
distributionUrlName="${distributionUrl##*/}"
|
| 140 |
+
distributionUrlNameMain="${distributionUrlName%.*}"
|
| 141 |
+
distributionUrlNameMain="${distributionUrlNameMain%-bin}"
|
| 142 |
+
MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
|
| 143 |
+
MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
|
| 144 |
+
|
| 145 |
+
exec_maven() {
|
| 146 |
+
unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
|
| 147 |
+
exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
if [ -d "$MAVEN_HOME" ]; then
|
| 151 |
+
verbose "found existing MAVEN_HOME at $MAVEN_HOME"
|
| 152 |
+
exec_maven "$@"
|
| 153 |
+
fi
|
| 154 |
+
|
| 155 |
+
case "${distributionUrl-}" in
|
| 156 |
+
*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
|
| 157 |
+
*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
|
| 158 |
+
esac
|
| 159 |
+
|
| 160 |
+
# prepare tmp dir
|
| 161 |
+
if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
|
| 162 |
+
clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
|
| 163 |
+
trap clean HUP INT TERM EXIT
|
| 164 |
+
else
|
| 165 |
+
die "cannot create temp dir"
|
| 166 |
+
fi
|
| 167 |
+
|
| 168 |
+
mkdir -p -- "${MAVEN_HOME%/*}"
|
| 169 |
+
|
| 170 |
+
# Download and Install Apache Maven
|
| 171 |
+
verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
|
| 172 |
+
verbose "Downloading from: $distributionUrl"
|
| 173 |
+
verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
|
| 174 |
+
|
| 175 |
+
# select .zip or .tar.gz
|
| 176 |
+
if ! command -v unzip >/dev/null; then
|
| 177 |
+
distributionUrl="${distributionUrl%.zip}.tar.gz"
|
| 178 |
+
distributionUrlName="${distributionUrl##*/}"
|
| 179 |
+
fi
|
| 180 |
+
|
| 181 |
+
# verbose opt
|
| 182 |
+
__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
|
| 183 |
+
[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
|
| 184 |
+
|
| 185 |
+
# normalize http auth
|
| 186 |
+
case "${MVNW_PASSWORD:+has-password}" in
|
| 187 |
+
'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
|
| 188 |
+
has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
|
| 189 |
+
esac
|
| 190 |
+
|
| 191 |
+
if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
|
| 192 |
+
verbose "Found wget ... using wget"
|
| 193 |
+
wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
|
| 194 |
+
elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
|
| 195 |
+
verbose "Found curl ... using curl"
|
| 196 |
+
curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
|
| 197 |
+
elif set_java_home; then
|
| 198 |
+
verbose "Falling back to use Java to download"
|
| 199 |
+
javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
|
| 200 |
+
targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
|
| 201 |
+
cat >"$javaSource" <<-END
|
| 202 |
+
public class Downloader extends java.net.Authenticator
|
| 203 |
+
{
|
| 204 |
+
protected java.net.PasswordAuthentication getPasswordAuthentication()
|
| 205 |
+
{
|
| 206 |
+
return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
|
| 207 |
+
}
|
| 208 |
+
public static void main( String[] args ) throws Exception
|
| 209 |
+
{
|
| 210 |
+
setDefault( new Downloader() );
|
| 211 |
+
java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
|
| 212 |
+
}
|
| 213 |
+
}
|
| 214 |
+
END
|
| 215 |
+
# For Cygwin/MinGW, switch paths to Windows format before running javac and java
|
| 216 |
+
verbose " - Compiling Downloader.java ..."
|
| 217 |
+
"$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
|
| 218 |
+
verbose " - Running Downloader.java ..."
|
| 219 |
+
"$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
|
| 220 |
+
fi
|
| 221 |
+
|
| 222 |
+
# If specified, validate the SHA-256 sum of the Maven distribution zip file
|
| 223 |
+
if [ -n "${distributionSha256Sum-}" ]; then
|
| 224 |
+
distributionSha256Result=false
|
| 225 |
+
if [ "$MVN_CMD" = mvnd.sh ]; then
|
| 226 |
+
echo "Checksum validation is not supported for maven-mvnd." >&2
|
| 227 |
+
echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
|
| 228 |
+
exit 1
|
| 229 |
+
elif command -v sha256sum >/dev/null; then
|
| 230 |
+
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then
|
| 231 |
+
distributionSha256Result=true
|
| 232 |
+
fi
|
| 233 |
+
elif command -v shasum >/dev/null; then
|
| 234 |
+
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
|
| 235 |
+
distributionSha256Result=true
|
| 236 |
+
fi
|
| 237 |
+
else
|
| 238 |
+
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
|
| 239 |
+
echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
|
| 240 |
+
exit 1
|
| 241 |
+
fi
|
| 242 |
+
if [ $distributionSha256Result = false ]; then
|
| 243 |
+
echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
|
| 244 |
+
echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
|
| 245 |
+
exit 1
|
| 246 |
+
fi
|
| 247 |
+
fi
|
| 248 |
+
|
| 249 |
+
# unzip and move
|
| 250 |
+
if command -v unzip >/dev/null; then
|
| 251 |
+
unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
|
| 252 |
+
else
|
| 253 |
+
tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
|
| 254 |
+
fi
|
| 255 |
+
printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url"
|
| 256 |
+
mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
|
| 257 |
+
|
| 258 |
+
clean || :
|
| 259 |
+
exec_maven "$@"
|
benchmark/infrastructure/ejb-timersession/jakarta/mvnw.cmd
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<# : batch portion
|
| 2 |
+
@REM ----------------------------------------------------------------------------
|
| 3 |
+
@REM Licensed to the Apache Software Foundation (ASF) under one
|
| 4 |
+
@REM or more contributor license agreements. See the NOTICE file
|
| 5 |
+
@REM distributed with this work for additional information
|
| 6 |
+
@REM regarding copyright ownership. The ASF licenses this file
|
| 7 |
+
@REM to you under the Apache License, Version 2.0 (the
|
| 8 |
+
@REM "License"); you may not use this file except in compliance
|
| 9 |
+
@REM with the License. You may obtain a copy of the License at
|
| 10 |
+
@REM
|
| 11 |
+
@REM http://www.apache.org/licenses/LICENSE-2.0
|
| 12 |
+
@REM
|
| 13 |
+
@REM Unless required by applicable law or agreed to in writing,
|
| 14 |
+
@REM software distributed under the License is distributed on an
|
| 15 |
+
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
| 16 |
+
@REM KIND, either express or implied. See the License for the
|
| 17 |
+
@REM specific language governing permissions and limitations
|
| 18 |
+
@REM under the License.
|
| 19 |
+
@REM ----------------------------------------------------------------------------
|
| 20 |
+
|
| 21 |
+
@REM ----------------------------------------------------------------------------
|
| 22 |
+
@REM Apache Maven Wrapper startup batch script, version 3.3.2
|
| 23 |
+
@REM
|
| 24 |
+
@REM Optional ENV vars
|
| 25 |
+
@REM MVNW_REPOURL - repo url base for downloading maven distribution
|
| 26 |
+
@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
|
| 27 |
+
@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output
|
| 28 |
+
@REM ----------------------------------------------------------------------------
|
| 29 |
+
|
| 30 |
+
@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
|
| 31 |
+
@SET __MVNW_CMD__=
|
| 32 |
+
@SET __MVNW_ERROR__=
|
| 33 |
+
@SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
|
| 34 |
+
@SET PSModulePath=
|
| 35 |
+
@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
|
| 36 |
+
IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
|
| 37 |
+
)
|
| 38 |
+
@SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
|
| 39 |
+
@SET __MVNW_PSMODULEP_SAVE=
|
| 40 |
+
@SET __MVNW_ARG0_NAME__=
|
| 41 |
+
@SET MVNW_USERNAME=
|
| 42 |
+
@SET MVNW_PASSWORD=
|
| 43 |
+
@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*)
|
| 44 |
+
@echo Cannot start maven from wrapper >&2 && exit /b 1
|
| 45 |
+
@GOTO :EOF
|
| 46 |
+
: end batch / begin powershell #>
|
| 47 |
+
|
| 48 |
+
$ErrorActionPreference = "Stop"
|
| 49 |
+
if ($env:MVNW_VERBOSE -eq "true") {
|
| 50 |
+
$VerbosePreference = "Continue"
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
|
| 54 |
+
$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
|
| 55 |
+
if (!$distributionUrl) {
|
| 56 |
+
Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
|
| 60 |
+
"maven-mvnd-*" {
|
| 61 |
+
$USE_MVND = $true
|
| 62 |
+
$distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
|
| 63 |
+
$MVN_CMD = "mvnd.cmd"
|
| 64 |
+
break
|
| 65 |
+
}
|
| 66 |
+
default {
|
| 67 |
+
$USE_MVND = $false
|
| 68 |
+
$MVN_CMD = $script -replace '^mvnw','mvn'
|
| 69 |
+
break
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
# apply MVNW_REPOURL and calculate MAVEN_HOME
|
| 74 |
+
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
|
| 75 |
+
if ($env:MVNW_REPOURL) {
|
| 76 |
+
$MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" }
|
| 77 |
+
$distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')"
|
| 78 |
+
}
|
| 79 |
+
$distributionUrlName = $distributionUrl -replace '^.*/',''
|
| 80 |
+
$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
|
| 81 |
+
$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain"
|
| 82 |
+
if ($env:MAVEN_USER_HOME) {
|
| 83 |
+
$MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain"
|
| 84 |
+
}
|
| 85 |
+
$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
|
| 86 |
+
$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
|
| 87 |
+
|
| 88 |
+
if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
|
| 89 |
+
Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
|
| 90 |
+
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
|
| 91 |
+
exit $?
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
|
| 95 |
+
Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
# prepare tmp dir
|
| 99 |
+
$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
|
| 100 |
+
$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
|
| 101 |
+
$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
|
| 102 |
+
trap {
|
| 103 |
+
if ($TMP_DOWNLOAD_DIR.Exists) {
|
| 104 |
+
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
|
| 105 |
+
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
|
| 106 |
+
}
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null
|
| 110 |
+
|
| 111 |
+
# Download and Install Apache Maven
|
| 112 |
+
Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
|
| 113 |
+
Write-Verbose "Downloading from: $distributionUrl"
|
| 114 |
+
Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
|
| 115 |
+
|
| 116 |
+
$webclient = New-Object System.Net.WebClient
|
| 117 |
+
if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
|
| 118 |
+
$webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
|
| 119 |
+
}
|
| 120 |
+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
| 121 |
+
$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null
|
| 122 |
+
|
| 123 |
+
# If specified, validate the SHA-256 sum of the Maven distribution zip file
|
| 124 |
+
$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
|
| 125 |
+
if ($distributionSha256Sum) {
|
| 126 |
+
if ($USE_MVND) {
|
| 127 |
+
Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
|
| 128 |
+
}
|
| 129 |
+
Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
|
| 130 |
+
if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
|
| 131 |
+
Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
|
| 132 |
+
}
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
# unzip and move
|
| 136 |
+
Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
|
| 137 |
+
Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null
|
| 138 |
+
try {
|
| 139 |
+
Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
|
| 140 |
+
} catch {
|
| 141 |
+
if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
|
| 142 |
+
Write-Error "fail to move MAVEN_HOME"
|
| 143 |
+
}
|
| 144 |
+
} finally {
|
| 145 |
+
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
|
| 146 |
+
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
|
benchmark/infrastructure/ejb-timersession/jakarta/pom.xml
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<!--
|
| 3 |
+
|
| 4 |
+
Copyright (c), Eclipse Foundation, Inc. and its licensors.
|
| 5 |
+
|
| 6 |
+
All rights reserved.
|
| 7 |
+
|
| 8 |
+
This program and the accompanying materials are made available under the
|
| 9 |
+
terms of the Eclipse Distribution License v1.0, which is available at
|
| 10 |
+
https://www.eclipse.org/org/documents/edl-v10.php
|
| 11 |
+
|
| 12 |
+
SPDX-License-Identifier: BSD-3-Clause
|
| 13 |
+
|
| 14 |
+
-->
|
| 15 |
+
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
| 16 |
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
| 17 |
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
| 18 |
+
<modelVersion>4.0.0</modelVersion>
|
| 19 |
+
|
| 20 |
+
<groupId>jakarta.examples.tutorial.ejb.timersession</groupId>
|
| 21 |
+
<artifactId>timersession</artifactId>
|
| 22 |
+
<version>10-SNAPSHOT</version>
|
| 23 |
+
<packaging>war</packaging>
|
| 24 |
+
<name>timersession</name>
|
| 25 |
+
<description>Jakarta EE EJB Timer Session Example</description>
|
| 26 |
+
|
| 27 |
+
<properties>
|
| 28 |
+
<maven.compiler.source>11</maven.compiler.source>
|
| 29 |
+
<maven.compiler.target>11</maven.compiler.target>
|
| 30 |
+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
| 31 |
+
<jakarta.jakartaee-api.version>10.0.0</jakarta.jakartaee-api.version>
|
| 32 |
+
<maven.compiler.plugin.version>3.8.1</maven.compiler.plugin.version>
|
| 33 |
+
<maven.war.plugin.version>3.3.1</maven.war.plugin.version>
|
| 34 |
+
<failOnMissingWebXml>false</failOnMissingWebXml>
|
| 35 |
+
</properties>
|
| 36 |
+
|
| 37 |
+
<dependencies>
|
| 38 |
+
<dependency>
|
| 39 |
+
<groupId>jakarta.platform</groupId>
|
| 40 |
+
<artifactId>jakarta.jakartaee-api</artifactId>
|
| 41 |
+
<version>${jakarta.jakartaee-api.version}</version>
|
| 42 |
+
<scope>provided</scope>
|
| 43 |
+
</dependency>
|
| 44 |
+
</dependencies>
|
| 45 |
+
|
| 46 |
+
<build>
|
| 47 |
+
<finalName>timersession</finalName>
|
| 48 |
+
<plugins>
|
| 49 |
+
<plugin>
|
| 50 |
+
<groupId>io.openliberty.tools</groupId>
|
| 51 |
+
<artifactId>liberty-maven-plugin</artifactId>
|
| 52 |
+
<version>3.10.3</version>
|
| 53 |
+
<configuration>
|
| 54 |
+
<serverName>defaultServer</serverName>
|
| 55 |
+
<configFile>${project.basedir}/src/main/liberty/config/server.xml</configFile>
|
| 56 |
+
<appsDirectory>apps</appsDirectory>
|
| 57 |
+
<stripVersion>true</stripVersion>
|
| 58 |
+
<installAppPackages>project</installAppPackages>
|
| 59 |
+
<looseApplication>false</looseApplication>
|
| 60 |
+
<include>${project.build.finalName}.war</include>
|
| 61 |
+
</configuration>
|
| 62 |
+
</plugin>
|
| 63 |
+
<plugin>
|
| 64 |
+
<groupId>org.apache.maven.plugins</groupId>
|
| 65 |
+
<artifactId>maven-compiler-plugin</artifactId>
|
| 66 |
+
<version>${maven.compiler.plugin.version}</version>
|
| 67 |
+
<configuration>
|
| 68 |
+
<source>11</source>
|
| 69 |
+
<target>11</target>
|
| 70 |
+
</configuration>
|
| 71 |
+
</plugin>
|
| 72 |
+
<plugin>
|
| 73 |
+
<groupId>org.apache.maven.plugins</groupId>
|
| 74 |
+
<artifactId>maven-war-plugin</artifactId>
|
| 75 |
+
<version>${maven.war.plugin.version}</version>
|
| 76 |
+
<configuration>
|
| 77 |
+
<failOnMissingWebXml>false</failOnMissingWebXml>
|
| 78 |
+
</configuration>
|
| 79 |
+
</plugin>
|
| 80 |
+
</plugins>
|
| 81 |
+
</build>
|
| 82 |
+
</project>
|
benchmark/infrastructure/ejb-timersession/jakarta/src/main/java/jakarta/tutorial/timersession/ejb/TimerSessionBean.java
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (c), Eclipse Foundation, Inc. and its licensors.
|
| 3 |
+
*
|
| 4 |
+
* All rights reserved.
|
| 5 |
+
*
|
| 6 |
+
* This program and the accompanying materials are made available under the terms of the Eclipse
|
| 7 |
+
* Distribution License v1.0, which is available at
|
| 8 |
+
* https://www.eclipse.org/org/documents/edl-v10.php
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
package jakarta.tutorial.timersession.ejb;
|
| 13 |
+
|
| 14 |
+
import java.util.Date;
|
| 15 |
+
import java.util.logging.Level;
|
| 16 |
+
import java.util.logging.Logger;
|
| 17 |
+
|
| 18 |
+
import jakarta.annotation.Resource;
|
| 19 |
+
import jakarta.ejb.Schedule;
|
| 20 |
+
import jakarta.ejb.Singleton;
|
| 21 |
+
import jakarta.ejb.Startup;
|
| 22 |
+
import jakarta.ejb.Timeout;
|
| 23 |
+
import jakarta.ejb.Timer;
|
| 24 |
+
import jakarta.ejb.TimerConfig;
|
| 25 |
+
import jakarta.ejb.TimerService;
|
| 26 |
+
|
| 27 |
+
/**
|
| 28 |
+
* TimerBean is a singleton session bean that creates a timer and prints out a message when a
|
| 29 |
+
* timeout occurs.
|
| 30 |
+
*/
|
| 31 |
+
@Singleton
|
| 32 |
+
@Startup
|
| 33 |
+
public class TimerSessionBean {
|
| 34 |
+
|
| 35 |
+
@Resource
|
| 36 |
+
TimerService timerService;
|
| 37 |
+
|
| 38 |
+
private Date lastProgrammaticTimeout;
|
| 39 |
+
private Date lastAutomaticTimeout;
|
| 40 |
+
|
| 41 |
+
private static final Logger logger =
|
| 42 |
+
Logger.getLogger("timersession.ejb.TimerSessionBean");
|
| 43 |
+
|
| 44 |
+
public void setTimer(long intervalDuration) {
|
| 45 |
+
logger.log(Level.INFO,
|
| 46 |
+
"Setting a programmatic timeout for {0} milliseconds from now.",
|
| 47 |
+
intervalDuration);
|
| 48 |
+
TimerConfig config = new TimerConfig();
|
| 49 |
+
config.setInfo("Created new programmatic timer");
|
| 50 |
+
config.setPersistent(false); // needs a DB with Liberty
|
| 51 |
+
|
| 52 |
+
timerService.createSingleActionTimer(intervalDuration, config);
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
@Timeout
|
| 56 |
+
public void programmaticTimeout(Timer timer) {
|
| 57 |
+
this.setLastProgrammaticTimeout(new Date());
|
| 58 |
+
logger.info("Programmatic timeout occurred.");
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
@Schedule(minute = "*/1", hour = "*", persistent = false)
|
| 62 |
+
public void automaticTimeout() {
|
| 63 |
+
this.setLastAutomaticTimeout(new Date());
|
| 64 |
+
logger.info("Automatic timeout occurred");
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
/**
|
| 68 |
+
* @return the lastTimeout
|
| 69 |
+
*/
|
| 70 |
+
public String getLastProgrammaticTimeout() {
|
| 71 |
+
if (lastProgrammaticTimeout != null) {
|
| 72 |
+
return lastProgrammaticTimeout.toString();
|
| 73 |
+
} else {
|
| 74 |
+
return "never";
|
| 75 |
+
}
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
/**
|
| 79 |
+
* @param lastTimeout the lastTimeout to set
|
| 80 |
+
*/
|
| 81 |
+
public void setLastProgrammaticTimeout(Date lastTimeout) {
|
| 82 |
+
this.lastProgrammaticTimeout = lastTimeout;
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
/**
|
| 86 |
+
* @return the lastAutomaticTimeout
|
| 87 |
+
*/
|
| 88 |
+
public String getLastAutomaticTimeout() {
|
| 89 |
+
if (lastAutomaticTimeout != null) {
|
| 90 |
+
return lastAutomaticTimeout.toString();
|
| 91 |
+
} else {
|
| 92 |
+
return "never";
|
| 93 |
+
}
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
/**
|
| 97 |
+
* @param lastAutomaticTimeout the lastAutomaticTimeout to set
|
| 98 |
+
*/
|
| 99 |
+
public void setLastAutomaticTimeout(Date lastAutomaticTimeout) {
|
| 100 |
+
this.lastAutomaticTimeout = lastAutomaticTimeout;
|
| 101 |
+
}
|
| 102 |
+
}
|
benchmark/infrastructure/ejb-timersession/jakarta/src/main/java/jakarta/tutorial/timersession/web/TimerManager.java
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (c), Eclipse Foundation, Inc. and its licensors.
|
| 3 |
+
*
|
| 4 |
+
* All rights reserved.
|
| 5 |
+
*
|
| 6 |
+
* This program and the accompanying materials are made available under the
|
| 7 |
+
* terms of the Eclipse Distribution License v1.0, which is available at
|
| 8 |
+
* https://www.eclipse.org/org/documents/edl-v10.php
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
package jakarta.tutorial.timersession.web;
|
| 13 |
+
|
| 14 |
+
import java.io.Serializable;
|
| 15 |
+
|
| 16 |
+
import jakarta.ejb.EJB;
|
| 17 |
+
import jakarta.enterprise.context.SessionScoped;
|
| 18 |
+
import jakarta.inject.Named;
|
| 19 |
+
import jakarta.tutorial.timersession.ejb.TimerSessionBean;
|
| 20 |
+
|
| 21 |
+
/**
|
| 22 |
+
*
|
| 23 |
+
* @author ian
|
| 24 |
+
*/
|
| 25 |
+
@Named
|
| 26 |
+
@SessionScoped
|
| 27 |
+
public class TimerManager implements Serializable {
|
| 28 |
+
|
| 29 |
+
@EJB
|
| 30 |
+
private TimerSessionBean timerSession;
|
| 31 |
+
|
| 32 |
+
private String lastProgrammaticTimeout;
|
| 33 |
+
private String lastAutomaticTimeout;
|
| 34 |
+
|
| 35 |
+
/** Creates a new instance of TimerManager */
|
| 36 |
+
public TimerManager() {
|
| 37 |
+
this.lastProgrammaticTimeout = "never";
|
| 38 |
+
this.lastAutomaticTimeout = "never";
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
/**
|
| 42 |
+
* @return the lastTimeout
|
| 43 |
+
*/
|
| 44 |
+
public String getLastProgrammaticTimeout() {
|
| 45 |
+
lastProgrammaticTimeout = timerSession.getLastProgrammaticTimeout();
|
| 46 |
+
return lastProgrammaticTimeout;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
/**
|
| 50 |
+
* @param lastTimeout the lastTimeout to set
|
| 51 |
+
*/
|
| 52 |
+
public void setLastProgrammaticTimeout(String lastTimeout) {
|
| 53 |
+
this.lastProgrammaticTimeout = lastTimeout;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
public void setTimer() {
|
| 57 |
+
long timeoutDuration = 8000;
|
| 58 |
+
timerSession.setTimer(timeoutDuration);
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
/**
|
| 62 |
+
* @return the lastAutomaticTimeout
|
| 63 |
+
*/
|
| 64 |
+
public String getLastAutomaticTimeout() {
|
| 65 |
+
lastAutomaticTimeout = timerSession.getLastAutomaticTimeout();
|
| 66 |
+
return lastAutomaticTimeout;
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
/**
|
| 70 |
+
* @param lastAutomaticTimeout the lastAutomaticTimeout to set
|
| 71 |
+
*/
|
| 72 |
+
public void setLastAutomaticTimeout(String lastAutomaticTimeout) {
|
| 73 |
+
this.lastAutomaticTimeout = lastAutomaticTimeout;
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
}
|
benchmark/infrastructure/ejb-timersession/jakarta/src/main/liberty/config/server.xml
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<server description="Open Liberty server">
|
| 3 |
+
<!-- Enable features required for Jakarta EE applications -->
|
| 4 |
+
<featureManager>
|
| 5 |
+
<feature>jakartaee-10.0</feature>
|
| 6 |
+
</featureManager>
|
| 7 |
+
|
| 8 |
+
<basicRegistry id="basic" realm="BasicRealm">
|
| 9 |
+
<user name="appuser" password="changeMe123!"/>
|
| 10 |
+
</basicRegistry>
|
| 11 |
+
|
| 12 |
+
<httpEndpoint id="defaultHttpEndpoint" host="*" httpPort="9080" httpsPort="9443"/>
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
<application location="timersession.war" type="war"/>
|
| 16 |
+
|
| 17 |
+
</server>
|
benchmark/infrastructure/ejb-timersession/jakarta/src/main/webapp/WEB-INF/web.xml
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version='1.0' encoding='UTF-8'?>
|
| 2 |
+
<!--
|
| 3 |
+
|
| 4 |
+
Copyright (c), Eclipse Foundation, Inc. and its licensors.
|
| 5 |
+
|
| 6 |
+
All rights reserved.
|
| 7 |
+
|
| 8 |
+
This program and the accompanying materials are made available under the
|
| 9 |
+
terms of the Eclipse Distribution License v1.0, which is available at
|
| 10 |
+
https://www.eclipse.org/org/documents/edl-v10.php
|
| 11 |
+
|
| 12 |
+
SPDX-License-Identifier: BSD-3-Clause
|
| 13 |
+
|
| 14 |
+
-->
|
| 15 |
+
<web-app version="5.0"
|
| 16 |
+
xmlns="https://jakarta.ee/xml/ns/jakartaee"
|
| 17 |
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
| 18 |
+
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd">
|
| 19 |
+
|
| 20 |
+
<display-name>timersession</display-name>
|
| 21 |
+
<context-param>
|
| 22 |
+
<description>
|
| 23 |
+
Tell the runtime where we are in the project development
|
| 24 |
+
lifecycle. Valid values are:
|
| 25 |
+
Development, UnitTest, SystemTest, or Production.
|
| 26 |
+
The runtime will display helpful hints to correct common mistakes
|
| 27 |
+
when the value is Development.
|
| 28 |
+
</description>
|
| 29 |
+
<param-name>jakarta.faces.PROJECT_STAGE</param-name>
|
| 30 |
+
<param-value>Development</param-value>
|
| 31 |
+
</context-param>
|
| 32 |
+
|
| 33 |
+
<!-- Faces Servlet -->
|
| 34 |
+
<servlet>
|
| 35 |
+
<servlet-name>Faces Servlet</servlet-name>
|
| 36 |
+
<servlet-class>jakarta.faces.webapp.FacesServlet</servlet-class>
|
| 37 |
+
<load-on-startup>1</load-on-startup>
|
| 38 |
+
</servlet>
|
| 39 |
+
|
| 40 |
+
<servlet-mapping>
|
| 41 |
+
<servlet-name>Faces Servlet</servlet-name>
|
| 42 |
+
<url-pattern>*.xhtml</url-pattern>
|
| 43 |
+
</servlet-mapping>
|
| 44 |
+
|
| 45 |
+
<welcome-file-list>
|
| 46 |
+
<welcome-file>timer-client.xhtml</welcome-file>
|
| 47 |
+
</welcome-file-list>
|
| 48 |
+
|
| 49 |
+
</web-app>
|
benchmark/infrastructure/ejb-timersession/jakarta/src/main/webapp/timer-client.xhtml
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version='1.0' encoding='UTF-8' ?>
|
| 2 |
+
<!--
|
| 3 |
+
|
| 4 |
+
Copyright (c), Eclipse Foundation, Inc. and its licensors.
|
| 5 |
+
|
| 6 |
+
All rights reserved.
|
| 7 |
+
|
| 8 |
+
This program and the accompanying materials are made available under the
|
| 9 |
+
terms of the Eclipse Distribution License v1.0, which is available at
|
| 10 |
+
https://www.eclipse.org/org/documents/edl-v10.php
|
| 11 |
+
|
| 12 |
+
SPDX-License-Identifier: BSD-3-Clause
|
| 13 |
+
|
| 14 |
+
-->
|
| 15 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
| 16 |
+
<html lang="en"
|
| 17 |
+
xmlns="http://www.w3.org/1999/xhtml"
|
| 18 |
+
xmlns:ui="jakarta.faces.facelets"
|
| 19 |
+
xmlns:h="jakarta.faces.html">
|
| 20 |
+
<ui:composition template="/timer.xhtml">
|
| 21 |
+
<ui:define name="title">
|
| 22 |
+
Timer page
|
| 23 |
+
</ui:define>
|
| 24 |
+
|
| 25 |
+
<ui:define name="body">
|
| 26 |
+
<p>The last programmatic timeout was: #{timerManager.lastProgrammaticTimeout}.</p>
|
| 27 |
+
|
| 28 |
+
<p>The last automatic timeout was: #{timerManager.lastAutomaticTimeout}</p>
|
| 29 |
+
|
| 30 |
+
<p>Set a programmatic timer here.</p>
|
| 31 |
+
<h:form>
|
| 32 |
+
<h:commandButton value="Set Timer" action="#{timerManager.setTimer()}" />
|
| 33 |
+
<h:commandButton value="Refresh" action="timer-client"/>
|
| 34 |
+
</h:form>
|
| 35 |
+
</ui:define>
|
| 36 |
+
</ui:composition>
|
| 37 |
+
</html>
|
| 38 |
+
|
benchmark/infrastructure/ejb-timersession/jakarta/src/main/webapp/timer.xhtml
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version='1.0' encoding='UTF-8' ?>
|
| 2 |
+
<!--
|
| 3 |
+
|
| 4 |
+
Copyright (c), Eclipse Foundation, Inc. and its licensors.
|
| 5 |
+
|
| 6 |
+
All rights reserved.
|
| 7 |
+
|
| 8 |
+
This program and the accompanying materials are made available under the
|
| 9 |
+
terms of the Eclipse Distribution License v1.0, which is available at
|
| 10 |
+
https://www.eclipse.org/org/documents/edl-v10.php
|
| 11 |
+
|
| 12 |
+
SPDX-License-Identifier: BSD-3-Clause
|
| 13 |
+
|
| 14 |
+
-->
|
| 15 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
| 16 |
+
<html lang="en"
|
| 17 |
+
xmlns="http://www.w3.org/1999/xhtml"
|
| 18 |
+
xmlns:ui="jakarta.faces.facelets"
|
| 19 |
+
xmlns:h="jakarta.faces.html">
|
| 20 |
+
<h:head>
|
| 21 |
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
| 22 |
+
<title>timer - An EJB timer service session bean example.</title>
|
| 23 |
+
</h:head>
|
| 24 |
+
|
| 25 |
+
<body>
|
| 26 |
+
<h1>
|
| 27 |
+
<ui:insert name="title">Default Title</ui:insert>
|
| 28 |
+
</h1>
|
| 29 |
+
<p>
|
| 30 |
+
<ui:insert name="body">Default Body</ui:insert>
|
| 31 |
+
</p>
|
| 32 |
+
</body>
|
| 33 |
+
</html>
|
| 34 |
+
|
benchmark/infrastructure/ejb-timersession/jakarta/test.sh
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
set -euo pipefail
|
| 3 |
+
|
| 4 |
+
BASE_URL="${BASE_URL:-http://localhost:9080}"
|
| 5 |
+
|
| 6 |
+
echo "Health check: ${BASE_URL}/"
|
| 7 |
+
HTTP_STATUS=$(curl -sL -o /dev/null -w "%{http_code}" "${BASE_URL}/")
|
| 8 |
+
|
| 9 |
+
if [ "$HTTP_STATUS" -eq 200 ]; then
|
| 10 |
+
echo "PASS - got HTTP ${HTTP_STATUS}"
|
| 11 |
+
exit 0
|
| 12 |
+
else
|
| 13 |
+
echo "FAIL - got HTTP ${HTTP_STATUS}"
|
| 14 |
+
exit 1
|
| 15 |
+
fi
|
benchmark/infrastructure/ejb-timersession/quarkus/.dockerignore
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# VCS
|
| 2 |
+
.git/
|
| 3 |
+
|
| 4 |
+
# Maven
|
| 5 |
+
.mvn/
|
| 6 |
+
**/.mvn/
|
| 7 |
+
mvnw
|
| 8 |
+
mvnw.cmd
|
| 9 |
+
**/mvnw
|
| 10 |
+
**/mvnw.cmd
|
| 11 |
+
target/
|
| 12 |
+
**/target/
|
| 13 |
+
pom.xml.tag
|
| 14 |
+
pom.xml.releaseBackup
|
| 15 |
+
pom.xml.versionsBackup
|
| 16 |
+
pom.xml.next
|
| 17 |
+
release.properties
|
| 18 |
+
dependency-reduced-pom.xml
|
| 19 |
+
buildNumber.properties
|
| 20 |
+
|
| 21 |
+
# IDE / Editor
|
| 22 |
+
.vscode/
|
| 23 |
+
**/.vscode/
|
| 24 |
+
.zed/
|
| 25 |
+
**/.zed/
|
| 26 |
+
.idea/
|
| 27 |
+
**/.idea/
|
| 28 |
+
*.iml
|
| 29 |
+
*.ipr
|
| 30 |
+
*.iws
|
| 31 |
+
|
| 32 |
+
# OS
|
| 33 |
+
.DS_Store
|
| 34 |
+
**/.DS_Store
|
| 35 |
+
Thumbs.db
|
| 36 |
+
ehthumbs.db
|
| 37 |
+
|
| 38 |
+
# Logs / temp
|
| 39 |
+
*.log
|
| 40 |
+
*.tmp
|
| 41 |
+
*.temp
|
benchmark/infrastructure/ejb-timersession/quarkus/.mvn/wrapper/maven-wrapper.properties
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
wrapperVersion=3.3.4
|
| 2 |
+
distributionType=only-script
|
| 3 |
+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip
|
benchmark/infrastructure/ejb-timersession/quarkus/Dockerfile
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM maven:3.9.12-ibm-semeru-21-noble
|
| 2 |
+
|
| 3 |
+
USER root
|
| 4 |
+
# install uv
|
| 5 |
+
RUN apt-get update && apt-get install -y --no-install-recommends curl lsof python3-venv python3-full && curl -LsSf https://astral.sh/uv/install.sh | sh
|
| 6 |
+
|
| 7 |
+
ENV PATH="/root/.local/bin:$PATH"
|
| 8 |
+
|
| 9 |
+
# Shared browsers path so Chromium is cached once
|
| 10 |
+
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
|
| 11 |
+
RUN mkdir -p /ms-playwright && chmod 755 /ms-playwright
|
| 12 |
+
|
| 13 |
+
# create venv and install
|
| 14 |
+
RUN uv venv /opt/venv && uv pip install --python /opt/venv/bin/python playwright==1.47.0 pytest
|
| 15 |
+
|
| 16 |
+
ENV PATH="/opt/venv/bin:$PATH"
|
| 17 |
+
RUN playwright install --with-deps chromium
|
| 18 |
+
|
| 19 |
+
# Set working directory
|
| 20 |
+
WORKDIR /app
|
| 21 |
+
|
| 22 |
+
# Copy all the assets
|
| 23 |
+
COPY . .
|
| 24 |
+
|
| 25 |
+
# Build the application at image build time
|
| 26 |
+
RUN mvn clean install -DskipTests
|
| 27 |
+
|
| 28 |
+
COPY test.sh .
|
| 29 |
+
RUN chmod +x test.sh
|
| 30 |
+
|
| 31 |
+
RUN mvn clean install -DskipTests
|
| 32 |
+
|
| 33 |
+
CMD ["mvn", "quarkus:run"]
|
benchmark/infrastructure/ejb-timersession/quarkus/mvnw
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
# ----------------------------------------------------------------------------
|
| 3 |
+
# Licensed to the Apache Software Foundation (ASF) under one
|
| 4 |
+
# or more contributor license agreements. See the NOTICE file
|
| 5 |
+
# distributed with this work for additional information
|
| 6 |
+
# regarding copyright ownership. The ASF licenses this file
|
| 7 |
+
# to you under the Apache License, Version 2.0 (the
|
| 8 |
+
# "License"); you may not use this file except in compliance
|
| 9 |
+
# with the License. You may obtain a copy of the License at
|
| 10 |
+
#
|
| 11 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 12 |
+
#
|
| 13 |
+
# Unless required by applicable law or agreed to in writing,
|
| 14 |
+
# software distributed under the License is distributed on an
|
| 15 |
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
| 16 |
+
# KIND, either express or implied. See the License for the
|
| 17 |
+
# specific language governing permissions and limitations
|
| 18 |
+
# under the License.
|
| 19 |
+
# ----------------------------------------------------------------------------
|
| 20 |
+
|
| 21 |
+
# ----------------------------------------------------------------------------
|
| 22 |
+
# Apache Maven Wrapper startup batch script, version 3.3.4
|
| 23 |
+
#
|
| 24 |
+
# Optional ENV vars
|
| 25 |
+
# -----------------
|
| 26 |
+
# JAVA_HOME - location of a JDK home dir, required when download maven via java source
|
| 27 |
+
# MVNW_REPOURL - repo url base for downloading maven distribution
|
| 28 |
+
# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
|
| 29 |
+
# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
|
| 30 |
+
# ----------------------------------------------------------------------------
|
| 31 |
+
|
| 32 |
+
set -euf
|
| 33 |
+
[ "${MVNW_VERBOSE-}" != debug ] || set -x
|
| 34 |
+
|
| 35 |
+
# OS specific support.
|
| 36 |
+
native_path() { printf %s\\n "$1"; }
|
| 37 |
+
case "$(uname)" in
|
| 38 |
+
CYGWIN* | MINGW*)
|
| 39 |
+
[ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
|
| 40 |
+
native_path() { cygpath --path --windows "$1"; }
|
| 41 |
+
;;
|
| 42 |
+
esac
|
| 43 |
+
|
| 44 |
+
# set JAVACMD and JAVACCMD
|
| 45 |
+
set_java_home() {
|
| 46 |
+
# For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
|
| 47 |
+
if [ -n "${JAVA_HOME-}" ]; then
|
| 48 |
+
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
|
| 49 |
+
# IBM's JDK on AIX uses strange locations for the executables
|
| 50 |
+
JAVACMD="$JAVA_HOME/jre/sh/java"
|
| 51 |
+
JAVACCMD="$JAVA_HOME/jre/sh/javac"
|
| 52 |
+
else
|
| 53 |
+
JAVACMD="$JAVA_HOME/bin/java"
|
| 54 |
+
JAVACCMD="$JAVA_HOME/bin/javac"
|
| 55 |
+
|
| 56 |
+
if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
|
| 57 |
+
echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
|
| 58 |
+
echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
|
| 59 |
+
return 1
|
| 60 |
+
fi
|
| 61 |
+
fi
|
| 62 |
+
else
|
| 63 |
+
JAVACMD="$(
|
| 64 |
+
'set' +e
|
| 65 |
+
'unset' -f command 2>/dev/null
|
| 66 |
+
'command' -v java
|
| 67 |
+
)" || :
|
| 68 |
+
JAVACCMD="$(
|
| 69 |
+
'set' +e
|
| 70 |
+
'unset' -f command 2>/dev/null
|
| 71 |
+
'command' -v javac
|
| 72 |
+
)" || :
|
| 73 |
+
|
| 74 |
+
if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
|
| 75 |
+
echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
|
| 76 |
+
return 1
|
| 77 |
+
fi
|
| 78 |
+
fi
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
# hash string like Java String::hashCode
|
| 82 |
+
hash_string() {
|
| 83 |
+
str="${1:-}" h=0
|
| 84 |
+
while [ -n "$str" ]; do
|
| 85 |
+
char="${str%"${str#?}"}"
|
| 86 |
+
h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
|
| 87 |
+
str="${str#?}"
|
| 88 |
+
done
|
| 89 |
+
printf %x\\n $h
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
verbose() { :; }
|
| 93 |
+
[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
|
| 94 |
+
|
| 95 |
+
die() {
|
| 96 |
+
printf %s\\n "$1" >&2
|
| 97 |
+
exit 1
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
trim() {
|
| 101 |
+
# MWRAPPER-139:
|
| 102 |
+
# Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
|
| 103 |
+
# Needed for removing poorly interpreted newline sequences when running in more
|
| 104 |
+
# exotic environments such as mingw bash on Windows.
|
| 105 |
+
printf "%s" "${1}" | tr -d '[:space:]'
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
scriptDir="$(dirname "$0")"
|
| 109 |
+
scriptName="$(basename "$0")"
|
| 110 |
+
|
| 111 |
+
# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
|
| 112 |
+
while IFS="=" read -r key value; do
|
| 113 |
+
case "${key-}" in
|
| 114 |
+
distributionUrl) distributionUrl=$(trim "${value-}") ;;
|
| 115 |
+
distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
|
| 116 |
+
esac
|
| 117 |
+
done <"$scriptDir/.mvn/wrapper/maven-wrapper.properties"
|
| 118 |
+
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
|
| 119 |
+
|
| 120 |
+
case "${distributionUrl##*/}" in
|
| 121 |
+
maven-mvnd-*bin.*)
|
| 122 |
+
MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
|
| 123 |
+
case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
|
| 124 |
+
*AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
|
| 125 |
+
:Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
|
| 126 |
+
:Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
|
| 127 |
+
:Linux*x86_64*) distributionPlatform=linux-amd64 ;;
|
| 128 |
+
*)
|
| 129 |
+
echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
|
| 130 |
+
distributionPlatform=linux-amd64
|
| 131 |
+
;;
|
| 132 |
+
esac
|
| 133 |
+
distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
|
| 134 |
+
;;
|
| 135 |
+
maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
|
| 136 |
+
*) MVN_CMD="mvn${scriptName#mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
|
| 137 |
+
esac
|
| 138 |
+
|
| 139 |
+
# apply MVNW_REPOURL and calculate MAVEN_HOME
|
| 140 |
+
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
|
| 141 |
+
[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
|
| 142 |
+
distributionUrlName="${distributionUrl##*/}"
|
| 143 |
+
distributionUrlNameMain="${distributionUrlName%.*}"
|
| 144 |
+
distributionUrlNameMain="${distributionUrlNameMain%-bin}"
|
| 145 |
+
MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
|
| 146 |
+
MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
|
| 147 |
+
|
| 148 |
+
exec_maven() {
|
| 149 |
+
unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
|
| 150 |
+
exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
if [ -d "$MAVEN_HOME" ]; then
|
| 154 |
+
verbose "found existing MAVEN_HOME at $MAVEN_HOME"
|
| 155 |
+
exec_maven "$@"
|
| 156 |
+
fi
|
| 157 |
+
|
| 158 |
+
case "${distributionUrl-}" in
|
| 159 |
+
*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
|
| 160 |
+
*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
|
| 161 |
+
esac
|
| 162 |
+
|
| 163 |
+
# prepare tmp dir
|
| 164 |
+
if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
|
| 165 |
+
clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
|
| 166 |
+
trap clean HUP INT TERM EXIT
|
| 167 |
+
else
|
| 168 |
+
die "cannot create temp dir"
|
| 169 |
+
fi
|
| 170 |
+
|
| 171 |
+
mkdir -p -- "${MAVEN_HOME%/*}"
|
| 172 |
+
|
| 173 |
+
# Download and Install Apache Maven
|
| 174 |
+
verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
|
| 175 |
+
verbose "Downloading from: $distributionUrl"
|
| 176 |
+
verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
|
| 177 |
+
|
| 178 |
+
# select .zip or .tar.gz
|
| 179 |
+
if ! command -v unzip >/dev/null; then
|
| 180 |
+
distributionUrl="${distributionUrl%.zip}.tar.gz"
|
| 181 |
+
distributionUrlName="${distributionUrl##*/}"
|
| 182 |
+
fi
|
| 183 |
+
|
| 184 |
+
# verbose opt
|
| 185 |
+
__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
|
| 186 |
+
[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
|
| 187 |
+
|
| 188 |
+
# normalize http auth
|
| 189 |
+
case "${MVNW_PASSWORD:+has-password}" in
|
| 190 |
+
'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
|
| 191 |
+
has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
|
| 192 |
+
esac
|
| 193 |
+
|
| 194 |
+
if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
|
| 195 |
+
verbose "Found wget ... using wget"
|
| 196 |
+
wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
|
| 197 |
+
elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
|
| 198 |
+
verbose "Found curl ... using curl"
|
| 199 |
+
curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
|
| 200 |
+
elif set_java_home; then
|
| 201 |
+
verbose "Falling back to use Java to download"
|
| 202 |
+
javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
|
| 203 |
+
targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
|
| 204 |
+
cat >"$javaSource" <<-END
|
| 205 |
+
public class Downloader extends java.net.Authenticator
|
| 206 |
+
{
|
| 207 |
+
protected java.net.PasswordAuthentication getPasswordAuthentication()
|
| 208 |
+
{
|
| 209 |
+
return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
|
| 210 |
+
}
|
| 211 |
+
public static void main( String[] args ) throws Exception
|
| 212 |
+
{
|
| 213 |
+
setDefault( new Downloader() );
|
| 214 |
+
java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
|
| 215 |
+
}
|
| 216 |
+
}
|
| 217 |
+
END
|
| 218 |
+
# For Cygwin/MinGW, switch paths to Windows format before running javac and java
|
| 219 |
+
verbose " - Compiling Downloader.java ..."
|
| 220 |
+
"$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
|
| 221 |
+
verbose " - Running Downloader.java ..."
|
| 222 |
+
"$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
|
| 223 |
+
fi
|
| 224 |
+
|
| 225 |
+
# If specified, validate the SHA-256 sum of the Maven distribution zip file
|
| 226 |
+
if [ -n "${distributionSha256Sum-}" ]; then
|
| 227 |
+
distributionSha256Result=false
|
| 228 |
+
if [ "$MVN_CMD" = mvnd.sh ]; then
|
| 229 |
+
echo "Checksum validation is not supported for maven-mvnd." >&2
|
| 230 |
+
echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
|
| 231 |
+
exit 1
|
| 232 |
+
elif command -v sha256sum >/dev/null; then
|
| 233 |
+
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c - >/dev/null 2>&1; then
|
| 234 |
+
distributionSha256Result=true
|
| 235 |
+
fi
|
| 236 |
+
elif command -v shasum >/dev/null; then
|
| 237 |
+
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
|
| 238 |
+
distributionSha256Result=true
|
| 239 |
+
fi
|
| 240 |
+
else
|
| 241 |
+
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
|
| 242 |
+
echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
|
| 243 |
+
exit 1
|
| 244 |
+
fi
|
| 245 |
+
if [ $distributionSha256Result = false ]; then
|
| 246 |
+
echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
|
| 247 |
+
echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
|
| 248 |
+
exit 1
|
| 249 |
+
fi
|
| 250 |
+
fi
|
| 251 |
+
|
| 252 |
+
# unzip and move
|
| 253 |
+
if command -v unzip >/dev/null; then
|
| 254 |
+
unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
|
| 255 |
+
else
|
| 256 |
+
tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
|
| 257 |
+
fi
|
| 258 |
+
|
| 259 |
+
# Find the actual extracted directory name (handles snapshots where filename != directory name)
|
| 260 |
+
actualDistributionDir=""
|
| 261 |
+
|
| 262 |
+
# First try the expected directory name (for regular distributions)
|
| 263 |
+
if [ -d "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" ]; then
|
| 264 |
+
if [ -f "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/bin/$MVN_CMD" ]; then
|
| 265 |
+
actualDistributionDir="$distributionUrlNameMain"
|
| 266 |
+
fi
|
| 267 |
+
fi
|
| 268 |
+
|
| 269 |
+
# If not found, search for any directory with the Maven executable (for snapshots)
|
| 270 |
+
if [ -z "$actualDistributionDir" ]; then
|
| 271 |
+
# enable globbing to iterate over items
|
| 272 |
+
set +f
|
| 273 |
+
for dir in "$TMP_DOWNLOAD_DIR"/*; do
|
| 274 |
+
if [ -d "$dir" ]; then
|
| 275 |
+
if [ -f "$dir/bin/$MVN_CMD" ]; then
|
| 276 |
+
actualDistributionDir="$(basename "$dir")"
|
| 277 |
+
break
|
| 278 |
+
fi
|
| 279 |
+
fi
|
| 280 |
+
done
|
| 281 |
+
set -f
|
| 282 |
+
fi
|
| 283 |
+
|
| 284 |
+
if [ -z "$actualDistributionDir" ]; then
|
| 285 |
+
verbose "Contents of $TMP_DOWNLOAD_DIR:"
|
| 286 |
+
verbose "$(ls -la "$TMP_DOWNLOAD_DIR")"
|
| 287 |
+
die "Could not find Maven distribution directory in extracted archive"
|
| 288 |
+
fi
|
| 289 |
+
|
| 290 |
+
verbose "Found extracted Maven distribution directory: $actualDistributionDir"
|
| 291 |
+
printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$actualDistributionDir/mvnw.url"
|
| 292 |
+
mv -- "$TMP_DOWNLOAD_DIR/$actualDistributionDir" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
|
| 293 |
+
|
| 294 |
+
clean || :
|
| 295 |
+
exec_maven "$@"
|
benchmark/infrastructure/ejb-timersession/quarkus/mvnw.cmd
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<# : batch portion
|
| 2 |
+
@REM ----------------------------------------------------------------------------
|
| 3 |
+
@REM Licensed to the Apache Software Foundation (ASF) under one
|
| 4 |
+
@REM or more contributor license agreements. See the NOTICE file
|
| 5 |
+
@REM distributed with this work for additional information
|
| 6 |
+
@REM regarding copyright ownership. The ASF licenses this file
|
| 7 |
+
@REM to you under the Apache License, Version 2.0 (the
|
| 8 |
+
@REM "License"); you may not use this file except in compliance
|
| 9 |
+
@REM with the License. You may obtain a copy of the License at
|
| 10 |
+
@REM
|
| 11 |
+
@REM http://www.apache.org/licenses/LICENSE-2.0
|
| 12 |
+
@REM
|
| 13 |
+
@REM Unless required by applicable law or agreed to in writing,
|
| 14 |
+
@REM software distributed under the License is distributed on an
|
| 15 |
+
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
| 16 |
+
@REM KIND, either express or implied. See the License for the
|
| 17 |
+
@REM specific language governing permissions and limitations
|
| 18 |
+
@REM under the License.
|
| 19 |
+
@REM ----------------------------------------------------------------------------
|
| 20 |
+
|
| 21 |
+
@REM ----------------------------------------------------------------------------
|
| 22 |
+
@REM Apache Maven Wrapper startup batch script, version 3.3.4
|
| 23 |
+
@REM
|
| 24 |
+
@REM Optional ENV vars
|
| 25 |
+
@REM MVNW_REPOURL - repo url base for downloading maven distribution
|
| 26 |
+
@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
|
| 27 |
+
@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output
|
| 28 |
+
@REM ----------------------------------------------------------------------------
|
| 29 |
+
|
| 30 |
+
@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
|
| 31 |
+
@SET __MVNW_CMD__=
|
| 32 |
+
@SET __MVNW_ERROR__=
|
| 33 |
+
@SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
|
| 34 |
+
@SET PSModulePath=
|
| 35 |
+
@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
|
| 36 |
+
IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
|
| 37 |
+
)
|
| 38 |
+
@SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
|
| 39 |
+
@SET __MVNW_PSMODULEP_SAVE=
|
| 40 |
+
@SET __MVNW_ARG0_NAME__=
|
| 41 |
+
@SET MVNW_USERNAME=
|
| 42 |
+
@SET MVNW_PASSWORD=
|
| 43 |
+
@IF NOT "%__MVNW_CMD__%"=="" ("%__MVNW_CMD__%" %*)
|
| 44 |
+
@echo Cannot start maven from wrapper >&2 && exit /b 1
|
| 45 |
+
@GOTO :EOF
|
| 46 |
+
: end batch / begin powershell #>
|
| 47 |
+
|
| 48 |
+
$ErrorActionPreference = "Stop"
|
| 49 |
+
if ($env:MVNW_VERBOSE -eq "true") {
|
| 50 |
+
$VerbosePreference = "Continue"
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
|
| 54 |
+
$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
|
| 55 |
+
if (!$distributionUrl) {
|
| 56 |
+
Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
|
| 60 |
+
"maven-mvnd-*" {
|
| 61 |
+
$USE_MVND = $true
|
| 62 |
+
$distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
|
| 63 |
+
$MVN_CMD = "mvnd.cmd"
|
| 64 |
+
break
|
| 65 |
+
}
|
| 66 |
+
default {
|
| 67 |
+
$USE_MVND = $false
|
| 68 |
+
$MVN_CMD = $script -replace '^mvnw','mvn'
|
| 69 |
+
break
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
# apply MVNW_REPOURL and calculate MAVEN_HOME
|
| 74 |
+
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
|
| 75 |
+
if ($env:MVNW_REPOURL) {
|
| 76 |
+
$MVNW_REPO_PATTERN = if ($USE_MVND -eq $False) { "/org/apache/maven/" } else { "/maven/mvnd/" }
|
| 77 |
+
$distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace "^.*$MVNW_REPO_PATTERN",'')"
|
| 78 |
+
}
|
| 79 |
+
$distributionUrlName = $distributionUrl -replace '^.*/',''
|
| 80 |
+
$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
|
| 81 |
+
|
| 82 |
+
$MAVEN_M2_PATH = "$HOME/.m2"
|
| 83 |
+
if ($env:MAVEN_USER_HOME) {
|
| 84 |
+
$MAVEN_M2_PATH = "$env:MAVEN_USER_HOME"
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
if (-not (Test-Path -Path $MAVEN_M2_PATH)) {
|
| 88 |
+
New-Item -Path $MAVEN_M2_PATH -ItemType Directory | Out-Null
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
$MAVEN_WRAPPER_DISTS = $null
|
| 92 |
+
if ((Get-Item $MAVEN_M2_PATH).Target[0] -eq $null) {
|
| 93 |
+
$MAVEN_WRAPPER_DISTS = "$MAVEN_M2_PATH/wrapper/dists"
|
| 94 |
+
} else {
|
| 95 |
+
$MAVEN_WRAPPER_DISTS = (Get-Item $MAVEN_M2_PATH).Target[0] + "/wrapper/dists"
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
$MAVEN_HOME_PARENT = "$MAVEN_WRAPPER_DISTS/$distributionUrlNameMain"
|
| 99 |
+
$MAVEN_HOME_NAME = ([System.Security.Cryptography.SHA256]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
|
| 100 |
+
$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
|
| 101 |
+
|
| 102 |
+
if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
|
| 103 |
+
Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
|
| 104 |
+
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
|
| 105 |
+
exit $?
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
|
| 109 |
+
Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
# prepare tmp dir
|
| 113 |
+
$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
|
| 114 |
+
$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
|
| 115 |
+
$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
|
| 116 |
+
trap {
|
| 117 |
+
if ($TMP_DOWNLOAD_DIR.Exists) {
|
| 118 |
+
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
|
| 119 |
+
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
|
| 120 |
+
}
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null
|
| 124 |
+
|
| 125 |
+
# Download and Install Apache Maven
|
| 126 |
+
Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
|
| 127 |
+
Write-Verbose "Downloading from: $distributionUrl"
|
| 128 |
+
Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
|
| 129 |
+
|
| 130 |
+
$webclient = New-Object System.Net.WebClient
|
| 131 |
+
if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
|
| 132 |
+
$webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
|
| 133 |
+
}
|
| 134 |
+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
| 135 |
+
$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null
|
| 136 |
+
|
| 137 |
+
# If specified, validate the SHA-256 sum of the Maven distribution zip file
|
| 138 |
+
$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
|
| 139 |
+
if ($distributionSha256Sum) {
|
| 140 |
+
if ($USE_MVND) {
|
| 141 |
+
Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
|
| 142 |
+
}
|
| 143 |
+
Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
|
| 144 |
+
if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
|
| 145 |
+
Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
|
| 146 |
+
}
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
# unzip and move
|
| 150 |
+
Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
|
| 151 |
+
|
| 152 |
+
# Find the actual extracted directory name (handles snapshots where filename != directory name)
|
| 153 |
+
$actualDistributionDir = ""
|
| 154 |
+
|
| 155 |
+
# First try the expected directory name (for regular distributions)
|
| 156 |
+
$expectedPath = Join-Path "$TMP_DOWNLOAD_DIR" "$distributionUrlNameMain"
|
| 157 |
+
$expectedMvnPath = Join-Path "$expectedPath" "bin/$MVN_CMD"
|
| 158 |
+
if ((Test-Path -Path $expectedPath -PathType Container) -and (Test-Path -Path $expectedMvnPath -PathType Leaf)) {
|
| 159 |
+
$actualDistributionDir = $distributionUrlNameMain
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
# If not found, search for any directory with the Maven executable (for snapshots)
|
| 163 |
+
if (!$actualDistributionDir) {
|
| 164 |
+
Get-ChildItem -Path "$TMP_DOWNLOAD_DIR" -Directory | ForEach-Object {
|
| 165 |
+
$testPath = Join-Path $_.FullName "bin/$MVN_CMD"
|
| 166 |
+
if (Test-Path -Path $testPath -PathType Leaf) {
|
| 167 |
+
$actualDistributionDir = $_.Name
|
| 168 |
+
}
|
| 169 |
+
}
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
if (!$actualDistributionDir) {
|
| 173 |
+
Write-Error "Could not find Maven distribution directory in extracted archive"
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
Write-Verbose "Found extracted Maven distribution directory: $actualDistributionDir"
|
| 177 |
+
Rename-Item -Path "$TMP_DOWNLOAD_DIR/$actualDistributionDir" -NewName $MAVEN_HOME_NAME | Out-Null
|
| 178 |
+
try {
|
| 179 |
+
Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
|
| 180 |
+
} catch {
|
| 181 |
+
if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
|
| 182 |
+
Write-Error "fail to move MAVEN_HOME"
|
| 183 |
+
}
|
| 184 |
+
} finally {
|
| 185 |
+
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
|
| 186 |
+
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
|
benchmark/infrastructure/ejb-timersession/quarkus/pom.xml
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version='1.0' encoding='utf-8'?>
|
| 2 |
+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
| 3 |
+
<modelVersion>4.0.0</modelVersion>
|
| 4 |
+
<groupId>jakarta.examples.tutorial.timersession</groupId>
|
| 5 |
+
<artifactId>timersession-quarkus</artifactId>
|
| 6 |
+
<version>1.0.0-SNAPSHOT</version>
|
| 7 |
+
<packaging>jar</packaging>
|
| 8 |
+
<name>timersession-quarkus</name>
|
| 9 |
+
<description>Quarkus Timersession Example</description>
|
| 10 |
+
<properties>
|
| 11 |
+
<maven.compiler.source>17</maven.compiler.source>
|
| 12 |
+
<maven.compiler.target>17</maven.compiler.target>
|
| 13 |
+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
| 14 |
+
<quarkus.platform.version>3.30.5</quarkus.platform.version>
|
| 15 |
+
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
|
| 16 |
+
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
|
| 17 |
+
<myfaces-quarkus.version>4.1.2</myfaces-quarkus.version>
|
| 18 |
+
<compiler-plugin.version>3.13.0</compiler-plugin.version>
|
| 19 |
+
<surefire-plugin.version>3.5.0</surefire-plugin.version>
|
| 20 |
+
</properties>
|
| 21 |
+
<dependencyManagement>
|
| 22 |
+
<dependencies>
|
| 23 |
+
<dependency>
|
| 24 |
+
<groupId>${quarkus.platform.group-id}</groupId>
|
| 25 |
+
<artifactId>${quarkus.platform.artifact-id}</artifactId>
|
| 26 |
+
<version>${quarkus.platform.version}</version>
|
| 27 |
+
<type>pom</type>
|
| 28 |
+
<scope>import</scope>
|
| 29 |
+
</dependency>
|
| 30 |
+
</dependencies>
|
| 31 |
+
</dependencyManagement>
|
| 32 |
+
<dependencies>
|
| 33 |
+
<dependency>
|
| 34 |
+
<groupId>io.quarkus</groupId>
|
| 35 |
+
<artifactId>quarkus-arc</artifactId>
|
| 36 |
+
</dependency>
|
| 37 |
+
<dependency>
|
| 38 |
+
<groupId>org.apache.myfaces.core.extensions.quarkus</groupId>
|
| 39 |
+
<artifactId>myfaces-quarkus</artifactId>
|
| 40 |
+
<version>${myfaces-quarkus.version}</version>
|
| 41 |
+
</dependency>
|
| 42 |
+
<dependency>
|
| 43 |
+
<groupId>io.quarkus</groupId>
|
| 44 |
+
<artifactId>quarkus-scheduler</artifactId>
|
| 45 |
+
</dependency>
|
| 46 |
+
<dependency>
|
| 47 |
+
<groupId>io.quarkus</groupId>
|
| 48 |
+
<artifactId>quarkus-junit5</artifactId>
|
| 49 |
+
<scope>test</scope>
|
| 50 |
+
</dependency>
|
| 51 |
+
<dependency>
|
| 52 |
+
<groupId>io.rest-assured</groupId>
|
| 53 |
+
<artifactId>rest-assured</artifactId>
|
| 54 |
+
<scope>test</scope>
|
| 55 |
+
</dependency>
|
| 56 |
+
</dependencies>
|
| 57 |
+
<build>
|
| 58 |
+
<plugins>
|
| 59 |
+
<plugin>
|
| 60 |
+
<groupId>${quarkus.platform.group-id}</groupId>
|
| 61 |
+
<artifactId>quarkus-maven-plugin</artifactId>
|
| 62 |
+
<version>${quarkus.platform.version}</version>
|
| 63 |
+
<extensions>true</extensions>
|
| 64 |
+
<executions>
|
| 65 |
+
<execution>
|
| 66 |
+
<goals>
|
| 67 |
+
<goal>build</goal>
|
| 68 |
+
<goal>generate-code</goal>
|
| 69 |
+
<goal>generate-code-tests</goal>
|
| 70 |
+
</goals>
|
| 71 |
+
</execution>
|
| 72 |
+
</executions>
|
| 73 |
+
</plugin>
|
| 74 |
+
<plugin>
|
| 75 |
+
<artifactId>maven-compiler-plugin</artifactId>
|
| 76 |
+
<version>${compiler-plugin.version}</version>
|
| 77 |
+
<configuration>
|
| 78 |
+
<parameters>true</parameters>
|
| 79 |
+
</configuration>
|
| 80 |
+
</plugin>
|
| 81 |
+
<plugin>
|
| 82 |
+
<artifactId>maven-surefire-plugin</artifactId>
|
| 83 |
+
<version>${surefire-plugin.version}</version>
|
| 84 |
+
<configuration>
|
| 85 |
+
<systemPropertyVariables>
|
| 86 |
+
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
| 87 |
+
<maven.home>${maven.home}</maven.home>
|
| 88 |
+
</systemPropertyVariables>
|
| 89 |
+
</configuration>
|
| 90 |
+
</plugin>
|
| 91 |
+
<plugin>
|
| 92 |
+
<artifactId>maven-failsafe-plugin</artifactId>
|
| 93 |
+
<version>${surefire-plugin.version}</version>
|
| 94 |
+
<executions>
|
| 95 |
+
<execution>
|
| 96 |
+
<goals>
|
| 97 |
+
<goal>integration-test</goal>
|
| 98 |
+
<goal>verify</goal>
|
| 99 |
+
</goals>
|
| 100 |
+
</execution>
|
| 101 |
+
</executions>
|
| 102 |
+
<configuration>
|
| 103 |
+
<systemPropertyVariables>
|
| 104 |
+
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
|
| 105 |
+
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
| 106 |
+
<maven.home>${maven.home}</maven.home>
|
| 107 |
+
</systemPropertyVariables>
|
| 108 |
+
</configuration>
|
| 109 |
+
</plugin>
|
| 110 |
+
</plugins>
|
| 111 |
+
</build>
|
| 112 |
+
<profiles>
|
| 113 |
+
<profile>
|
| 114 |
+
<id>native</id>
|
| 115 |
+
<activation>
|
| 116 |
+
<property>
|
| 117 |
+
<name>native</name>
|
| 118 |
+
</property>
|
| 119 |
+
</activation>
|
| 120 |
+
<properties>
|
| 121 |
+
<skipITs>false</skipITs>
|
| 122 |
+
<quarkus.native.enabled>true</quarkus.native.enabled>
|
| 123 |
+
</properties>
|
| 124 |
+
<build>
|
| 125 |
+
<plugins>
|
| 126 |
+
<plugin>
|
| 127 |
+
<artifactId>maven-failsafe-plugin</artifactId>
|
| 128 |
+
<version>${surefire-plugin.version}</version>
|
| 129 |
+
<executions>
|
| 130 |
+
<execution>
|
| 131 |
+
<goals>
|
| 132 |
+
<goal>integration-test</goal>
|
| 133 |
+
<goal>verify</goal>
|
| 134 |
+
</goals>
|
| 135 |
+
</execution>
|
| 136 |
+
</executions>
|
| 137 |
+
</plugin>
|
| 138 |
+
</plugins>
|
| 139 |
+
</build>
|
| 140 |
+
</profile>
|
| 141 |
+
</profiles>
|
| 142 |
+
</project>
|
benchmark/infrastructure/ejb-timersession/quarkus/src/main/java/jakarta/tutorial/timersession/ejb/TimerSessionBean.java
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (c), Eclipse Foundation, Inc. and its licensors.
|
| 3 |
+
*
|
| 4 |
+
* All rights reserved.
|
| 5 |
+
*
|
| 6 |
+
* This program and the accompanying materials are made available under the terms of the Eclipse
|
| 7 |
+
* Distribution License v1.0, which is available at
|
| 8 |
+
* https://www.eclipse.org/org/documents/edl-v10.php
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
package jakarta.tutorial.timersession.ejb;
|
| 13 |
+
|
| 14 |
+
import java.util.concurrent.ScheduledExecutorService;
|
| 15 |
+
import java.util.concurrent.TimeUnit;
|
| 16 |
+
import java.util.Date;
|
| 17 |
+
import java.util.logging.Level;
|
| 18 |
+
import java.util.logging.Logger;
|
| 19 |
+
import java.time.Instant;
|
| 20 |
+
|
| 21 |
+
import jakarta.enterprise.context.ApplicationScoped;
|
| 22 |
+
import jakarta.inject.Inject;
|
| 23 |
+
|
| 24 |
+
import io.quarkus.scheduler.Scheduled;
|
| 25 |
+
|
| 26 |
+
/**
|
| 27 |
+
* TimerBean is a singleton session bean that creates a timer and prints out a
|
| 28 |
+
* message when a
|
| 29 |
+
* timeout occurs.
|
| 30 |
+
*/
|
| 31 |
+
@ApplicationScoped
|
| 32 |
+
public class TimerSessionBean {
|
| 33 |
+
|
| 34 |
+
@Inject
|
| 35 |
+
ScheduledExecutorService executor;
|
| 36 |
+
|
| 37 |
+
private Date lastProgrammaticTimeout;
|
| 38 |
+
private Date lastAutomaticTimeout;
|
| 39 |
+
|
| 40 |
+
private static final Logger logger = Logger.getLogger("timersession.ejb.TimerSessionBean");
|
| 41 |
+
|
| 42 |
+
public void setTimer(long intervalDuration) {
|
| 43 |
+
logger.log(Level.INFO,
|
| 44 |
+
"Setting a programmatic timeout for {0} milliseconds from now.",
|
| 45 |
+
intervalDuration);
|
| 46 |
+
|
| 47 |
+
executor.schedule(() -> {
|
| 48 |
+
lastProgrammaticTimeout = Date.from(Instant.now());
|
| 49 |
+
logger.info("Programmatic timeout occurred.");
|
| 50 |
+
}, intervalDuration, TimeUnit.MILLISECONDS);
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
@Scheduled(cron = "0 */1 * * * ?")
|
| 54 |
+
public void automaticTimeout() {
|
| 55 |
+
this.setLastAutomaticTimeout(new Date());
|
| 56 |
+
logger.info("Automatic timeout occurred");
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
/**
|
| 60 |
+
* @return the lastTimeout
|
| 61 |
+
*/
|
| 62 |
+
public String getLastProgrammaticTimeout() {
|
| 63 |
+
if (lastProgrammaticTimeout != null) {
|
| 64 |
+
return lastProgrammaticTimeout.toString();
|
| 65 |
+
} else {
|
| 66 |
+
return "never";
|
| 67 |
+
}
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
/**
|
| 71 |
+
* @param lastTimeout the lastTimeout to set
|
| 72 |
+
*/
|
| 73 |
+
public void setLastProgrammaticTimeout(Date lastTimeout) {
|
| 74 |
+
this.lastProgrammaticTimeout = lastTimeout;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
/**
|
| 78 |
+
* @return the lastAutomaticTimeout
|
| 79 |
+
*/
|
| 80 |
+
public String getLastAutomaticTimeout() {
|
| 81 |
+
if (lastAutomaticTimeout != null) {
|
| 82 |
+
return lastAutomaticTimeout.toString();
|
| 83 |
+
} else {
|
| 84 |
+
return "never";
|
| 85 |
+
}
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
/**
|
| 89 |
+
* @param lastAutomaticTimeout the lastAutomaticTimeout to set
|
| 90 |
+
*/
|
| 91 |
+
public void setLastAutomaticTimeout(Date lastAutomaticTimeout) {
|
| 92 |
+
this.lastAutomaticTimeout = lastAutomaticTimeout;
|
| 93 |
+
}
|
| 94 |
+
}
|
benchmark/infrastructure/ejb-timersession/quarkus/src/main/java/jakarta/tutorial/timersession/web/TimerManager.java
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright (c), Eclipse Foundation, Inc. and its licensors.
|
| 3 |
+
*
|
| 4 |
+
* All rights reserved.
|
| 5 |
+
*
|
| 6 |
+
* This program and the accompanying materials are made available under the
|
| 7 |
+
* terms of the Eclipse Distribution License v1.0, which is available at
|
| 8 |
+
* https://www.eclipse.org/org/documents/edl-v10.php
|
| 9 |
+
*
|
| 10 |
+
* SPDX-License-Identifier: BSD-3-Clause
|
| 11 |
+
*/
|
| 12 |
+
package jakarta.tutorial.timersession.web;
|
| 13 |
+
|
| 14 |
+
import java.io.Serializable;
|
| 15 |
+
|
| 16 |
+
import jakarta.ejb.EJB;
|
| 17 |
+
import jakarta.enterprise.context.SessionScoped;
|
| 18 |
+
import jakarta.inject.Inject;
|
| 19 |
+
import jakarta.inject.Named;
|
| 20 |
+
import jakarta.tutorial.timersession.ejb.TimerSessionBean;
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
*
|
| 24 |
+
* @author ian
|
| 25 |
+
*/
|
| 26 |
+
@Named("timerManager")
|
| 27 |
+
@SessionScoped
|
| 28 |
+
public class TimerManager implements Serializable {
|
| 29 |
+
|
| 30 |
+
@Inject
|
| 31 |
+
private TimerSessionBean timerSession;
|
| 32 |
+
|
| 33 |
+
private String lastProgrammaticTimeout;
|
| 34 |
+
private String lastAutomaticTimeout;
|
| 35 |
+
|
| 36 |
+
/** Creates a new instance of TimerManager */
|
| 37 |
+
public TimerManager() {
|
| 38 |
+
this.lastProgrammaticTimeout = "never";
|
| 39 |
+
this.lastAutomaticTimeout = "never";
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* @return the lastTimeout
|
| 44 |
+
*/
|
| 45 |
+
public String getLastProgrammaticTimeout() {
|
| 46 |
+
lastProgrammaticTimeout = timerSession.getLastProgrammaticTimeout();
|
| 47 |
+
return lastProgrammaticTimeout;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
/**
|
| 51 |
+
* @param lastTimeout the lastTimeout to set
|
| 52 |
+
*/
|
| 53 |
+
public void setLastProgrammaticTimeout(String lastTimeout) {
|
| 54 |
+
this.lastProgrammaticTimeout = lastTimeout;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
public void setTimer() {
|
| 58 |
+
long timeoutDuration = 8000;
|
| 59 |
+
timerSession.setTimer(timeoutDuration);
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
/**
|
| 63 |
+
* @return the lastAutomaticTimeout
|
| 64 |
+
*/
|
| 65 |
+
public String getLastAutomaticTimeout() {
|
| 66 |
+
lastAutomaticTimeout = timerSession.getLastAutomaticTimeout();
|
| 67 |
+
return lastAutomaticTimeout;
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
/**
|
| 71 |
+
* @param lastAutomaticTimeout the lastAutomaticTimeout to set
|
| 72 |
+
*/
|
| 73 |
+
public void setLastAutomaticTimeout(String lastAutomaticTimeout) {
|
| 74 |
+
this.lastAutomaticTimeout = lastAutomaticTimeout;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
}
|
benchmark/infrastructure/ejb-timersession/quarkus/src/main/resources/META-INF/resources/timer-client.xhtml
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version='1.0' encoding='UTF-8' ?>
|
| 2 |
+
<!--
|
| 3 |
+
|
| 4 |
+
Copyright (c), Eclipse Foundation, Inc. and its licensors.
|
| 5 |
+
|
| 6 |
+
All rights reserved.
|
| 7 |
+
|
| 8 |
+
This program and the accompanying materials are made available under the
|
| 9 |
+
terms of the Eclipse Distribution License v1.0, which is available at
|
| 10 |
+
https://www.eclipse.org/org/documents/edl-v10.php
|
| 11 |
+
|
| 12 |
+
SPDX-License-Identifier: BSD-3-Clause
|
| 13 |
+
|
| 14 |
+
-->
|
| 15 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
| 16 |
+
<html lang="en"
|
| 17 |
+
xmlns="http://www.w3.org/1999/xhtml"
|
| 18 |
+
xmlns:ui="jakarta.faces.facelets"
|
| 19 |
+
xmlns:h="jakarta.faces.html">
|
| 20 |
+
<ui:composition template="/timer.xhtml">
|
| 21 |
+
<ui:define name="title">
|
| 22 |
+
Timer page
|
| 23 |
+
</ui:define>
|
| 24 |
+
|
| 25 |
+
<ui:define name="body">
|
| 26 |
+
<p>The last programmatic timeout was: #{timerManager.lastProgrammaticTimeout}.</p>
|
| 27 |
+
|
| 28 |
+
<p>The last automatic timeout was: #{timerManager.lastAutomaticTimeout}</p>
|
| 29 |
+
|
| 30 |
+
<p>Set a programmatic timer here.</p>
|
| 31 |
+
<h:form>
|
| 32 |
+
<h:commandButton value="Set Timer" action="#{timerManager.setTimer()}" />
|
| 33 |
+
<h:commandButton value="Refresh" action="timer-client"/>
|
| 34 |
+
</h:form>
|
| 35 |
+
</ui:define>
|
| 36 |
+
</ui:composition>
|
| 37 |
+
</html>
|
| 38 |
+
|
benchmark/infrastructure/ejb-timersession/quarkus/src/main/resources/META-INF/resources/timer.xhtml
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version='1.0' encoding='UTF-8' ?>
|
| 2 |
+
<!--
|
| 3 |
+
|
| 4 |
+
Copyright (c), Eclipse Foundation, Inc. and its licensors.
|
| 5 |
+
|
| 6 |
+
All rights reserved.
|
| 7 |
+
|
| 8 |
+
This program and the accompanying materials are made available under the
|
| 9 |
+
terms of the Eclipse Distribution License v1.0, which is available at
|
| 10 |
+
https://www.eclipse.org/org/documents/edl-v10.php
|
| 11 |
+
|
| 12 |
+
SPDX-License-Identifier: BSD-3-Clause
|
| 13 |
+
|
| 14 |
+
-->
|
| 15 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
| 16 |
+
<html lang="en"
|
| 17 |
+
xmlns="http://www.w3.org/1999/xhtml"
|
| 18 |
+
xmlns:ui="jakarta.faces.facelets"
|
| 19 |
+
xmlns:h="jakarta.faces.html">
|
| 20 |
+
<h:head>
|
| 21 |
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
| 22 |
+
<title>timer - An EJB timer service session bean example.</title>
|
| 23 |
+
</h:head>
|
| 24 |
+
|
| 25 |
+
<body>
|
| 26 |
+
<h1>
|
| 27 |
+
<ui:insert name="title">Default Title</ui:insert>
|
| 28 |
+
</h1>
|
| 29 |
+
<p>
|
| 30 |
+
<ui:insert name="body">Default Body</ui:insert>
|
| 31 |
+
</p>
|
| 32 |
+
</body>
|
| 33 |
+
</html>
|
| 34 |
+
|
benchmark/infrastructure/ejb-timersession/quarkus/src/main/resources/META-INF/web.xml
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version='1.0' encoding='UTF-8'?>
|
| 2 |
+
<!--
|
| 3 |
+
|
| 4 |
+
Copyright (c), Eclipse Foundation, Inc. and its licensors.
|
| 5 |
+
|
| 6 |
+
All rights reserved.
|
| 7 |
+
|
| 8 |
+
This program and the accompanying materials are made available under the
|
| 9 |
+
terms of the Eclipse Distribution License v1.0, which is available at
|
| 10 |
+
https://www.eclipse.org/org/documents/edl-v10.php
|
| 11 |
+
|
| 12 |
+
SPDX-License-Identifier: BSD-3-Clause
|
| 13 |
+
|
| 14 |
+
-->
|
| 15 |
+
<web-app version="5.0"
|
| 16 |
+
xmlns="https://jakarta.ee/xml/ns/jakartaee"
|
| 17 |
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
| 18 |
+
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd">
|
| 19 |
+
|
| 20 |
+
<display-name>timersession</display-name>
|
| 21 |
+
<context-param>
|
| 22 |
+
<description>
|
| 23 |
+
Tell the runtime where we are in the project development
|
| 24 |
+
lifecycle. Valid values are:
|
| 25 |
+
Development, UnitTest, SystemTest, or Production.
|
| 26 |
+
The runtime will display helpful hints to correct common mistakes
|
| 27 |
+
when the value is Development.
|
| 28 |
+
</description>
|
| 29 |
+
<param-name>jakarta.faces.PROJECT_STAGE</param-name>
|
| 30 |
+
<param-value>Development</param-value>
|
| 31 |
+
</context-param>
|
| 32 |
+
|
| 33 |
+
<!-- Faces Servlet -->
|
| 34 |
+
<servlet>
|
| 35 |
+
<servlet-name>Faces Servlet</servlet-name>
|
| 36 |
+
<servlet-class>jakarta.faces.webapp.FacesServlet</servlet-class>
|
| 37 |
+
<load-on-startup>1</load-on-startup>
|
| 38 |
+
</servlet>
|
| 39 |
+
|
| 40 |
+
<servlet-mapping>
|
| 41 |
+
<servlet-name>Faces Servlet</servlet-name>
|
| 42 |
+
<url-pattern>*.xhtml</url-pattern>
|
| 43 |
+
</servlet-mapping>
|
| 44 |
+
|
| 45 |
+
<welcome-file-list>
|
| 46 |
+
<welcome-file>timer-client.xhtml</welcome-file>
|
| 47 |
+
</welcome-file-list>
|
| 48 |
+
|
| 49 |
+
</web-app>
|
benchmark/infrastructure/ejb-timersession/quarkus/src/main/resources/application.properties
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
quarkus.http.port=9080
|
| 2 |
+
quarkus.http.root-path=/timersession
|
| 3 |
+
quarkus.scheduler.enabled=true
|
| 4 |
+
|
| 5 |
+
# Logging
|
| 6 |
+
quarkus.log.level=INFO
|
benchmark/infrastructure/ejb-timersession/quarkus/test.sh
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
set -euo pipefail
|
| 3 |
+
|
| 4 |
+
BASE_URL="${BASE_URL:-http://localhost:9080}"
|
| 5 |
+
|
| 6 |
+
echo "Health check: ${BASE_URL}/"
|
| 7 |
+
HTTP_STATUS=$(curl -sL -o /dev/null -w "%{http_code}" "${BASE_URL}/")
|
| 8 |
+
|
| 9 |
+
if [ "$HTTP_STATUS" -eq 200 ]; then
|
| 10 |
+
echo "PASS - got HTTP ${HTTP_STATUS}"
|
| 11 |
+
exit 0
|
| 12 |
+
else
|
| 13 |
+
echo "FAIL - got HTTP ${HTTP_STATUS}"
|
| 14 |
+
exit 1
|
| 15 |
+
fi
|
benchmark/infrastructure/ejb-timersession/spring/.dockerignore
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# VCS
|
| 2 |
+
.git/
|
| 3 |
+
|
| 4 |
+
# Maven
|
| 5 |
+
.mvn/
|
| 6 |
+
**/.mvn/
|
| 7 |
+
mvnw
|
| 8 |
+
mvnw.cmd
|
| 9 |
+
**/mvnw
|
| 10 |
+
**/mvnw.cmd
|
| 11 |
+
target/
|
| 12 |
+
**/target/
|
| 13 |
+
pom.xml.tag
|
| 14 |
+
pom.xml.releaseBackup
|
| 15 |
+
pom.xml.versionsBackup
|
| 16 |
+
pom.xml.next
|
| 17 |
+
release.properties
|
| 18 |
+
dependency-reduced-pom.xml
|
| 19 |
+
buildNumber.properties
|
| 20 |
+
|
| 21 |
+
# IDE / Editor
|
| 22 |
+
.vscode/
|
| 23 |
+
**/.vscode/
|
| 24 |
+
.zed/
|
| 25 |
+
**/.zed/
|
| 26 |
+
.idea/
|
| 27 |
+
**/.idea/
|
| 28 |
+
*.iml
|
| 29 |
+
*.ipr
|
| 30 |
+
*.iws
|
| 31 |
+
|
| 32 |
+
# OS
|
| 33 |
+
.DS_Store
|
| 34 |
+
**/.DS_Store
|
| 35 |
+
Thumbs.db
|
| 36 |
+
ehthumbs.db
|
| 37 |
+
|
| 38 |
+
# Logs / temp
|
| 39 |
+
*.log
|
| 40 |
+
*.tmp
|
| 41 |
+
*.temp
|
benchmark/infrastructure/ejb-timersession/spring/.mvn/wrapper/maven-wrapper.properties
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
wrapperVersion=3.3.4
|
| 2 |
+
distributionType=only-script
|
| 3 |
+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.10/apache-maven-3.9.10-bin.zip
|
benchmark/infrastructure/ejb-timersession/spring/Dockerfile
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM maven:3.9.12-ibm-semeru-21-noble
|
| 2 |
+
|
| 3 |
+
USER root
|
| 4 |
+
# install uv
|
| 5 |
+
RUN apt-get update && apt-get install -y --no-install-recommends curl python3-venv python3-full && curl -LsSf https://astral.sh/uv/install.sh | sh
|
| 6 |
+
|
| 7 |
+
ENV PATH="/root/.local/bin:$PATH"
|
| 8 |
+
|
| 9 |
+
# Shared browsers path so Chromium is cached once
|
| 10 |
+
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
|
| 11 |
+
RUN mkdir -p /ms-playwright && chmod 755 /ms-playwright
|
| 12 |
+
|
| 13 |
+
# create venv and install
|
| 14 |
+
RUN uv venv /opt/venv && uv pip install --python /opt/venv/bin/python playwright==1.47.0 pytest
|
| 15 |
+
|
| 16 |
+
ENV PATH="/opt/venv/bin:$PATH"
|
| 17 |
+
RUN playwright install --with-deps chromium
|
| 18 |
+
|
| 19 |
+
# Set working directory
|
| 20 |
+
WORKDIR /app
|
| 21 |
+
|
| 22 |
+
# Copy all the assets
|
| 23 |
+
COPY . .
|
| 24 |
+
|
| 25 |
+
COPY test.sh .
|
| 26 |
+
RUN chmod +x test.sh
|
| 27 |
+
|
| 28 |
+
# Build application at image build time
|
| 29 |
+
RUN mvn clean install -DskipTests
|
| 30 |
+
|
| 31 |
+
CMD ["mvn", "spring-boot:run"]
|
benchmark/infrastructure/ejb-timersession/spring/mvnw
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
# ----------------------------------------------------------------------------
|
| 3 |
+
# Licensed to the Apache Software Foundation (ASF) under one
|
| 4 |
+
# or more contributor license agreements. See the NOTICE file
|
| 5 |
+
# distributed with this work for additional information
|
| 6 |
+
# regarding copyright ownership. The ASF licenses this file
|
| 7 |
+
# to you under the Apache License, Version 2.0 (the
|
| 8 |
+
# "License"); you may not use this file except in compliance
|
| 9 |
+
# with the License. You may obtain a copy of the License at
|
| 10 |
+
#
|
| 11 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 12 |
+
#
|
| 13 |
+
# Unless required by applicable law or agreed to in writing,
|
| 14 |
+
# software distributed under the License is distributed on an
|
| 15 |
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
| 16 |
+
# KIND, either express or implied. See the License for the
|
| 17 |
+
# specific language governing permissions and limitations
|
| 18 |
+
# under the License.
|
| 19 |
+
# ----------------------------------------------------------------------------
|
| 20 |
+
|
| 21 |
+
# ----------------------------------------------------------------------------
|
| 22 |
+
# Apache Maven Wrapper startup batch script, version 3.3.2
|
| 23 |
+
#
|
| 24 |
+
# Optional ENV vars
|
| 25 |
+
# -----------------
|
| 26 |
+
# JAVA_HOME - location of a JDK home dir, required when download maven via java source
|
| 27 |
+
# MVNW_REPOURL - repo url base for downloading maven distribution
|
| 28 |
+
# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
|
| 29 |
+
# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
|
| 30 |
+
# ----------------------------------------------------------------------------
|
| 31 |
+
|
| 32 |
+
set -euf
|
| 33 |
+
[ "${MVNW_VERBOSE-}" != debug ] || set -x
|
| 34 |
+
|
| 35 |
+
# OS specific support.
|
| 36 |
+
native_path() { printf %s\\n "$1"; }
|
| 37 |
+
case "$(uname)" in
|
| 38 |
+
CYGWIN* | MINGW*)
|
| 39 |
+
[ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
|
| 40 |
+
native_path() { cygpath --path --windows "$1"; }
|
| 41 |
+
;;
|
| 42 |
+
esac
|
| 43 |
+
|
| 44 |
+
# set JAVACMD and JAVACCMD
|
| 45 |
+
set_java_home() {
|
| 46 |
+
# For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
|
| 47 |
+
if [ -n "${JAVA_HOME-}" ]; then
|
| 48 |
+
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
|
| 49 |
+
# IBM's JDK on AIX uses strange locations for the executables
|
| 50 |
+
JAVACMD="$JAVA_HOME/jre/sh/java"
|
| 51 |
+
JAVACCMD="$JAVA_HOME/jre/sh/javac"
|
| 52 |
+
else
|
| 53 |
+
JAVACMD="$JAVA_HOME/bin/java"
|
| 54 |
+
JAVACCMD="$JAVA_HOME/bin/javac"
|
| 55 |
+
|
| 56 |
+
if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
|
| 57 |
+
echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
|
| 58 |
+
echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
|
| 59 |
+
return 1
|
| 60 |
+
fi
|
| 61 |
+
fi
|
| 62 |
+
else
|
| 63 |
+
JAVACMD="$(
|
| 64 |
+
'set' +e
|
| 65 |
+
'unset' -f command 2>/dev/null
|
| 66 |
+
'command' -v java
|
| 67 |
+
)" || :
|
| 68 |
+
JAVACCMD="$(
|
| 69 |
+
'set' +e
|
| 70 |
+
'unset' -f command 2>/dev/null
|
| 71 |
+
'command' -v javac
|
| 72 |
+
)" || :
|
| 73 |
+
|
| 74 |
+
if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
|
| 75 |
+
echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
|
| 76 |
+
return 1
|
| 77 |
+
fi
|
| 78 |
+
fi
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
# hash string like Java String::hashCode
|
| 82 |
+
hash_string() {
|
| 83 |
+
str="${1:-}" h=0
|
| 84 |
+
while [ -n "$str" ]; do
|
| 85 |
+
char="${str%"${str#?}"}"
|
| 86 |
+
h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
|
| 87 |
+
str="${str#?}"
|
| 88 |
+
done
|
| 89 |
+
printf %x\\n $h
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
verbose() { :; }
|
| 93 |
+
[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
|
| 94 |
+
|
| 95 |
+
die() {
|
| 96 |
+
printf %s\\n "$1" >&2
|
| 97 |
+
exit 1
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
trim() {
|
| 101 |
+
# MWRAPPER-139:
|
| 102 |
+
# Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
|
| 103 |
+
# Needed for removing poorly interpreted newline sequences when running in more
|
| 104 |
+
# exotic environments such as mingw bash on Windows.
|
| 105 |
+
printf "%s" "${1}" | tr -d '[:space:]'
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
|
| 109 |
+
while IFS="=" read -r key value; do
|
| 110 |
+
case "${key-}" in
|
| 111 |
+
distributionUrl) distributionUrl=$(trim "${value-}") ;;
|
| 112 |
+
distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
|
| 113 |
+
esac
|
| 114 |
+
done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
|
| 115 |
+
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties"
|
| 116 |
+
|
| 117 |
+
case "${distributionUrl##*/}" in
|
| 118 |
+
maven-mvnd-*bin.*)
|
| 119 |
+
MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
|
| 120 |
+
case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
|
| 121 |
+
*AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
|
| 122 |
+
:Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
|
| 123 |
+
:Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
|
| 124 |
+
:Linux*x86_64*) distributionPlatform=linux-amd64 ;;
|
| 125 |
+
*)
|
| 126 |
+
echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
|
| 127 |
+
distributionPlatform=linux-amd64
|
| 128 |
+
;;
|
| 129 |
+
esac
|
| 130 |
+
distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
|
| 131 |
+
;;
|
| 132 |
+
maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
|
| 133 |
+
*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
|
| 134 |
+
esac
|
| 135 |
+
|
| 136 |
+
# apply MVNW_REPOURL and calculate MAVEN_HOME
|
| 137 |
+
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
|
| 138 |
+
[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
|
| 139 |
+
distributionUrlName="${distributionUrl##*/}"
|
| 140 |
+
distributionUrlNameMain="${distributionUrlName%.*}"
|
| 141 |
+
distributionUrlNameMain="${distributionUrlNameMain%-bin}"
|
| 142 |
+
MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
|
| 143 |
+
MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
|
| 144 |
+
|
| 145 |
+
exec_maven() {
|
| 146 |
+
unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
|
| 147 |
+
exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
if [ -d "$MAVEN_HOME" ]; then
|
| 151 |
+
verbose "found existing MAVEN_HOME at $MAVEN_HOME"
|
| 152 |
+
exec_maven "$@"
|
| 153 |
+
fi
|
| 154 |
+
|
| 155 |
+
case "${distributionUrl-}" in
|
| 156 |
+
*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
|
| 157 |
+
*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
|
| 158 |
+
esac
|
| 159 |
+
|
| 160 |
+
# prepare tmp dir
|
| 161 |
+
if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
|
| 162 |
+
clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
|
| 163 |
+
trap clean HUP INT TERM EXIT
|
| 164 |
+
else
|
| 165 |
+
die "cannot create temp dir"
|
| 166 |
+
fi
|
| 167 |
+
|
| 168 |
+
mkdir -p -- "${MAVEN_HOME%/*}"
|
| 169 |
+
|
| 170 |
+
# Download and Install Apache Maven
|
| 171 |
+
verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
|
| 172 |
+
verbose "Downloading from: $distributionUrl"
|
| 173 |
+
verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
|
| 174 |
+
|
| 175 |
+
# select .zip or .tar.gz
|
| 176 |
+
if ! command -v unzip >/dev/null; then
|
| 177 |
+
distributionUrl="${distributionUrl%.zip}.tar.gz"
|
| 178 |
+
distributionUrlName="${distributionUrl##*/}"
|
| 179 |
+
fi
|
| 180 |
+
|
| 181 |
+
# verbose opt
|
| 182 |
+
__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
|
| 183 |
+
[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
|
| 184 |
+
|
| 185 |
+
# normalize http auth
|
| 186 |
+
case "${MVNW_PASSWORD:+has-password}" in
|
| 187 |
+
'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
|
| 188 |
+
has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
|
| 189 |
+
esac
|
| 190 |
+
|
| 191 |
+
if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
|
| 192 |
+
verbose "Found wget ... using wget"
|
| 193 |
+
wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
|
| 194 |
+
elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
|
| 195 |
+
verbose "Found curl ... using curl"
|
| 196 |
+
curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
|
| 197 |
+
elif set_java_home; then
|
| 198 |
+
verbose "Falling back to use Java to download"
|
| 199 |
+
javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
|
| 200 |
+
targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
|
| 201 |
+
cat >"$javaSource" <<-END
|
| 202 |
+
public class Downloader extends java.net.Authenticator
|
| 203 |
+
{
|
| 204 |
+
protected java.net.PasswordAuthentication getPasswordAuthentication()
|
| 205 |
+
{
|
| 206 |
+
return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
|
| 207 |
+
}
|
| 208 |
+
public static void main( String[] args ) throws Exception
|
| 209 |
+
{
|
| 210 |
+
setDefault( new Downloader() );
|
| 211 |
+
java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
|
| 212 |
+
}
|
| 213 |
+
}
|
| 214 |
+
END
|
| 215 |
+
# For Cygwin/MinGW, switch paths to Windows format before running javac and java
|
| 216 |
+
verbose " - Compiling Downloader.java ..."
|
| 217 |
+
"$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
|
| 218 |
+
verbose " - Running Downloader.java ..."
|
| 219 |
+
"$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
|
| 220 |
+
fi
|
| 221 |
+
|
| 222 |
+
# If specified, validate the SHA-256 sum of the Maven distribution zip file
|
| 223 |
+
if [ -n "${distributionSha256Sum-}" ]; then
|
| 224 |
+
distributionSha256Result=false
|
| 225 |
+
if [ "$MVN_CMD" = mvnd.sh ]; then
|
| 226 |
+
echo "Checksum validation is not supported for maven-mvnd." >&2
|
| 227 |
+
echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
|
| 228 |
+
exit 1
|
| 229 |
+
elif command -v sha256sum >/dev/null; then
|
| 230 |
+
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then
|
| 231 |
+
distributionSha256Result=true
|
| 232 |
+
fi
|
| 233 |
+
elif command -v shasum >/dev/null; then
|
| 234 |
+
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
|
| 235 |
+
distributionSha256Result=true
|
| 236 |
+
fi
|
| 237 |
+
else
|
| 238 |
+
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
|
| 239 |
+
echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
|
| 240 |
+
exit 1
|
| 241 |
+
fi
|
| 242 |
+
if [ $distributionSha256Result = false ]; then
|
| 243 |
+
echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
|
| 244 |
+
echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
|
| 245 |
+
exit 1
|
| 246 |
+
fi
|
| 247 |
+
fi
|
| 248 |
+
|
| 249 |
+
# unzip and move
|
| 250 |
+
if command -v unzip >/dev/null; then
|
| 251 |
+
unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
|
| 252 |
+
else
|
| 253 |
+
tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
|
| 254 |
+
fi
|
| 255 |
+
printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url"
|
| 256 |
+
mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
|
| 257 |
+
|
| 258 |
+
clean || :
|
| 259 |
+
exec_maven "$@"
|
benchmark/infrastructure/ejb-timersession/spring/mvnw.cmd
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<# : batch portion
|
| 2 |
+
@REM ----------------------------------------------------------------------------
|
| 3 |
+
@REM Licensed to the Apache Software Foundation (ASF) under one
|
| 4 |
+
@REM or more contributor license agreements. See the NOTICE file
|
| 5 |
+
@REM distributed with this work for additional information
|
| 6 |
+
@REM regarding copyright ownership. The ASF licenses this file
|
| 7 |
+
@REM to you under the Apache License, Version 2.0 (the
|
| 8 |
+
@REM "License"); you may not use this file except in compliance
|
| 9 |
+
@REM with the License. You may obtain a copy of the License at
|
| 10 |
+
@REM
|
| 11 |
+
@REM http://www.apache.org/licenses/LICENSE-2.0
|
| 12 |
+
@REM
|
| 13 |
+
@REM Unless required by applicable law or agreed to in writing,
|
| 14 |
+
@REM software distributed under the License is distributed on an
|
| 15 |
+
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
| 16 |
+
@REM KIND, either express or implied. See the License for the
|
| 17 |
+
@REM specific language governing permissions and limitations
|
| 18 |
+
@REM under the License.
|
| 19 |
+
@REM ----------------------------------------------------------------------------
|
| 20 |
+
|
| 21 |
+
@REM ----------------------------------------------------------------------------
|
| 22 |
+
@REM Apache Maven Wrapper startup batch script, version 3.3.2
|
| 23 |
+
@REM
|
| 24 |
+
@REM Optional ENV vars
|
| 25 |
+
@REM MVNW_REPOURL - repo url base for downloading maven distribution
|
| 26 |
+
@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
|
| 27 |
+
@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output
|
| 28 |
+
@REM ----------------------------------------------------------------------------
|
| 29 |
+
|
| 30 |
+
@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
|
| 31 |
+
@SET __MVNW_CMD__=
|
| 32 |
+
@SET __MVNW_ERROR__=
|
| 33 |
+
@SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
|
| 34 |
+
@SET PSModulePath=
|
| 35 |
+
@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
|
| 36 |
+
IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
|
| 37 |
+
)
|
| 38 |
+
@SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
|
| 39 |
+
@SET __MVNW_PSMODULEP_SAVE=
|
| 40 |
+
@SET __MVNW_ARG0_NAME__=
|
| 41 |
+
@SET MVNW_USERNAME=
|
| 42 |
+
@SET MVNW_PASSWORD=
|
| 43 |
+
@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*)
|
| 44 |
+
@echo Cannot start maven from wrapper >&2 && exit /b 1
|
| 45 |
+
@GOTO :EOF
|
| 46 |
+
: end batch / begin powershell #>
|
| 47 |
+
|
| 48 |
+
$ErrorActionPreference = "Stop"
|
| 49 |
+
if ($env:MVNW_VERBOSE -eq "true") {
|
| 50 |
+
$VerbosePreference = "Continue"
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
|
| 54 |
+
$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
|
| 55 |
+
if (!$distributionUrl) {
|
| 56 |
+
Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
|
| 60 |
+
"maven-mvnd-*" {
|
| 61 |
+
$USE_MVND = $true
|
| 62 |
+
$distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
|
| 63 |
+
$MVN_CMD = "mvnd.cmd"
|
| 64 |
+
break
|
| 65 |
+
}
|
| 66 |
+
default {
|
| 67 |
+
$USE_MVND = $false
|
| 68 |
+
$MVN_CMD = $script -replace '^mvnw','mvn'
|
| 69 |
+
break
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
# apply MVNW_REPOURL and calculate MAVEN_HOME
|
| 74 |
+
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
|
| 75 |
+
if ($env:MVNW_REPOURL) {
|
| 76 |
+
$MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" }
|
| 77 |
+
$distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')"
|
| 78 |
+
}
|
| 79 |
+
$distributionUrlName = $distributionUrl -replace '^.*/',''
|
| 80 |
+
$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
|
| 81 |
+
$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain"
|
| 82 |
+
if ($env:MAVEN_USER_HOME) {
|
| 83 |
+
$MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain"
|
| 84 |
+
}
|
| 85 |
+
$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
|
| 86 |
+
$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
|
| 87 |
+
|
| 88 |
+
if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
|
| 89 |
+
Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
|
| 90 |
+
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
|
| 91 |
+
exit $?
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
|
| 95 |
+
Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
# prepare tmp dir
|
| 99 |
+
$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
|
| 100 |
+
$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
|
| 101 |
+
$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
|
| 102 |
+
trap {
|
| 103 |
+
if ($TMP_DOWNLOAD_DIR.Exists) {
|
| 104 |
+
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
|
| 105 |
+
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
|
| 106 |
+
}
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null
|
| 110 |
+
|
| 111 |
+
# Download and Install Apache Maven
|
| 112 |
+
Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
|
| 113 |
+
Write-Verbose "Downloading from: $distributionUrl"
|
| 114 |
+
Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
|
| 115 |
+
|
| 116 |
+
$webclient = New-Object System.Net.WebClient
|
| 117 |
+
if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
|
| 118 |
+
$webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
|
| 119 |
+
}
|
| 120 |
+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
| 121 |
+
$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null
|
| 122 |
+
|
| 123 |
+
# If specified, validate the SHA-256 sum of the Maven distribution zip file
|
| 124 |
+
$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
|
| 125 |
+
if ($distributionSha256Sum) {
|
| 126 |
+
if ($USE_MVND) {
|
| 127 |
+
Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
|
| 128 |
+
}
|
| 129 |
+
Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
|
| 130 |
+
if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
|
| 131 |
+
Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
|
| 132 |
+
}
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
# unzip and move
|
| 136 |
+
Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
|
| 137 |
+
Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null
|
| 138 |
+
try {
|
| 139 |
+
Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
|
| 140 |
+
} catch {
|
| 141 |
+
if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
|
| 142 |
+
Write-Error "fail to move MAVEN_HOME"
|
| 143 |
+
}
|
| 144 |
+
} finally {
|
| 145 |
+
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
|
| 146 |
+
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
|
benchmark/infrastructure/ejb-timersession/spring/pom.xml
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
| 3 |
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
| 4 |
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
| 5 |
+
<modelVersion>4.0.0</modelVersion>
|
| 6 |
+
|
| 7 |
+
<parent>
|
| 8 |
+
<groupId>org.springframework.boot</groupId>
|
| 9 |
+
<artifactId>spring-boot-starter-parent</artifactId>
|
| 10 |
+
<version>3.5.9</version>
|
| 11 |
+
<relativePath />
|
| 12 |
+
</parent>
|
| 13 |
+
|
| 14 |
+
<groupId>org.springframework.tutorial.timersession</groupId>
|
| 15 |
+
<artifactId>timersession</artifactId>
|
| 16 |
+
<version>1.0.0-SNAPSHOT</version>
|
| 17 |
+
<packaging>jar</packaging>
|
| 18 |
+
<name>timersession</name>
|
| 19 |
+
<description>Spring Boot Timersession Example</description>
|
| 20 |
+
|
| 21 |
+
<properties>
|
| 22 |
+
<java.version>17</java.version>
|
| 23 |
+
<maven.compiler.source>17</maven.compiler.source>
|
| 24 |
+
<maven.compiler.target>17</maven.compiler.target>
|
| 25 |
+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
| 26 |
+
</properties>
|
| 27 |
+
|
| 28 |
+
<dependencies>
|
| 29 |
+
<dependency>
|
| 30 |
+
<groupId>org.springframework.boot</groupId>
|
| 31 |
+
<artifactId>spring-boot-starter-web</artifactId>
|
| 32 |
+
</dependency>
|
| 33 |
+
|
| 34 |
+
<dependency>
|
| 35 |
+
<groupId>org.springframework.boot</groupId>
|
| 36 |
+
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
| 37 |
+
</dependency>
|
| 38 |
+
|
| 39 |
+
<dependency>
|
| 40 |
+
<groupId>org.springframework.boot</groupId>
|
| 41 |
+
<artifactId>spring-boot-starter-test</artifactId>
|
| 42 |
+
<scope>test</scope>
|
| 43 |
+
</dependency>
|
| 44 |
+
</dependencies>
|
| 45 |
+
|
| 46 |
+
<build>
|
| 47 |
+
<finalName>timersession</finalName>
|
| 48 |
+
<plugins>
|
| 49 |
+
<plugin>
|
| 50 |
+
<groupId>org.springframework.boot</groupId>
|
| 51 |
+
<artifactId>spring-boot-maven-plugin</artifactId>
|
| 52 |
+
</plugin>
|
| 53 |
+
</plugins>
|
| 54 |
+
</build>
|
| 55 |
+
</project>
|
benchmark/infrastructure/ejb-timersession/spring/src/main/java/jakarta/tutorial/timersession/Application.java
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
package jakarta.tutorial.timersession;
|
| 2 |
+
|
| 3 |
+
import org.springframework.boot.SpringApplication;
|
| 4 |
+
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
| 5 |
+
|
| 6 |
+
@SpringBootApplication
|
| 7 |
+
public class Application {
|
| 8 |
+
|
| 9 |
+
public static void main(String[] args) {
|
| 10 |
+
SpringApplication.run(Application.class, args);
|
| 11 |
+
}
|
| 12 |
+
}
|
benchmark/infrastructure/ejb-timersession/spring/src/main/java/jakarta/tutorial/timersession/SchedulingConfig.java
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
package jakarta.tutorial.timersession;
|
| 2 |
+
|
| 3 |
+
import org.springframework.context.annotation.Bean;
|
| 4 |
+
import org.springframework.context.annotation.Configuration;
|
| 5 |
+
import org.springframework.scheduling.annotation.EnableScheduling;
|
| 6 |
+
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
| 7 |
+
|
| 8 |
+
@Configuration
|
| 9 |
+
@EnableScheduling
|
| 10 |
+
public class SchedulingConfig {
|
| 11 |
+
|
| 12 |
+
@Bean
|
| 13 |
+
public ThreadPoolTaskScheduler taskScheduler() {
|
| 14 |
+
ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
|
| 15 |
+
scheduler.setPoolSize(5);
|
| 16 |
+
scheduler.setThreadNamePrefix("timer-");
|
| 17 |
+
scheduler.initialize();
|
| 18 |
+
return scheduler;
|
| 19 |
+
}
|
| 20 |
+
}
|
benchmark/infrastructure/ejb-timersession/spring/src/main/java/jakarta/tutorial/timersession/ejb/TimerSessionService.java
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
package jakarta.tutorial.timersession.ejb;
|
| 2 |
+
|
| 3 |
+
import java.time.Instant;
|
| 4 |
+
import java.util.Date;
|
| 5 |
+
import java.util.concurrent.ScheduledFuture;
|
| 6 |
+
import java.util.logging.Level;
|
| 7 |
+
import java.util.logging.Logger;
|
| 8 |
+
|
| 9 |
+
import org.springframework.scheduling.TaskScheduler;
|
| 10 |
+
import org.springframework.scheduling.annotation.Scheduled;
|
| 11 |
+
import org.springframework.stereotype.Service;
|
| 12 |
+
|
| 13 |
+
@Service
|
| 14 |
+
public class TimerSessionService {
|
| 15 |
+
|
| 16 |
+
private static final Logger logger = Logger.getLogger(TimerSessionService.class.getName());
|
| 17 |
+
|
| 18 |
+
private final TaskScheduler taskScheduler;
|
| 19 |
+
|
| 20 |
+
private Date lastProgrammaticTimeout;
|
| 21 |
+
private Date lastAutomaticTimeout;
|
| 22 |
+
|
| 23 |
+
public TimerSessionService(TaskScheduler taskScheduler) {
|
| 24 |
+
this.taskScheduler = taskScheduler;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
public void setTimer(long intervalDurationMillis) {
|
| 28 |
+
logger.log(Level.INFO,
|
| 29 |
+
"Setting a programmatic timeout for {0} milliseconds from now.",
|
| 30 |
+
intervalDurationMillis);
|
| 31 |
+
|
| 32 |
+
Instant triggerTime = Instant.now().plusMillis(intervalDurationMillis);
|
| 33 |
+
|
| 34 |
+
taskScheduler.schedule(this::programmaticTimeout, triggerTime);
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
private void programmaticTimeout() {
|
| 38 |
+
this.lastProgrammaticTimeout = new Date();
|
| 39 |
+
logger.info("Programmatic timeout occurred.");
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
@Scheduled(cron = "0 */1 * * * *")
|
| 43 |
+
public void automaticTimeout() {
|
| 44 |
+
this.lastAutomaticTimeout = new Date();
|
| 45 |
+
logger.info("Automatic timeout occurred.");
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
public String getLastProgrammaticTimeout() {
|
| 49 |
+
return lastProgrammaticTimeout != null
|
| 50 |
+
? lastProgrammaticTimeout.toString()
|
| 51 |
+
: "never";
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
public String getLastAutomaticTimeout() {
|
| 55 |
+
return lastAutomaticTimeout != null
|
| 56 |
+
? lastAutomaticTimeout.toString()
|
| 57 |
+
: "never";
|
| 58 |
+
}
|
| 59 |
+
}
|
benchmark/infrastructure/ejb-timersession/spring/src/main/java/jakarta/tutorial/timersession/web/TimerController.java
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
package jakarta.tutorial.timersession.web;
|
| 2 |
+
|
| 3 |
+
import org.springframework.stereotype.Controller;
|
| 4 |
+
import org.springframework.ui.Model;
|
| 5 |
+
import org.springframework.web.bind.annotation.GetMapping;
|
| 6 |
+
import org.springframework.web.bind.annotation.PostMapping;
|
| 7 |
+
|
| 8 |
+
@Controller
|
| 9 |
+
public class TimerController {
|
| 10 |
+
|
| 11 |
+
private final TimerManager timerManager;
|
| 12 |
+
|
| 13 |
+
public TimerController(TimerManager timerManager) {
|
| 14 |
+
this.timerManager = timerManager;
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
@GetMapping("/")
|
| 18 |
+
public String timerPage(Model model) {
|
| 19 |
+
model.addAttribute(
|
| 20 |
+
"lastProgrammaticTimeout",
|
| 21 |
+
timerManager.getLastProgrammaticTimeout());
|
| 22 |
+
|
| 23 |
+
model.addAttribute(
|
| 24 |
+
"lastAutomaticTimeout",
|
| 25 |
+
timerManager.getLastAutomaticTimeout());
|
| 26 |
+
return "timer-client";
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
@PostMapping("/set")
|
| 30 |
+
public String setTimer() {
|
| 31 |
+
timerManager.setTimer();
|
| 32 |
+
return "redirect:/";
|
| 33 |
+
}
|
| 34 |
+
}
|
benchmark/infrastructure/ejb-timersession/spring/src/main/java/jakarta/tutorial/timersession/web/TimerManager.java
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
package jakarta.tutorial.timersession.web;
|
| 2 |
+
|
| 3 |
+
import java.io.Serializable;
|
| 4 |
+
|
| 5 |
+
import org.springframework.stereotype.Component;
|
| 6 |
+
import org.springframework.web.context.annotation.SessionScope;
|
| 7 |
+
|
| 8 |
+
import jakarta.tutorial.timersession.ejb.TimerSessionService;
|
| 9 |
+
|
| 10 |
+
@Component
|
| 11 |
+
@SessionScope
|
| 12 |
+
public class TimerManager implements Serializable {
|
| 13 |
+
|
| 14 |
+
private final TimerSessionService timerSessionService;
|
| 15 |
+
|
| 16 |
+
private String lastProgrammaticTimeout = "never";
|
| 17 |
+
private String lastAutomaticTimeout = "never";
|
| 18 |
+
|
| 19 |
+
public TimerManager(TimerSessionService timerSessionService) {
|
| 20 |
+
this.timerSessionService = timerSessionService;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
public void setTimer() {
|
| 24 |
+
long timeoutDuration = 8000;
|
| 25 |
+
timerSessionService.setTimer(timeoutDuration);
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
public String getLastProgrammaticTimeout() {
|
| 29 |
+
lastProgrammaticTimeout = timerSessionService.getLastProgrammaticTimeout();
|
| 30 |
+
return lastProgrammaticTimeout;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
public String getLastAutomaticTimeout() {
|
| 34 |
+
lastAutomaticTimeout = timerSessionService.getLastAutomaticTimeout();
|
| 35 |
+
return lastAutomaticTimeout;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
public void setLastProgrammaticTimeout(String value) {
|
| 39 |
+
this.lastProgrammaticTimeout = value;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
public void setLastAutomaticTimeout(String value) {
|
| 43 |
+
this.lastAutomaticTimeout = value;
|
| 44 |
+
}
|
| 45 |
+
}
|
benchmark/infrastructure/ejb-timersession/spring/src/main/resources/application.properties
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Spring Boot Configuration
|
| 2 |
+
spring.application.name=timersession
|
| 3 |
+
|
| 4 |
+
server.servlet.contextPath=/timersession
|
| 5 |
+
|
| 6 |
+
# Logging configuration
|
| 7 |
+
logging.level.org.springframework.tutorial.decorators=INFO
|
| 8 |
+
logging.pattern.console=%d{yyyy-MM-dd HH:mm:ss} - %msg%n
|
| 9 |
+
|
| 10 |
+
# Server configuration
|
| 11 |
+
server.port=9080
|
benchmark/infrastructure/ejb-timersession/spring/src/main/resources/templates/timer-client.html
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<th:block xmlns:th="http://www.thymeleaf.org" th:replace="~{timer :: layout(~{::title}, ~{::body})}">
|
| 2 |
+
|
| 3 |
+
<!-- Title fragment -->
|
| 4 |
+
<th:block th:fragment="title">
|
| 5 |
+
Timer page
|
| 6 |
+
</th:block>
|
| 7 |
+
|
| 8 |
+
<!-- Body fragment -->
|
| 9 |
+
<th:block th:fragment="body">
|
| 10 |
+
|
| 11 |
+
<p th:inline="text">The last programmatic timeout was: [[${lastProgrammaticTimeout}]].</p>
|
| 12 |
+
|
| 13 |
+
<p th:inline="text">The last automatic timeout was: [[${lastAutomaticTimeout}]].</p>
|
| 14 |
+
|
| 15 |
+
<p>Set a programmatic timer here.</p>
|
| 16 |
+
|
| 17 |
+
<form th:action="@{/set}" method="post">
|
| 18 |
+
<button type="submit">Set Timer</button>
|
| 19 |
+
</form>
|
| 20 |
+
|
| 21 |
+
<form th:action="@{/}" method="get">
|
| 22 |
+
<button type="submit">Refresh</button>
|
| 23 |
+
</form>
|
| 24 |
+
|
| 25 |
+
</th:block>
|
| 26 |
+
|
| 27 |
+
</th:block>
|
benchmark/infrastructure/ejb-timersession/spring/src/main/resources/templates/timer.html
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en" xmlns:th="http://www.thymeleaf.org" th:fragment="layout(title, body)">
|
| 3 |
+
|
| 4 |
+
<head>
|
| 5 |
+
<meta charset="UTF-8" />
|
| 6 |
+
<title>timer - An EJB timer service session bean example</title>
|
| 7 |
+
</head>
|
| 8 |
+
|
| 9 |
+
<body>
|
| 10 |
+
|
| 11 |
+
<h1 th:replace="${title}">
|
| 12 |
+
Default Title
|
| 13 |
+
</h1>
|
| 14 |
+
|
| 15 |
+
<div th:replace="${body}">
|
| 16 |
+
Default Body
|
| 17 |
+
</div>
|
| 18 |
+
|
| 19 |
+
</body>
|
| 20 |
+
|
| 21 |
+
</html>
|
benchmark/infrastructure/ejb-timersession/spring/test.sh
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
set -euo pipefail
|
| 3 |
+
|
| 4 |
+
BASE_URL="${BASE_URL:-http://localhost:9080}"
|
| 5 |
+
|
| 6 |
+
echo "Health check: ${BASE_URL}/"
|
| 7 |
+
HTTP_STATUS=$(curl -sL -o /dev/null -w "%{http_code}" "${BASE_URL}/")
|
| 8 |
+
|
| 9 |
+
if [ "$HTTP_STATUS" -eq 200 ]; then
|
| 10 |
+
echo "PASS - got HTTP ${HTTP_STATUS}"
|
| 11 |
+
exit 0
|
| 12 |
+
else
|
| 13 |
+
echo "FAIL - got HTTP ${HTTP_STATUS}"
|
| 14 |
+
exit 1
|
| 15 |
+
fi
|