Skip to content

Commit 59217e6

Browse files
committed
add mvnw to control the maven version
1 parent 199b85f commit 59217e6

File tree

5 files changed

+497
-0
lines changed

5 files changed

+497
-0
lines changed

.editorconfig

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
root = true
2+
3+
[*]
4+
# charset = utf-8
5+
# end_of_line = lf
6+
# indent_size = 2
7+
# indent_style = space
8+
# insert_final_newline = false
9+
# max_line_length = 180
10+
# tab_width = 2
11+
# ij_continuation_indent_size = 8
12+
# ij_formatter_off_tag = @formatter:off
13+
# ij_formatter_on_tag = @formatter:on
14+
# ij_formatter_tags_enabled = true
15+
# ij_smart_tabs = false
16+
# ij_wrap_on_typing = false
17+
18+
[{*.ant,*.fxml,*.jhm,*.jnlp,*.jrxml,*.pom,*.rng,*.tld,*.wadl,*.wsdd,*.wsdl,*.xjb,*.xml,*.xsd,*.xsl,*.xslt,*.xul}]
19+
# ij_xml_align_attributes = true
20+
# ij_xml_align_text = false
21+
# ij_xml_attribute_wrap = normal
22+
# ij_xml_block_comment_at_first_column = true
23+
# ij_xml_keep_blank_lines = 2
24+
# ij_xml_keep_indents_on_empty_lines = false
25+
# ij_xml_keep_line_breaks = true
26+
# ij_xml_keep_line_breaks_in_text = true
27+
# ij_xml_keep_whitespaces = false
28+
# ij_xml_keep_whitespaces_around_cdata = preserve
29+
# ij_xml_keep_whitespaces_inside_cdata = false
30+
# ij_xml_line_comment_at_first_column = true
31+
# ij_xml_space_after_tag_name = false
32+
# ij_xml_space_around_equals_in_attribute = false
33+
# ij_xml_space_inside_empty_tag = false
34+
# ij_xml_text_wrap = normal
35+
# ij_xml_use_custom_settings = false
36+
37+
[{*.gradle.kts,*.kt,*.kts,*.main.kts}]
38+
# indent_size = 4
39+
# tab_width = 4
40+
# ij_continuation_indent_size = 4
41+
# ij_kotlin_align_in_columns_case_branch = false
42+
# ij_kotlin_align_multiline_binary_operation = false
43+
# ij_kotlin_align_multiline_extends_list = false
44+
# ij_kotlin_align_multiline_method_parentheses = false
45+
# ij_kotlin_align_multiline_parameters = true
46+
# ij_kotlin_align_multiline_parameters_in_calls = false
47+
# ij_kotlin_allow_trailing_comma = false
48+
# ij_kotlin_allow_trailing_comma_on_call_site = false
49+
# ij_kotlin_assignment_wrap = off
50+
# ij_kotlin_blank_lines_after_class_header = 0
51+
# ij_kotlin_blank_lines_around_block_when_branches = 0
52+
# ij_kotlin_blank_lines_before_declaration_with_comment_or_annotation_on_separate_line = 1
53+
# ij_kotlin_block_comment_at_first_column = true
54+
# ij_kotlin_call_parameters_new_line_after_left_paren = false
55+
# ij_kotlin_call_parameters_right_paren_on_new_line = false
56+
# ij_kotlin_call_parameters_wrap = off
57+
# ij_kotlin_catch_on_new_line = false
58+
# ij_kotlin_class_annotation_wrap = split_into_lines
59+
# ij_kotlin_continuation_indent_for_chained_calls = true
60+
# ij_kotlin_continuation_indent_for_expression_bodies = true
61+
# ij_kotlin_continuation_indent_in_argument_lists = true
62+
# ij_kotlin_continuation_indent_in_elvis = true
63+
# ij_kotlin_continuation_indent_in_if_conditions = true
64+
# ij_kotlin_continuation_indent_in_parameter_lists = true
65+
# ij_kotlin_continuation_indent_in_supertype_lists = true
66+
# ij_kotlin_else_on_new_line = false
67+
# ij_kotlin_enum_constants_wrap = off
68+
# ij_kotlin_extends_list_wrap = off
69+
# ij_kotlin_field_annotation_wrap = split_into_lines
70+
# ij_kotlin_finally_on_new_line = false
71+
# ij_kotlin_if_rparen_on_new_line = false
72+
# ij_kotlin_import_nested_classes = false
73+
# ij_kotlin_insert_whitespaces_in_simple_one_line_method = true
74+
# ij_kotlin_keep_blank_lines_before_right_brace = 2
75+
# ij_kotlin_keep_blank_lines_in_code = 2
76+
# ij_kotlin_keep_blank_lines_in_declarations = 2
77+
# ij_kotlin_keep_first_column_comment = true
78+
# ij_kotlin_keep_indents_on_empty_lines = false
79+
# ij_kotlin_keep_line_breaks = true
80+
# ij_kotlin_lbrace_on_next_line = false
81+
# ij_kotlin_line_comment_add_space = false
82+
# ij_kotlin_line_comment_at_first_column = true
83+
# ij_kotlin_method_annotation_wrap = split_into_lines
84+
# ij_kotlin_method_call_chain_wrap = off
85+
# ij_kotlin_method_parameters_new_line_after_left_paren = false
86+
# ij_kotlin_method_parameters_right_paren_on_new_line = false
87+
# ij_kotlin_method_parameters_wrap = off
88+
# ij_kotlin_name_count_to_use_star_import = 5
89+
# ij_kotlin_name_count_to_use_star_import_for_members = 3
90+
# ij_kotlin_parameter_annotation_wrap = off
91+
# ij_kotlin_space_after_comma = true
92+
# ij_kotlin_space_after_extend_colon = true
93+
# ij_kotlin_space_after_type_colon = true
94+
# ij_kotlin_space_before_catch_parentheses = true
95+
# ij_kotlin_space_before_comma = false
96+
# ij_kotlin_space_before_extend_colon = true
97+
# ij_kotlin_space_before_for_parentheses = true
98+
# ij_kotlin_space_before_if_parentheses = true
99+
# ij_kotlin_space_before_lambda_arrow = true
100+
# ij_kotlin_space_before_type_colon = false
101+
# ij_kotlin_space_before_when_parentheses = true
102+
# ij_kotlin_space_before_while_parentheses = true
103+
# ij_kotlin_spaces_around_additive_operators = true
104+
# ij_kotlin_spaces_around_assignment_operators = true
105+
# ij_kotlin_spaces_around_equality_operators = true
106+
# ij_kotlin_spaces_around_function_type_arrow = true
107+
# ij_kotlin_spaces_around_logical_operators = true
108+
# ij_kotlin_spaces_around_multiplicative_operators = true
109+
# ij_kotlin_spaces_around_range = false
110+
# ij_kotlin_spaces_around_relational_operators = true
111+
# ij_kotlin_spaces_around_unary_operator = false
112+
# ij_kotlin_spaces_around_when_arrow = true
113+
# ij_kotlin_variable_annotation_wrap = off
114+
# ij_kotlin_while_on_new_line = false
115+
# ij_kotlin_wrap_elvis_expressions = 1
116+
# ij_kotlin_wrap_expression_body_functions = 0
117+
# ij_kotlin_wrap_first_method_in_call_chain = false

