@team-supercharge/oasg 18.2.2 → 18.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/oasg +5 -6
- package/package.json +1 -1
- package/targets/dotnet-webapi-system-text-json/README.md +5 -5
- package/targets/dotnet-webapi-system-text-json/templates/minimalEndpoints.mustache +1 -1
- package/targets/feign/.mvn/wrapper/maven-wrapper.jar +0 -0
- package/targets/feign/.mvn/wrapper/maven-wrapper.properties +4 -2
- package/targets/feign/generate.sh +14 -1
- package/targets/feign/generator-config.json +3 -9
- package/targets/feign/mvnw +196 -168
- package/targets/feign-kotlin/.mvn/wrapper/maven-wrapper.jar +0 -0
- package/targets/feign-kotlin/.mvn/wrapper/maven-wrapper.properties +4 -2
- package/targets/feign-kotlin/generate.sh +15 -1
- package/targets/feign-kotlin/generator-config.json +2 -7
- package/targets/feign-kotlin/mvnw +196 -168
- package/targets/feign-kotlin/templates/libraries/spring-cloud/pom-sb3.mustache +248 -0
- package/targets/plain-java/.mvn/wrapper/maven-wrapper.jar +0 -0
- package/targets/plain-java/.mvn/wrapper/maven-wrapper.properties +4 -2
- package/targets/plain-java/generate.sh +13 -1
- package/targets/plain-java/generator-config.json +3 -5
- package/targets/plain-java/mvnw +196 -168
- package/targets/spring/.mvn/wrapper/maven-wrapper.jar +0 -0
- package/targets/spring/.mvn/wrapper/maven-wrapper.properties +4 -2
- package/targets/spring/generate.sh +13 -1
- package/targets/spring/generator-config.json +2 -7
- package/targets/spring/mvnw +196 -168
- package/targets/spring-kotlin/.mvn/wrapper/maven-wrapper.jar +0 -0
- package/targets/spring-kotlin/.mvn/wrapper/maven-wrapper.properties +4 -2
- package/targets/spring-kotlin/generate.sh +13 -1
- package/targets/spring-kotlin/generator-config.json +2 -5
- package/targets/spring-kotlin/mvnw +196 -168
- package/targets/feign/.mvn/wrapper/MavenWrapperDownloader.java +0 -117
- package/targets/feign/templates/beanValidation.mustache +0 -2
- package/targets/feign/templates/formParams.mustache +0 -3
- package/targets/feign-kotlin/.mvn/wrapper/MavenWrapperDownloader.java +0 -117
- package/targets/plain-java/.mvn/wrapper/MavenWrapperDownloader.java +0 -117
- package/targets/spring/.mvn/wrapper/MavenWrapperDownloader.java +0 -117
- package/targets/spring-kotlin/.mvn/wrapper/MavenWrapperDownloader.java +0 -117
package/bin/oasg
CHANGED
|
@@ -38,9 +38,9 @@ const DEFAULT_GENERATOR_MAPPING = {
|
|
|
38
38
|
// client targets
|
|
39
39
|
"android": { version: '7.17.0', generator: 'kotlin' },
|
|
40
40
|
"angular": { version: '7.11.0', generator: 'typescript-angular' },
|
|
41
|
-
"feign": { version: '7.
|
|
42
|
-
"feign-kotlin": { version: '7.
|
|
43
|
-
"plain-java": { version: '7.
|
|
41
|
+
"feign": { version: '7.22.0', generator: 'spring' },
|
|
42
|
+
"feign-kotlin": { version: '7.22.0', generator: 'kotlin-spring' },
|
|
43
|
+
"plain-java": { version: '7.22.0', generator: 'java' },
|
|
44
44
|
"flutter": { version: '7.0.1', generator: 'dart-dio' },
|
|
45
45
|
"ios": { version: '7.0.1', generator: 'swift5' },
|
|
46
46
|
"apple-swift": { version: undefined, generator: undefined },
|
|
@@ -52,8 +52,8 @@ const DEFAULT_GENERATOR_MAPPING = {
|
|
|
52
52
|
"typescript-fetch": { version: '7.11.0', generator: 'typescript-fetch' },
|
|
53
53
|
// server targets
|
|
54
54
|
"nestjs": { version: '7.0.1', generator: 'typescript-angular' },
|
|
55
|
-
"spring": { version: '7.
|
|
56
|
-
"spring-kotlin": { version: '7.
|
|
55
|
+
"spring": { version: '7.22.0', generator: 'spring' },
|
|
56
|
+
"spring-kotlin": { version: '7.22.0', generator: 'kotlin-spring' },
|
|
57
57
|
"python-fastapi": { version: '7.8.0', generator: 'python-fastapi' },
|
|
58
58
|
"python-fastapi-raw-request": { version: '7.0.1', generator: 'python-fastapi' },
|
|
59
59
|
"dotnet": { version: '7.11.0', generator: 'csharp-functions' },
|
|
@@ -741,4 +741,3 @@ function determineArtifactVersion(argv) {
|
|
|
741
741
|
function determinePreRelease(argv) {
|
|
742
742
|
return argv.preRelease ? true : false;
|
|
743
743
|
}
|
|
744
|
-
|
package/package.json
CHANGED
|
@@ -125,15 +125,15 @@ public class PetHandlers
|
|
|
125
125
|
{
|
|
126
126
|
// Operation with a response body -> return the response model
|
|
127
127
|
public Task<Pet> Handle(AddPetRequest request)
|
|
128
|
-
=> Task.FromResult(request.
|
|
128
|
+
=> Task.FromResult(request.Pet);
|
|
129
129
|
|
|
130
130
|
public async Task<Pet> Handle(GetPetByIdRequest request)
|
|
131
|
-
=> await _repository.GetAsync(request.
|
|
132
|
-
?? throw new PetNotFoundException(request.
|
|
131
|
+
=> await _repository.GetAsync(request.PetId)
|
|
132
|
+
?? throw new PetNotFoundException(request.PetId);
|
|
133
133
|
|
|
134
134
|
// No-response-body operation -> return Task (the endpoint returns NoContent)
|
|
135
135
|
public Task Handle(DeletePetRequest request)
|
|
136
|
-
=> _repository.DeleteAsync(request.
|
|
136
|
+
=> _repository.DeleteAsync(request.PetId);
|
|
137
137
|
}
|
|
138
138
|
```
|
|
139
139
|
|
|
@@ -164,7 +164,7 @@ public class GetPetByIdHandler(IHttpContextAccessor http)
|
|
|
164
164
|
{
|
|
165
165
|
var user = http.HttpContext!.User; // authenticated principal
|
|
166
166
|
var tenant = user.FindFirst("tenant")?.Value;
|
|
167
|
-
return await _repository.GetAsync(request.
|
|
167
|
+
return await _repository.GetAsync(request.PetId, tenant);
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
```
|
|
@@ -41,7 +41,7 @@ namespace {{packageName}}
|
|
|
41
41
|
{{#operations}}
|
|
42
42
|
{{#operation}}
|
|
43
43
|
/// <summary>Wolverine request for {{classname}}.{{operationId}}, carrying every parameter.</summary>
|
|
44
|
-
public record {{operationId}}Request({{#allParams}}{{>paramType}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
|
|
44
|
+
public record {{operationId}}Request({{#allParams}}{{>paramType}} {{#lambda.pascalcase}}{{paramName}}{{/lambda.pascalcase}}{{^-last}}, {{/-last}}{{/allParams}});
|
|
45
45
|
{{/operation}}
|
|
46
46
|
{{/operations}}
|
|
47
47
|
{{/apis}}
|
|
Binary file
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
wrapperVersion=3.3.4
|
|
2
|
+
distributionType=bin
|
|
3
|
+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.16/apache-maven-3.9.16-bin.zip
|
|
4
|
+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.4/maven-wrapper-3.3.4.jar
|
|
@@ -5,13 +5,26 @@ source $(dirname "$0")/../common.sh
|
|
|
5
5
|
rm -rf out/$targetId
|
|
6
6
|
mkdir -p out/$targetId
|
|
7
7
|
|
|
8
|
+
properties=(
|
|
9
|
+
"artifactId=${artifactId}"
|
|
10
|
+
"groupId=${groupId}"
|
|
11
|
+
"artifactVersion=${version}"
|
|
12
|
+
"basePackage=${basePackage}"
|
|
13
|
+
"apiPackage=${basePackage}.api"
|
|
14
|
+
"modelPackage=${basePackage}.model"
|
|
15
|
+
"configPackage=${basePackage}.config"
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
props=$(IFS=,; echo "${properties[*]}")
|
|
19
|
+
|
|
8
20
|
java -jar $binary generate \
|
|
9
21
|
-g $generatorId \
|
|
10
22
|
-i $openApiFile \
|
|
11
23
|
-t $templateDir \
|
|
12
24
|
-o out/$targetId \
|
|
13
25
|
-c $(dirname "$0")/generator-config.json \
|
|
14
|
-
-p "
|
|
26
|
+
-p "$props" \
|
|
27
|
+
$generatorCustomArgs
|
|
15
28
|
|
|
16
29
|
cd out/$targetId
|
|
17
30
|
cp $(dirname "$0")/mvnw .
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"library": "spring-cloud",
|
|
3
|
-
"dateLibrary": "java8",
|
|
4
|
-
"java8": true,
|
|
5
3
|
"useTags": true,
|
|
6
4
|
"hideGenerationTimestamp": true,
|
|
7
5
|
"booleanGetterPrefix": "is",
|
|
8
|
-
"generateForOpenFeign": true,
|
|
9
|
-
"removeEnumValuePrefix": false,
|
|
10
6
|
"documentationProvider": "none",
|
|
11
7
|
"annotationLibrary": "none",
|
|
12
|
-
"
|
|
8
|
+
"useFeignClientContextId": false,
|
|
13
9
|
"typeMappings": {
|
|
14
|
-
"OffsetDateTime": "
|
|
15
|
-
"Date": "java.time.LocalDate"
|
|
10
|
+
"OffsetDateTime": "Instant"
|
|
16
11
|
},
|
|
17
12
|
"importMappings": {
|
|
18
|
-
"
|
|
19
|
-
"java.util.Date": "java.time.LocalDate"
|
|
13
|
+
"OffsetDateTime": "java.time.Instant"
|
|
20
14
|
},
|
|
21
15
|
"inlineSchemaOptions": {
|
|
22
16
|
"ARRAY_ITEM_SUFFIX": "",
|
package/targets/feign/mvnw
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
# "License"); you may not use this file except in compliance
|
|
9
9
|
# with the License. You may obtain a copy of the License at
|
|
10
10
|
#
|
|
11
|
-
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
12
|
#
|
|
13
13
|
# Unless required by applicable law or agreed to in writing,
|
|
14
14
|
# software distributed under the License is distributed on an
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
# ----------------------------------------------------------------------------
|
|
20
20
|
|
|
21
21
|
# ----------------------------------------------------------------------------
|
|
22
|
-
# Maven
|
|
22
|
+
# Apache Maven Wrapper startup batch script, version 3.3.4
|
|
23
23
|
#
|
|
24
24
|
# Required ENV vars:
|
|
25
25
|
# ------------------
|
|
@@ -27,284 +27,312 @@
|
|
|
27
27
|
#
|
|
28
28
|
# Optional ENV vars
|
|
29
29
|
# -----------------
|
|
30
|
-
# M2_HOME - location of maven2's installed home dir
|
|
31
30
|
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
|
32
31
|
# e.g. to debug Maven itself, use
|
|
33
32
|
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
|
34
33
|
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
|
35
34
|
# ----------------------------------------------------------------------------
|
|
36
35
|
|
|
37
|
-
if [ -z "$MAVEN_SKIP_RC" ]
|
|
36
|
+
if [ -z "$MAVEN_SKIP_RC" ]; then
|
|
38
37
|
|
|
39
|
-
if [ -f /etc/mavenrc ]
|
|
38
|
+
if [ -f /usr/local/etc/mavenrc ]; then
|
|
39
|
+
. /usr/local/etc/mavenrc
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
if [ -f /etc/mavenrc ]; then
|
|
40
43
|
. /etc/mavenrc
|
|
41
44
|
fi
|
|
42
45
|
|
|
43
|
-
if [ -f "$HOME/.mavenrc" ]
|
|
46
|
+
if [ -f "$HOME/.mavenrc" ]; then
|
|
44
47
|
. "$HOME/.mavenrc"
|
|
45
48
|
fi
|
|
46
49
|
|
|
47
50
|
fi
|
|
48
51
|
|
|
49
52
|
# OS specific support. $var _must_ be set to either true or false.
|
|
50
|
-
cygwin=false
|
|
51
|
-
darwin=false
|
|
53
|
+
cygwin=false
|
|
54
|
+
darwin=false
|
|
52
55
|
mingw=false
|
|
53
|
-
case "
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
56
|
+
case "$(uname)" in
|
|
57
|
+
CYGWIN*) cygwin=true ;;
|
|
58
|
+
MINGW*) mingw=true ;;
|
|
59
|
+
Darwin*)
|
|
60
|
+
darwin=true
|
|
61
|
+
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
|
|
62
|
+
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
|
|
63
|
+
if [ -z "$JAVA_HOME" ]; then
|
|
64
|
+
if [ -x "/usr/libexec/java_home" ]; then
|
|
65
|
+
JAVA_HOME="$(/usr/libexec/java_home)"
|
|
66
|
+
export JAVA_HOME
|
|
67
|
+
else
|
|
68
|
+
JAVA_HOME="/Library/Java/Home"
|
|
69
|
+
export JAVA_HOME
|
|
65
70
|
fi
|
|
66
|
-
|
|
71
|
+
fi
|
|
72
|
+
;;
|
|
67
73
|
esac
|
|
68
74
|
|
|
69
|
-
if [ -z "$JAVA_HOME" ]
|
|
70
|
-
if [ -r /etc/gentoo-release ]
|
|
71
|
-
JAVA_HOME
|
|
75
|
+
if [ -z "$JAVA_HOME" ]; then
|
|
76
|
+
if [ -r /etc/gentoo-release ]; then
|
|
77
|
+
JAVA_HOME=$(java-config --jre-home)
|
|
72
78
|
fi
|
|
73
79
|
fi
|
|
74
80
|
|
|
75
|
-
if [ -z "$M2_HOME" ] ; then
|
|
76
|
-
## resolve links - $0 may be a link to maven's home
|
|
77
|
-
PRG="$0"
|
|
78
|
-
|
|
79
|
-
# need this for relative symlinks
|
|
80
|
-
while [ -h "$PRG" ] ; do
|
|
81
|
-
ls=`ls -ld "$PRG"`
|
|
82
|
-
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
83
|
-
if expr "$link" : '/.*' > /dev/null; then
|
|
84
|
-
PRG="$link"
|
|
85
|
-
else
|
|
86
|
-
PRG="`dirname "$PRG"`/$link"
|
|
87
|
-
fi
|
|
88
|
-
done
|
|
89
|
-
|
|
90
|
-
saveddir=`pwd`
|
|
91
|
-
|
|
92
|
-
M2_HOME=`dirname "$PRG"`/..
|
|
93
|
-
|
|
94
|
-
# make it fully qualified
|
|
95
|
-
M2_HOME=`cd "$M2_HOME" && pwd`
|
|
96
|
-
|
|
97
|
-
cd "$saveddir"
|
|
98
|
-
# echo Using m2 at $M2_HOME
|
|
99
|
-
fi
|
|
100
|
-
|
|
101
81
|
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
|
102
|
-
if $cygwin
|
|
103
|
-
[ -n "$
|
|
104
|
-
|
|
105
|
-
[ -n "$
|
|
106
|
-
|
|
107
|
-
[ -n "$CLASSPATH" ] &&
|
|
108
|
-
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
|
|
82
|
+
if $cygwin; then
|
|
83
|
+
[ -n "$JAVA_HOME" ] \
|
|
84
|
+
&& JAVA_HOME=$(cygpath --unix "$JAVA_HOME")
|
|
85
|
+
[ -n "$CLASSPATH" ] \
|
|
86
|
+
&& CLASSPATH=$(cygpath --path --unix "$CLASSPATH")
|
|
109
87
|
fi
|
|
110
88
|
|
|
111
89
|
# For Mingw, ensure paths are in UNIX format before anything is touched
|
|
112
|
-
if $mingw
|
|
113
|
-
[ -n "$
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
90
|
+
if $mingw; then
|
|
91
|
+
[ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] \
|
|
92
|
+
&& JAVA_HOME="$(
|
|
93
|
+
cd "$JAVA_HOME" || (
|
|
94
|
+
echo "cannot cd into $JAVA_HOME." >&2
|
|
95
|
+
exit 1
|
|
96
|
+
)
|
|
97
|
+
pwd
|
|
98
|
+
)"
|
|
117
99
|
fi
|
|
118
100
|
|
|
119
101
|
if [ -z "$JAVA_HOME" ]; then
|
|
120
|
-
javaExecutable="
|
|
121
|
-
if [ -n "$javaExecutable" ] && ! [ "
|
|
102
|
+
javaExecutable="$(which javac)"
|
|
103
|
+
if [ -n "$javaExecutable" ] && ! [ "$(expr "$javaExecutable" : '\([^ ]*\)')" = "no" ]; then
|
|
122
104
|
# readlink(1) is not available as standard on Solaris 10.
|
|
123
|
-
readLink
|
|
124
|
-
if [ !
|
|
125
|
-
if $darwin
|
|
126
|
-
javaHome="
|
|
127
|
-
javaExecutable="
|
|
105
|
+
readLink=$(which readlink)
|
|
106
|
+
if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then
|
|
107
|
+
if $darwin; then
|
|
108
|
+
javaHome="$(dirname "$javaExecutable")"
|
|
109
|
+
javaExecutable="$(cd "$javaHome" && pwd -P)/javac"
|
|
128
110
|
else
|
|
129
|
-
javaExecutable="
|
|
111
|
+
javaExecutable="$(readlink -f "$javaExecutable")"
|
|
130
112
|
fi
|
|
131
|
-
javaHome="
|
|
132
|
-
javaHome
|
|
113
|
+
javaHome="$(dirname "$javaExecutable")"
|
|
114
|
+
javaHome=$(expr "$javaHome" : '\(.*\)/bin')
|
|
133
115
|
JAVA_HOME="$javaHome"
|
|
134
116
|
export JAVA_HOME
|
|
135
117
|
fi
|
|
136
118
|
fi
|
|
137
119
|
fi
|
|
138
120
|
|
|
139
|
-
if [ -z "$JAVACMD" ]
|
|
140
|
-
if [ -n "$JAVA_HOME"
|
|
141
|
-
if [ -x "$JAVA_HOME/jre/sh/java" ]
|
|
121
|
+
if [ -z "$JAVACMD" ]; then
|
|
122
|
+
if [ -n "$JAVA_HOME" ]; then
|
|
123
|
+
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
|
|
142
124
|
# IBM's JDK on AIX uses strange locations for the executables
|
|
143
125
|
JAVACMD="$JAVA_HOME/jre/sh/java"
|
|
144
126
|
else
|
|
145
127
|
JAVACMD="$JAVA_HOME/bin/java"
|
|
146
128
|
fi
|
|
147
129
|
else
|
|
148
|
-
JAVACMD="
|
|
130
|
+
JAVACMD="$(
|
|
131
|
+
\unset -f command 2>/dev/null
|
|
132
|
+
\command -v java
|
|
133
|
+
)"
|
|
149
134
|
fi
|
|
150
135
|
fi
|
|
151
136
|
|
|
152
|
-
if [ ! -x "$JAVACMD" ]
|
|
137
|
+
if [ ! -x "$JAVACMD" ]; then
|
|
153
138
|
echo "Error: JAVA_HOME is not defined correctly." >&2
|
|
154
139
|
echo " We cannot execute $JAVACMD" >&2
|
|
155
140
|
exit 1
|
|
156
141
|
fi
|
|
157
142
|
|
|
158
|
-
if [ -z "$JAVA_HOME" ]
|
|
159
|
-
echo "Warning: JAVA_HOME environment variable is not set."
|
|
143
|
+
if [ -z "$JAVA_HOME" ]; then
|
|
144
|
+
echo "Warning: JAVA_HOME environment variable is not set." >&2
|
|
160
145
|
fi
|
|
161
146
|
|
|
162
|
-
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
|
|
163
|
-
|
|
164
147
|
# traverses directory structure from process work directory to filesystem root
|
|
165
148
|
# first directory with .mvn subdirectory is considered project base directory
|
|
166
149
|
find_maven_basedir() {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
then
|
|
170
|
-
echo "Path not specified to find_maven_basedir"
|
|
150
|
+
if [ -z "$1" ]; then
|
|
151
|
+
echo "Path not specified to find_maven_basedir" >&2
|
|
171
152
|
return 1
|
|
172
153
|
fi
|
|
173
154
|
|
|
174
155
|
basedir="$1"
|
|
175
156
|
wdir="$1"
|
|
176
|
-
while [ "$wdir" != '/' ]
|
|
177
|
-
if [ -d "$wdir"/.mvn ]
|
|
157
|
+
while [ "$wdir" != '/' ]; do
|
|
158
|
+
if [ -d "$wdir"/.mvn ]; then
|
|
178
159
|
basedir=$wdir
|
|
179
160
|
break
|
|
180
161
|
fi
|
|
181
162
|
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
|
|
182
163
|
if [ -d "${wdir}" ]; then
|
|
183
|
-
wdir
|
|
164
|
+
wdir=$(
|
|
165
|
+
cd "$wdir/.." || exit 1
|
|
166
|
+
pwd
|
|
167
|
+
)
|
|
184
168
|
fi
|
|
185
169
|
# end of workaround
|
|
186
170
|
done
|
|
187
|
-
|
|
171
|
+
printf '%s' "$(
|
|
172
|
+
cd "$basedir" || exit 1
|
|
173
|
+
pwd
|
|
174
|
+
)"
|
|
188
175
|
}
|
|
189
176
|
|
|
190
177
|
# concatenates all lines of a file
|
|
191
178
|
concat_lines() {
|
|
192
179
|
if [ -f "$1" ]; then
|
|
193
|
-
|
|
180
|
+
# Remove \r in case we run on Windows within Git Bash
|
|
181
|
+
# and check out the repository with auto CRLF management
|
|
182
|
+
# enabled. Otherwise, we may read lines that are delimited with
|
|
183
|
+
# \r\n and produce $'-Xarg\r' rather than -Xarg due to word
|
|
184
|
+
# splitting rules.
|
|
185
|
+
tr -s '\r\n' ' ' <"$1"
|
|
194
186
|
fi
|
|
195
187
|
}
|
|
196
188
|
|
|
197
|
-
|
|
189
|
+
log() {
|
|
190
|
+
if [ "$MVNW_VERBOSE" = true ]; then
|
|
191
|
+
printf '%s\n' "$1"
|
|
192
|
+
fi
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
BASE_DIR=$(find_maven_basedir "$(dirname "$0")")
|
|
198
196
|
if [ -z "$BASE_DIR" ]; then
|
|
199
|
-
exit 1
|
|
197
|
+
exit 1
|
|
200
198
|
fi
|
|
201
199
|
|
|
200
|
+
MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
|
|
201
|
+
export MAVEN_PROJECTBASEDIR
|
|
202
|
+
log "$MAVEN_PROJECTBASEDIR"
|
|
203
|
+
|
|
204
|
+
trim() {
|
|
205
|
+
# MWRAPPER-139:
|
|
206
|
+
# Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
|
|
207
|
+
# Needed for removing poorly interpreted newline sequences when running in more
|
|
208
|
+
# exotic environments such as mingw bash on Windows.
|
|
209
|
+
printf "%s" "${1}" | tr -d '[:space:]'
|
|
210
|
+
}
|
|
211
|
+
|
|
202
212
|
##########################################################################################
|
|
203
213
|
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
|
204
214
|
# This allows using the maven wrapper in projects that prohibit checking in binary data.
|
|
205
215
|
##########################################################################################
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
fi
|
|
216
|
+
wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar"
|
|
217
|
+
if [ -r "$wrapperJarPath" ]; then
|
|
218
|
+
log "Found $wrapperJarPath"
|
|
210
219
|
else
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
220
|
+
log "Couldn't find $wrapperJarPath, downloading it ..."
|
|
221
|
+
|
|
222
|
+
if [ -n "$MVNW_REPOURL" ]; then
|
|
223
|
+
wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.3.4/maven-wrapper-3.3.4.jar"
|
|
224
|
+
else
|
|
225
|
+
wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.4/maven-wrapper-3.3.4.jar"
|
|
226
|
+
fi
|
|
227
|
+
while IFS="=" read -r key value; do
|
|
228
|
+
case "$key" in wrapperUrl)
|
|
229
|
+
wrapperUrl=$(trim "${value-}")
|
|
230
|
+
break
|
|
231
|
+
;;
|
|
232
|
+
esac
|
|
233
|
+
done <"$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
|
|
234
|
+
log "Downloading from: $wrapperUrl"
|
|
235
|
+
|
|
236
|
+
if $cygwin; then
|
|
237
|
+
wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath")
|
|
238
|
+
fi
|
|
239
|
+
|
|
240
|
+
if command -v wget >/dev/null; then
|
|
241
|
+
log "Found wget ... using wget"
|
|
242
|
+
[ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet"
|
|
243
|
+
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
|
244
|
+
wget ${QUIET:+"$QUIET"} "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
|
|
216
245
|
else
|
|
217
|
-
|
|
246
|
+
wget ${QUIET:+"$QUIET"} --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
|
|
218
247
|
fi
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
248
|
+
elif command -v curl >/dev/null; then
|
|
249
|
+
log "Found curl ... using curl"
|
|
250
|
+
[ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent"
|
|
251
|
+
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
|
252
|
+
curl ${QUIET:+"$QUIET"} -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
|
|
253
|
+
else
|
|
254
|
+
curl ${QUIET:+"$QUIET"} --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
|
|
225
255
|
fi
|
|
226
|
-
|
|
256
|
+
else
|
|
257
|
+
log "Falling back to using Java to download"
|
|
258
|
+
javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java"
|
|
259
|
+
javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class"
|
|
260
|
+
# For Cygwin, switch paths to Windows format before running javac
|
|
227
261
|
if $cygwin; then
|
|
228
|
-
|
|
262
|
+
javaSource=$(cygpath --path --windows "$javaSource")
|
|
263
|
+
javaClass=$(cygpath --path --windows "$javaClass")
|
|
229
264
|
fi
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
fi
|
|
240
|
-
elif command -v curl > /dev/null; then
|
|
241
|
-
if [ "$MVNW_VERBOSE" = true ]; then
|
|
242
|
-
echo "Found curl ... using curl"
|
|
243
|
-
fi
|
|
244
|
-
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
|
245
|
-
curl -o "$wrapperJarPath" "$jarUrl" -f
|
|
246
|
-
else
|
|
247
|
-
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
|
|
248
|
-
fi
|
|
249
|
-
|
|
250
|
-
else
|
|
251
|
-
if [ "$MVNW_VERBOSE" = true ]; then
|
|
252
|
-
echo "Falling back to using Java to download"
|
|
253
|
-
fi
|
|
254
|
-
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
|
|
255
|
-
# For Cygwin, switch paths to Windows format before running javac
|
|
256
|
-
if $cygwin; then
|
|
257
|
-
javaClass=`cygpath --path --windows "$javaClass"`
|
|
258
|
-
fi
|
|
259
|
-
if [ -e "$javaClass" ]; then
|
|
260
|
-
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
|
261
|
-
if [ "$MVNW_VERBOSE" = true ]; then
|
|
262
|
-
echo " - Compiling MavenWrapperDownloader.java ..."
|
|
263
|
-
fi
|
|
264
|
-
# Compiling the Java class
|
|
265
|
-
("$JAVA_HOME/bin/javac" "$javaClass")
|
|
266
|
-
fi
|
|
267
|
-
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
|
268
|
-
# Running the downloader
|
|
269
|
-
if [ "$MVNW_VERBOSE" = true ]; then
|
|
270
|
-
echo " - Running MavenWrapperDownloader.java ..."
|
|
271
|
-
fi
|
|
272
|
-
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
|
|
273
|
-
fi
|
|
274
|
-
fi
|
|
265
|
+
if [ -e "$javaSource" ]; then
|
|
266
|
+
if [ ! -e "$javaClass" ]; then
|
|
267
|
+
log " - Compiling MavenWrapperDownloader.java ..."
|
|
268
|
+
("$JAVA_HOME/bin/javac" "$javaSource")
|
|
269
|
+
fi
|
|
270
|
+
if [ -e "$javaClass" ]; then
|
|
271
|
+
log " - Running MavenWrapperDownloader.java ..."
|
|
272
|
+
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath"
|
|
273
|
+
fi
|
|
275
274
|
fi
|
|
275
|
+
fi
|
|
276
276
|
fi
|
|
277
277
|
##########################################################################################
|
|
278
278
|
# End of extension
|
|
279
279
|
##########################################################################################
|
|
280
280
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
281
|
+
# If specified, validate the SHA-256 sum of the Maven wrapper jar file
|
|
282
|
+
wrapperSha256Sum=""
|
|
283
|
+
while IFS="=" read -r key value; do
|
|
284
|
+
case "$key" in wrapperSha256Sum)
|
|
285
|
+
wrapperSha256Sum=$(trim "${value-}")
|
|
286
|
+
break
|
|
287
|
+
;;
|
|
288
|
+
esac
|
|
289
|
+
done <"$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
|
|
290
|
+
if [ -n "$wrapperSha256Sum" ]; then
|
|
291
|
+
wrapperSha256Result=false
|
|
292
|
+
if command -v sha256sum >/dev/null; then
|
|
293
|
+
if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c - >/dev/null 2>&1; then
|
|
294
|
+
wrapperSha256Result=true
|
|
295
|
+
fi
|
|
296
|
+
elif command -v shasum >/dev/null; then
|
|
297
|
+
if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c >/dev/null 2>&1; then
|
|
298
|
+
wrapperSha256Result=true
|
|
299
|
+
fi
|
|
300
|
+
else
|
|
301
|
+
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
|
|
302
|
+
echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties." >&2
|
|
303
|
+
exit 1
|
|
304
|
+
fi
|
|
305
|
+
if [ $wrapperSha256Result = false ]; then
|
|
306
|
+
echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2
|
|
307
|
+
echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2
|
|
308
|
+
echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2
|
|
309
|
+
exit 1
|
|
310
|
+
fi
|
|
284
311
|
fi
|
|
312
|
+
|
|
285
313
|
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
|
286
314
|
|
|
287
315
|
# For Cygwin, switch paths to Windows format before running java
|
|
288
316
|
if $cygwin; then
|
|
289
|
-
[ -n "$
|
|
290
|
-
|
|
291
|
-
[ -n "$
|
|
292
|
-
|
|
293
|
-
[ -n "$
|
|
294
|
-
|
|
295
|
-
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
|
|
296
|
-
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
|
|
317
|
+
[ -n "$JAVA_HOME" ] \
|
|
318
|
+
&& JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME")
|
|
319
|
+
[ -n "$CLASSPATH" ] \
|
|
320
|
+
&& CLASSPATH=$(cygpath --path --windows "$CLASSPATH")
|
|
321
|
+
[ -n "$MAVEN_PROJECTBASEDIR" ] \
|
|
322
|
+
&& MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR")
|
|
297
323
|
fi
|
|
298
324
|
|
|
299
325
|
# Provide a "standardized" way to retrieve the CLI args that will
|
|
300
326
|
# work with both Windows and non-Windows executions.
|
|
301
|
-
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG
|
|
327
|
+
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*"
|
|
302
328
|
export MAVEN_CMD_LINE_ARGS
|
|
303
329
|
|
|
304
330
|
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
|
305
331
|
|
|
332
|
+
# shellcheck disable=SC2086 # safe args
|
|
306
333
|
exec "$JAVACMD" \
|
|
307
334
|
$MAVEN_OPTS \
|
|
335
|
+
$MAVEN_DEBUG_OPTS \
|
|
308
336
|
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
|
309
|
-
"-Dmaven.
|
|
337
|
+
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
|
310
338
|
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
|
|
Binary file
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
wrapperVersion=3.3.4
|
|
2
|
+
distributionType=bin
|
|
3
|
+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.16/apache-maven-3.9.16-bin.zip
|
|
4
|
+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.4/maven-wrapper-3.3.4.jar
|