Skip to content

Commit 1a4c48a

Browse files
WIP
1 parent 6d2424c commit 1a4c48a

File tree

18 files changed

+899
-1
lines changed

18 files changed

+899
-1
lines changed
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-Xmx1024m -XX:CICompilerCount=1 -XX:TieredStopAtLevel=1 -Djava.security.egd=file:/dev/./urandom
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-P spring
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#
2+
# Copyright 2013-2018 the original author or authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip

context-propagation-loom/build.gradle

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
plugins {
2+
id 'idea'
3+
}
4+
5+
java {
6+
toolchain {
7+
languageVersion = JavaLanguageVersion.of(19)
8+
}
9+
}
10+
11+
tasks {
12+
compileJava {
13+
options.encoding = 'UTF-8'
14+
options.compilerArgs << '-Xlint:unchecked' << '-Xlint:deprecation'
15+
16+
sourceCompatibility = JavaVersion.VERSION_19
17+
targetCompatibility = JavaVersion.VERSION_19
18+
19+
}
20+
compileTestJava {
21+
options.encoding = 'UTF-8'
22+
options.compilerArgs << '-Xlint:unchecked' << '-Xlint:deprecation'
23+
sourceCompatibility = JavaVersion.VERSION_19
24+
targetCompatibility = JavaVersion.VERSION_19
25+
}
26+
27+
}
28+
29+
dependencies {
30+
testImplementation 'org.junit.jupiter:junit-jupiter'
31+
testImplementation 'org.assertj:assertj-core'
32+
}

context-propagation-loom/mvnw