.mvn/wrapper/maven-wrapper.jar

48.4 KB
Binary file not shown.

.mvn/wrapper/maven-wrapper.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.6.2/apache-maven-3.6.2-bin.zip

mvnw

Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
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+
# 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*) darwin=true
57+
#
58+
# Look for the Apple JDKs first to preserve the existing behaviour, and then look
59+
# for the new JDKs provided by Oracle.
60+
#
61+
if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK ] ; then
62+
#
63+
# Apple JDKs
64+
#
65+
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
66+
fi
67+
68+
if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Java/JavaVirtualMachines/CurrentJDK ] ; then
69+
#
70+
# Apple JDKs
71+
#
72+
export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home
73+
fi
74+
75+
if [ -z "$JAVA_HOME" ] && [ -L "/Library/Java/JavaVirtualMachines/CurrentJDK" ] ; then
76+
#
77+
# Oracle JDKs
78+
#
79+
export JAVA_HOME=/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home
80+
fi
81+
82+
if [ -z "$JAVA_HOME" ] && [ -x "/usr/libexec/java_home" ]; then
83+
#
84+
# Apple JDKs
85+
#
86+
export JAVA_HOME=`/usr/libexec/java_home`
87+
fi
88+
;;
89+
esac
90+
91+
if [ -z "$JAVA_HOME" ] ; then
92+
if [ -r /etc/gentoo-release ] ; then
93+
JAVA_HOME=`java-config --jre-home`
94+
fi
95+
fi
96+
97+
if [ -z "$M2_HOME" ] ; then
98+
## resolve links - $0 may be a link to maven's home
99+
PRG="$0"
100+
101+
# need this for relative symlinks
102+
while [ -h "$PRG" ] ; do
103+
ls=`ls -ld "$PRG"`
104+
link=`expr "$ls" : '.*-> \(.*\)$'`
105+
if expr "$link" : '/.*' > /dev/null; then
106+
PRG="$link"
107+
else
108+
PRG="`dirname "$PRG"`/$link"
109+
fi
110+
done
111+
112+
saveddir=`pwd`
113+
114+
M2_HOME=`dirname "$PRG"`/..
115+
116+
# make it fully qualified
117+
M2_HOME=`cd "$M2_HOME" && pwd`
118+
119+
cd "$saveddir"
120+
# echo Using m2 at $M2_HOME
121+
fi
122+
123+
# For Cygwin, ensure paths are in UNIX format before anything is touched
124+
if $cygwin ; then
125+
[ -n "$M2_HOME" ] &&
126+
M2_HOME=`cygpath --unix "$M2_HOME"`
127+
[ -n "$JAVA_HOME" ] &&
128+
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
129+
[ -n "$CLASSPATH" ] &&
130+
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
131+
fi
132+
133+
# For Migwn, ensure paths are in UNIX format before anything is touched
134+
if $mingw ; then
135+
[ -n "$M2_HOME" ] &&
136+
M2_HOME="`(cd "$M2_HOME"; pwd)`"
137+
[ -n "$JAVA_HOME" ] &&
138+
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
139+
# TODO classpath?
140+
fi
141+
142+
if [ -z "$JAVA_HOME" ]; then
143+
javaExecutable="`which javac`"
144+
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
145+
# readlink(1) is not available as standard on Solaris 10.
146+
readLink=`which readlink`
147+
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
148+
if $darwin ; then
149+
javaHome="`dirname \"$javaExecutable\"`"
150+
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
151+
else
152+
javaExecutable="`readlink -f \"$javaExecutable\"`"
153+
fi
154+
javaHome="`dirname \"$javaExecutable\"`"
155+
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
156+
JAVA_HOME="$javaHome"
157+
export JAVA_HOME
158+
fi
159+
fi
160+
fi
161+
162+
if [ -z "$JAVACMD" ] ; then
163+
if [ -n "$JAVA_HOME" ] ; then
164+
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
165+
# IBM's JDK on AIX uses strange locations for the executables
166+
JAVACMD="$JAVA_HOME/jre/sh/java"
167+
else
168+
JAVACMD="$JAVA_HOME/bin/java"
169+
fi
170+
else
171+
JAVACMD="`which java`"
172+
fi
173+
fi
174+
175+
if [ ! -x "$JAVACMD" ] ; then
176+
echo "Error: JAVA_HOME is not defined correctly." >&2
177+
echo " We cannot execute $JAVACMD" >&2
178+
exit 1
179+
fi
180+
181+
if [ -z "$JAVA_HOME" ] ; then
182+
echo "Warning: JAVA_HOME environment variable is not set."
183+
fi
184+
185+
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
186+
187+
# For Cygwin, switch paths to Windows format before running java
188+
if $cygwin; then
189+
[ -n "$M2_HOME" ] &&
190+
M2_HOME=`cygpath --path --windows "$M2_HOME"`
191+
[ -n "$JAVA_HOME" ] &&
192+
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
193+
[ -n "$CLASSPATH" ] &&
194+
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
195+
fi
196+
197+
# traverses directory structure from process work directory to filesystem root
198+
# first directory with .mvn subdirectory is considered project base directory
199+
find_maven_basedir() {
200+
local basedir=$(pwd)
201+
local wdir=$(pwd)
202+
while [ "$wdir" != '/' ] ; do
203+
if [ -d "$wdir"/.mvn ] ; then
204+
basedir=$wdir
205+
break
206+
fi
207+
wdir=$(cd "$wdir/.."; pwd)
208+
done
209+
echo "${basedir}"
210+
}
211+
212+
# concatenates all lines of a file
213+
concat_lines() {
214+
if [ -f "$1" ]; then
215+
echo "$(tr -s '\n' ' ' < "$1")"
216+
fi
217+
}
218+
219+
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-$(find_maven_basedir)}
220+
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
221+
222+
# Provide a "standardized" way to retrieve the CLI args that will
223+
# work with both Windows and non-Windows executions.
224+
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
225+
export MAVEN_CMD_LINE_ARGS
226+
227+
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
228+
229+
exec "$JAVACMD" \
230+
$MAVEN_OPTS \
231+
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
232+
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
233+
${WRAPPER_LAUNCHER} $MAVEN_CMD_LINE_ARGS
234+

0 commit comments

Comments
 (0)