+263
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,263 @@
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+
# https://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+
# Maven2 Start Up Batch script
23+
#
24+
# Required ENV vars:
25+
# ------------------
26+
# JAVA_HOME - location of a JDK home dir
27+
#
28+
# Optional ENV vars
29+
# -----------------
30+
# M2_HOME - location of maven2's installed home dir
31+
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
32+
# e.g. to debug Maven itself, use
33+
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
34+
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
35+
# ----------------------------------------------------------------------------
36+
37+
if [ -z "$MAVEN_SKIP_RC" ]; then
38+
39+
if [ -f /etc/mavenrc ]; then
40+
. /etc/mavenrc
41+
fi
42+
43+
if [ -f "$HOME/.mavenrc" ]; then
44+
. "$HOME/.mavenrc"
45+
fi
46+
47+
fi
48+
49+
# OS specific support. $var _must_ be set to either true or false.
50+
cygwin=false
51+
darwin=false
52+
mingw=false
53+
case "$(uname)" in
54+
CYGWIN*) cygwin=true ;;
55+
MINGW*) mingw=true ;;
56+
Darwin*)
57+
darwin=true
58+
#
59+
# Look for the Apple JDKs first to preserve the existing behaviour, and then look
60+
# for the new JDKs provided by Oracle.
61+
#
62+
if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK ]; then
63+
#
64+
# Apple JDKs
65+
#
66+
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
67+
fi
68+
69+
if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Java/JavaVirtualMachines/CurrentJDK ]; then
70+
#
71+
# Apple JDKs
72+
#
73+
export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home
74+
fi
75+
76+
if [ -z "$JAVA_HOME" ] && [ -L "/Library/Java/JavaVirtualMachines/CurrentJDK" ]; then
77+
#
78+
# Oracle JDKs
79+
#
80+
export JAVA_HOME=/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home
81+
fi
82+
83+
if [ -z "$JAVA_HOME" ] && [ -x "/usr/libexec/java_home" ]; then
84+
#
85+
# Apple JDKs
86+
#
87+
export JAVA_HOME=$(/usr/libexec/java_home)
88+
fi
89+
;;
90+
esac
91+
92+
if [ -z "$JAVA_HOME" ]; then
93+
if [ -r /etc/gentoo-release ]; then
94+
JAVA_HOME=$(java-config --jre-home)
95+
fi
96+
fi
97+
98+
if [ -z "$M2_HOME" ]; then
99+
## resolve links - $0 may be a link to maven's home
100+
PRG="$0"
101+
102+
# need this for relative symlinks
103+
while [ -h "$PRG" ]; do
104+
ls=$(ls -ld "$PRG")
105+
link=$(expr "$ls" : '.*-> \(.*\)$')
106+
if expr "$link" : '/.*' >/dev/null; then
107+
PRG="$link"
108+
else
109+
PRG="$(dirname "$PRG")/$link"
110+
fi
111+
done
112+
113+
saveddir=$(pwd)
114+
115+
M2_HOME=$(dirname "$PRG")/..
116+
117+
# make it fully qualified
118+
M2_HOME=$(cd "$M2_HOME" && pwd)
119+
120+
cd "$saveddir"
121+
# echo Using m2 at $M2_HOME
122+
fi
123+
124+
# For Cygwin, ensure paths are in UNIX format before anything is touched
125+
if $cygwin; then
126+
[ -n "$M2_HOME" ] &&
127+
M2_HOME=$(cygpath --unix "$M2_HOME")
128+
[ -n "$JAVA_HOME" ] &&
129+
JAVA_HOME=$(cygpath --unix "$JAVA_HOME")
130+
[ -n "$CLASSPATH" ] &&
131+
CLASSPATH=$(cygpath --path --unix "$CLASSPATH")
132+
fi
133+
134+
# For Migwn, ensure paths are in UNIX format before anything is touched
135+
if $mingw; then
136+
[ -n "$M2_HOME" ] &&
137+
M2_HOME="$( (
138+
cd "$M2_HOME"
139+
pwd
140+
))"
141+
[ -n "$JAVA_HOME" ] &&
142+
JAVA_HOME="$( (
143+
cd "$JAVA_HOME"
144+
pwd
145+
))"
146+
# TODO classpath?
147+
fi
148+
149+
if [ -z "$JAVA_HOME" ]; then
150+
javaExecutable="$(which javac)"
151+
if [ -n "$javaExecutable" ] && ! [ "$(expr \"$javaExecutable\" : '\([^ ]*\)')" = "no" ]; then
152+
# readlink(1) is not available as standard on Solaris 10.
153+
readLink=$(which readlink)
154+
if [ ! $(expr "$readLink" : '\([^ ]*\)') = "no" ]; then
155+
if $darwin; then
156+
javaHome="$(dirname \"$javaExecutable\")"
157+
javaExecutable="$(cd \"$javaHome\" && pwd -P)/javac"
158+
else
159+
javaExecutable="$(readlink -f \"$javaExecutable\")"
160+
fi
161+
javaHome="$(dirname \"$javaExecutable\")"
162+
javaHome=$(expr "$javaHome" : '\(.*\)/bin')
163+
JAVA_HOME="$javaHome"
164+
export JAVA_HOME
165+
fi
166+
fi
167+
fi
168+
169+
if [ -z "$JAVACMD" ]; then
170+
if [ -n "$JAVA_HOME" ]; then
171+
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
172+
# IBM's JDK on AIX uses strange locations for the executables
173+
JAVACMD="$JAVA_HOME/jre/sh/java"
174+
else
175+
JAVACMD="$JAVA_HOME/bin/java"
176+
fi
177+
else
178+
JAVACMD="$(which java)"
179+
fi
180+
fi
181+
182+
if [ ! -x "$JAVACMD" ]; then
183+
echo "Error: JAVA_HOME is not defined correctly." >&2
184+
echo " We cannot execute $JAVACMD" >&2
185+
exit 1
186+
fi
187+
188+
if [ -z "$JAVA_HOME" ]; then
189+
echo "Warning: JAVA_HOME environment variable is not set."
190+
fi
191+
192+
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
193+
194+
# For Cygwin, switch paths to Windows format before running java
195+
if $cygwin; then
196+
[ -n "$M2_HOME" ] &&
197+
M2_HOME=$(cygpath --path --windows "$M2_HOME")
198+
[ -n "$JAVA_HOME" ] &&
199+
JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME")
200+
[ -n "$CLASSPATH" ] &&
201+
CLASSPATH=$(cygpath --path --windows "$CLASSPATH")
202+
fi
203+
204+
# traverses directory structure from process work directory to filesystem root
205+
# first directory with .mvn subdirectory is considered project base directory
206+
find_maven_basedir() {
207+
local basedir=$(pwd)
208+
local wdir=$(pwd)
209+
while [ "$wdir" != '/' ]; do
210+
if [ -d "$wdir"/.mvn ]; then
211+
basedir=$wdir
212+
break
213+
fi
214+
wdir=$(
215+
cd "$wdir/.."
216+
pwd
217+
)
218+
done
219+
echo "${basedir}"
220+
}
221+
222+
# concatenates all lines of a file
223+
concat_lines() {
224+
if [ -f "$1" ]; then
225+
echo "$(tr -s '\n' ' ' <"$1")"
226+
fi
227+
}
228+
229+
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-$(find_maven_basedir)}
230+
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
231+
232+
# Provide a "standardized" way to retrieve the CLI args that will
233+
# work with both Windows and non-Windows executions.
234+
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
235+
export MAVEN_CMD_LINE_ARGS
236+
237+
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
238+
239+
echo "Running version check"
240+
VERSION=$(sed '\!<parent!,\!</parent!d' $(dirname $0)/pom.xml | grep '<version' | head -1 | sed -e 's/.*<version>//' -e 's!</version>.*$!!')
241+
echo "The found version is [${VERSION}]"
242+
243+
if echo $VERSION | egrep -q 'M|RC'; then
244+
echo Activating \"milestone\" profile for version=\"$VERSION\"
245+
echo $MAVEN_ARGS | grep -q milestone || MAVEN_ARGS="$MAVEN_ARGS -Pmilestone"
246+
else
247+
echo Deactivating \"milestone\" profile for version=\"$VERSION\"
248+
echo $MAVEN_ARGS | grep -q milestone && MAVEN_ARGS=$(echo $MAVEN_ARGS | sed -e 's/-Pmilestone//')
249+
fi
250+
251+
if echo $VERSION | egrep -q 'RELEASE'; then
252+
echo Activating \"central\" profile for version=\"$VERSION\"
253+
echo $MAVEN_ARGS | grep -q milestone || MAVEN_ARGS="$MAVEN_ARGS -Pcentral"
254+
else
255+
echo Deactivating \"central\" profile for version=\"$VERSION\"
256+
echo $MAVEN_ARGS | grep -q central && MAVEN_ARGS=$(echo $MAVEN_ARGS | sed -e 's/-Pcentral//')
257+
fi
258+
259+
exec "$JAVACMD" \
260+
$MAVEN_OPTS \
261+
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
262+
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
263+
${WRAPPER_LAUNCHER} ${MAVEN_ARGS} "$@"

0 commit comments

Comments
 (0)