ebuy创建
This commit is contained in:
commit
096d859695
31
.gitignore
vendored
Normal file
31
.gitignore
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
HELP.md
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**
|
||||||
|
!**/src/test/**
|
||||||
|
|
||||||
|
### STS ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
118
.mvn/wrapper/MavenWrapperDownloader.java
vendored
Normal file
118
.mvn/wrapper/MavenWrapperDownloader.java
vendored
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2012-2019 the original author or authors.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.net.*;
|
||||||
|
import java.io.*;
|
||||||
|
import java.nio.channels.*;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
public class MavenWrapperDownloader {
|
||||||
|
|
||||||
|
private static final String WRAPPER_VERSION = "0.5.5";
|
||||||
|
/**
|
||||||
|
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
|
||||||
|
*/
|
||||||
|
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
|
||||||
|
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
|
||||||
|
* use instead of the default one.
|
||||||
|
*/
|
||||||
|
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
|
||||||
|
".mvn/wrapper/maven-wrapper.properties";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path where the maven-wrapper.jar will be saved to.
|
||||||
|
*/
|
||||||
|
private static final String MAVEN_WRAPPER_JAR_PATH =
|
||||||
|
".mvn/wrapper/maven-wrapper.jar";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Name of the property which should be used to override the default download url for the wrapper.
|
||||||
|
*/
|
||||||
|
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
|
||||||
|
|
||||||
|
public static void main(String args[]) {
|
||||||
|
System.out.println("- Downloader started");
|
||||||
|
File baseDirectory = new File(args[0]);
|
||||||
|
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
|
||||||
|
|
||||||
|
// If the maven-wrapper.properties exists, read it and check if it contains a custom
|
||||||
|
// wrapperUrl parameter.
|
||||||
|
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
|
||||||
|
String url = DEFAULT_DOWNLOAD_URL;
|
||||||
|
if (mavenWrapperPropertyFile.exists()) {
|
||||||
|
FileInputStream mavenWrapperPropertyFileInputStream = null;
|
||||||
|
try {
|
||||||
|
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
|
||||||
|
Properties mavenWrapperProperties = new Properties();
|
||||||
|
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
|
||||||
|
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
|
||||||
|
} catch (IOException e) {
|
||||||
|
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if (mavenWrapperPropertyFileInputStream != null) {
|
||||||
|
mavenWrapperPropertyFileInputStream.close();
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
// Ignore ...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("- Downloading from: " + url);
|
||||||
|
|
||||||
|
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
|
||||||
|
if (!outputFile.getParentFile().exists()) {
|
||||||
|
if (!outputFile.getParentFile().mkdirs()) {
|
||||||
|
System.out.println(
|
||||||
|
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
|
||||||
|
try {
|
||||||
|
downloadFileFromURL(url, outputFile);
|
||||||
|
System.out.println("Done");
|
||||||
|
System.exit(0);
|
||||||
|
} catch (Throwable e) {
|
||||||
|
System.out.println("- Error downloading");
|
||||||
|
e.printStackTrace();
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
|
||||||
|
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
|
||||||
|
String username = System.getenv("MVNW_USERNAME");
|
||||||
|
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
|
||||||
|
Authenticator.setDefault(new Authenticator() {
|
||||||
|
@Override
|
||||||
|
protected PasswordAuthentication getPasswordAuthentication() {
|
||||||
|
return new PasswordAuthentication(username, password);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
URL website = new URL(urlString);
|
||||||
|
ReadableByteChannel rbc;
|
||||||
|
rbc = Channels.newChannel(website.openStream());
|
||||||
|
FileOutputStream fos = new FileOutputStream(destination);
|
||||||
|
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
|
||||||
|
fos.close();
|
||||||
|
rbc.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
BIN
.mvn/wrapper/maven-wrapper.jar
vendored
Normal file
BIN
.mvn/wrapper/maven-wrapper.jar
vendored
Normal file
Binary file not shown.
2
.mvn/wrapper/maven-wrapper.properties
vendored
Normal file
2
.mvn/wrapper/maven-wrapper.properties
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.2/apache-maven-3.6.2-bin.zip
|
||||||
|
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar
|
310
mvnw
vendored
Normal file
310
mvnw
vendored
Normal file
@ -0,0 +1,310 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
# or more contributor license agreements. See the NOTICE file
|
||||||
|
# distributed with this work for additional information
|
||||||
|
# regarding copyright ownership. The ASF licenses this file
|
||||||
|
# to you under the Apache License, Version 2.0 (the
|
||||||
|
# "License"); you may not use this file except in compliance
|
||||||
|
# with the License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing,
|
||||||
|
# software distributed under the License is distributed on an
|
||||||
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
# KIND, either express or implied. See the License for the
|
||||||
|
# specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# Maven2 Start Up Batch script
|
||||||
|
#
|
||||||
|
# Required ENV vars:
|
||||||
|
# ------------------
|
||||||
|
# JAVA_HOME - location of a JDK home dir
|
||||||
|
#
|
||||||
|
# Optional ENV vars
|
||||||
|
# -----------------
|
||||||
|
# M2_HOME - location of maven2's installed home dir
|
||||||
|
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||||
|
# e.g. to debug Maven itself, use
|
||||||
|
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||||
|
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if [ -z "$MAVEN_SKIP_RC" ] ; then
|
||||||
|
|
||||||
|
if [ -f /etc/mavenrc ] ; then
|
||||||
|
. /etc/mavenrc
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "$HOME/.mavenrc" ] ; then
|
||||||
|
. "$HOME/.mavenrc"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
# OS specific support. $var _must_ be set to either true or false.
|
||||||
|
cygwin=false;
|
||||||
|
darwin=false;
|
||||||
|
mingw=false
|
||||||
|
case "`uname`" in
|
||||||
|
CYGWIN*) cygwin=true ;;
|
||||||
|
MINGW*) mingw=true;;
|
||||||
|
Darwin*) darwin=true
|
||||||
|
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
|
||||||
|
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
|
||||||
|
if [ -z "$JAVA_HOME" ]; then
|
||||||
|
if [ -x "/usr/libexec/java_home" ]; then
|
||||||
|
export JAVA_HOME="`/usr/libexec/java_home`"
|
||||||
|
else
|
||||||
|
export JAVA_HOME="/Library/Java/Home"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -z "$JAVA_HOME" ] ; then
|
||||||
|
if [ -r /etc/gentoo-release ] ; then
|
||||||
|
JAVA_HOME=`java-config --jre-home`
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$M2_HOME" ] ; then
|
||||||
|
## resolve links - $0 may be a link to maven's home
|
||||||
|
PRG="$0"
|
||||||
|
|
||||||
|
# need this for relative symlinks
|
||||||
|
while [ -h "$PRG" ] ; do
|
||||||
|
ls=`ls -ld "$PRG"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
PRG="$link"
|
||||||
|
else
|
||||||
|
PRG="`dirname "$PRG"`/$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
saveddir=`pwd`
|
||||||
|
|
||||||
|
M2_HOME=`dirname "$PRG"`/..
|
||||||
|
|
||||||
|
# make it fully qualified
|
||||||
|
M2_HOME=`cd "$M2_HOME" && pwd`
|
||||||
|
|
||||||
|
cd "$saveddir"
|
||||||
|
# echo Using m2 at $M2_HOME
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||||
|
if $cygwin ; then
|
||||||
|
[ -n "$M2_HOME" ] &&
|
||||||
|
M2_HOME=`cygpath --unix "$M2_HOME"`
|
||||||
|
[ -n "$JAVA_HOME" ] &&
|
||||||
|
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||||
|
[ -n "$CLASSPATH" ] &&
|
||||||
|
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Mingw, ensure paths are in UNIX format before anything is touched
|
||||||
|
if $mingw ; then
|
||||||
|
[ -n "$M2_HOME" ] &&
|
||||||
|
M2_HOME="`(cd "$M2_HOME"; pwd)`"
|
||||||
|
[ -n "$JAVA_HOME" ] &&
|
||||||
|
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$JAVA_HOME" ]; then
|
||||||
|
javaExecutable="`which javac`"
|
||||||
|
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
|
||||||
|
# readlink(1) is not available as standard on Solaris 10.
|
||||||
|
readLink=`which readlink`
|
||||||
|
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
|
||||||
|
if $darwin ; then
|
||||||
|
javaHome="`dirname \"$javaExecutable\"`"
|
||||||
|
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
|
||||||
|
else
|
||||||
|
javaExecutable="`readlink -f \"$javaExecutable\"`"
|
||||||
|
fi
|
||||||
|
javaHome="`dirname \"$javaExecutable\"`"
|
||||||
|
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
|
||||||
|
JAVA_HOME="$javaHome"
|
||||||
|
export JAVA_HOME
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$JAVACMD" ] ; then
|
||||||
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||||
|
else
|
||||||
|
JAVACMD="$JAVA_HOME/bin/java"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD="`which java`"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
echo "Error: JAVA_HOME is not defined correctly." >&2
|
||||||
|
echo " We cannot execute $JAVACMD" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$JAVA_HOME" ] ; then
|
||||||
|
echo "Warning: JAVA_HOME environment variable is not set."
|
||||||
|
fi
|
||||||
|
|
||||||
|
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
|
||||||
|
|
||||||
|
# traverses directory structure from process work directory to filesystem root
|
||||||
|
# first directory with .mvn subdirectory is considered project base directory
|
||||||
|
find_maven_basedir() {
|
||||||
|
|
||||||
|
if [ -z "$1" ]
|
||||||
|
then
|
||||||
|
echo "Path not specified to find_maven_basedir"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
basedir="$1"
|
||||||
|
wdir="$1"
|
||||||
|
while [ "$wdir" != '/' ] ; do
|
||||||
|
if [ -d "$wdir"/.mvn ] ; then
|
||||||
|
basedir=$wdir
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
|
||||||
|
if [ -d "${wdir}" ]; then
|
||||||
|
wdir=`cd "$wdir/.."; pwd`
|
||||||
|
fi
|
||||||
|
# end of workaround
|
||||||
|
done
|
||||||
|
echo "${basedir}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# concatenates all lines of a file
|
||||||
|
concat_lines() {
|
||||||
|
if [ -f "$1" ]; then
|
||||||
|
echo "$(tr -s '\n' ' ' < "$1")"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
BASE_DIR=`find_maven_basedir "$(pwd)"`
|
||||||
|
if [ -z "$BASE_DIR" ]; then
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
##########################################################################################
|
||||||
|
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||||
|
# This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||||
|
##########################################################################################
|
||||||
|
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Found .mvn/wrapper/maven-wrapper.jar"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
|
||||||
|
fi
|
||||||
|
if [ -n "$MVNW_REPOURL" ]; then
|
||||||
|
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
|
||||||
|
else
|
||||||
|
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
|
||||||
|
fi
|
||||||
|
while IFS="=" read key value; do
|
||||||
|
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
|
||||||
|
esac
|
||||||
|
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Downloading from: $jarUrl"
|
||||||
|
fi
|
||||||
|
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
|
||||||
|
if $cygwin; then
|
||||||
|
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v wget > /dev/null; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Found wget ... using wget"
|
||||||
|
fi
|
||||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||||
|
wget "$jarUrl" -O "$wrapperJarPath"
|
||||||
|
else
|
||||||
|
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
|
||||||
|
fi
|
||||||
|
elif command -v curl > /dev/null; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Found curl ... using curl"
|
||||||
|
fi
|
||||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||||
|
curl -o "$wrapperJarPath" "$jarUrl" -f
|
||||||
|
else
|
||||||
|
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Falling back to using Java to download"
|
||||||
|
fi
|
||||||
|
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
|
||||||
|
# For Cygwin, switch paths to Windows format before running javac
|
||||||
|
if $cygwin; then
|
||||||
|
javaClass=`cygpath --path --windows "$javaClass"`
|
||||||
|
fi
|
||||||
|
if [ -e "$javaClass" ]; then
|
||||||
|
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo " - Compiling MavenWrapperDownloader.java ..."
|
||||||
|
fi
|
||||||
|
# Compiling the Java class
|
||||||
|
("$JAVA_HOME/bin/javac" "$javaClass")
|
||||||
|
fi
|
||||||
|
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||||
|
# Running the downloader
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo " - Running MavenWrapperDownloader.java ..."
|
||||||
|
fi
|
||||||
|
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
##########################################################################################
|
||||||
|
# End of extension
|
||||||
|
##########################################################################################
|
||||||
|
|
||||||
|
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo $MAVEN_PROJECTBASEDIR
|
||||||
|
fi
|
||||||
|
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
||||||
|
|
||||||
|
# For Cygwin, switch paths to Windows format before running java
|
||||||
|
if $cygwin; then
|
||||||
|
[ -n "$M2_HOME" ] &&
|
||||||
|
M2_HOME=`cygpath --path --windows "$M2_HOME"`
|
||||||
|
[ -n "$JAVA_HOME" ] &&
|
||||||
|
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
|
||||||
|
[ -n "$CLASSPATH" ] &&
|
||||||
|
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
|
||||||
|
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
|
||||||
|
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Provide a "standardized" way to retrieve the CLI args that will
|
||||||
|
# work with both Windows and non-Windows executions.
|
||||||
|
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
|
||||||
|
export MAVEN_CMD_LINE_ARGS
|
||||||
|
|
||||||
|
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||||
|
|
||||||
|
exec "$JAVACMD" \
|
||||||
|
$MAVEN_OPTS \
|
||||||
|
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
||||||
|
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
||||||
|
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
|
182
mvnw.cmd
vendored
Normal file
182
mvnw.cmd
vendored
Normal file
@ -0,0 +1,182 @@
|
|||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
@REM Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
@REM or more contributor license agreements. See the NOTICE file
|
||||||
|
@REM distributed with this work for additional information
|
||||||
|
@REM regarding copyright ownership. The ASF licenses this file
|
||||||
|
@REM to you under the Apache License, Version 2.0 (the
|
||||||
|
@REM "License"); you may not use this file except in compliance
|
||||||
|
@REM with the License. You may obtain a copy of the License at
|
||||||
|
@REM
|
||||||
|
@REM https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
@REM
|
||||||
|
@REM Unless required by applicable law or agreed to in writing,
|
||||||
|
@REM software distributed under the License is distributed on an
|
||||||
|
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
@REM KIND, either express or implied. See the License for the
|
||||||
|
@REM specific language governing permissions and limitations
|
||||||
|
@REM under the License.
|
||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
@REM Maven2 Start Up Batch script
|
||||||
|
@REM
|
||||||
|
@REM Required ENV vars:
|
||||||
|
@REM JAVA_HOME - location of a JDK home dir
|
||||||
|
@REM
|
||||||
|
@REM Optional ENV vars
|
||||||
|
@REM M2_HOME - location of maven2's installed home dir
|
||||||
|
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
||||||
|
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
|
||||||
|
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||||
|
@REM e.g. to debug Maven itself, use
|
||||||
|
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||||
|
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
||||||
|
@echo off
|
||||||
|
@REM set title of command window
|
||||||
|
title %0
|
||||||
|
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
|
||||||
|
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
||||||
|
|
||||||
|
@REM set %HOME% to equivalent of $HOME
|
||||||
|
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
||||||
|
|
||||||
|
@REM Execute a user defined script before this one
|
||||||
|
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
||||||
|
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
||||||
|
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
|
||||||
|
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
|
||||||
|
:skipRcPre
|
||||||
|
|
||||||
|
@setlocal
|
||||||
|
|
||||||
|
set ERROR_CODE=0
|
||||||
|
|
||||||
|
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
||||||
|
@setlocal
|
||||||
|
|
||||||
|
@REM ==== START VALIDATION ====
|
||||||
|
if not "%JAVA_HOME%" == "" goto OkJHome
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Error: JAVA_HOME not found in your environment. >&2
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||||
|
echo location of your Java installation. >&2
|
||||||
|
echo.
|
||||||
|
goto error
|
||||||
|
|
||||||
|
:OkJHome
|
||||||
|
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
||||||
|
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||||
|
echo location of your Java installation. >&2
|
||||||
|
echo.
|
||||||
|
goto error
|
||||||
|
|
||||||
|
@REM ==== END VALIDATION ====
|
||||||
|
|
||||||
|
:init
|
||||||
|
|
||||||
|
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
||||||
|
@REM Fallback to current working directory if not found.
|
||||||
|
|
||||||
|
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
||||||
|
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
||||||
|
|
||||||
|
set EXEC_DIR=%CD%
|
||||||
|
set WDIR=%EXEC_DIR%
|
||||||
|
:findBaseDir
|
||||||
|
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
||||||
|
cd ..
|
||||||
|
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
||||||
|
set WDIR=%CD%
|
||||||
|
goto findBaseDir
|
||||||
|
|
||||||
|
:baseDirFound
|
||||||
|
set MAVEN_PROJECTBASEDIR=%WDIR%
|
||||||
|
cd "%EXEC_DIR%"
|
||||||
|
goto endDetectBaseDir
|
||||||
|
|
||||||
|
:baseDirNotFound
|
||||||
|
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
||||||
|
cd "%EXEC_DIR%"
|
||||||
|
|
||||||
|
:endDetectBaseDir
|
||||||
|
|
||||||
|
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
||||||
|
|
||||||
|
@setlocal EnableExtensions EnableDelayedExpansion
|
||||||
|
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
||||||
|
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
||||||
|
|
||||||
|
:endReadAdditionalConfig
|
||||||
|
|
||||||
|
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
||||||
|
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
|
||||||
|
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||||
|
|
||||||
|
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
|
||||||
|
|
||||||
|
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
|
||||||
|
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
|
||||||
|
)
|
||||||
|
|
||||||
|
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||||
|
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||||
|
if exist %WRAPPER_JAR% (
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Found %WRAPPER_JAR%
|
||||||
|
)
|
||||||
|
) else (
|
||||||
|
if not "%MVNW_REPOURL%" == "" (
|
||||||
|
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
|
||||||
|
)
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Couldn't find %WRAPPER_JAR%, downloading it ...
|
||||||
|
echo Downloading from: %DOWNLOAD_URL%
|
||||||
|
)
|
||||||
|
|
||||||
|
powershell -Command "&{"^
|
||||||
|
"$webclient = new-object System.Net.WebClient;"^
|
||||||
|
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
|
||||||
|
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
|
||||||
|
"}"^
|
||||||
|
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
|
||||||
|
"}"
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Finished downloading %WRAPPER_JAR%
|
||||||
|
)
|
||||||
|
)
|
||||||
|
@REM End of extension
|
||||||
|
|
||||||
|
@REM Provide a "standardized" way to retrieve the CLI args that will
|
||||||
|
@REM work with both Windows and non-Windows executions.
|
||||||
|
set MAVEN_CMD_LINE_ARGS=%*
|
||||||
|
|
||||||
|
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
|
||||||
|
if ERRORLEVEL 1 goto error
|
||||||
|
goto end
|
||||||
|
|
||||||
|
:error
|
||||||
|
set ERROR_CODE=1
|
||||||
|
|
||||||
|
:end
|
||||||
|
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
||||||
|
|
||||||
|
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
|
||||||
|
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
||||||
|
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
|
||||||
|
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
|
||||||
|
:skipRcPost
|
||||||
|
|
||||||
|
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
||||||
|
if "%MAVEN_BATCH_PAUSE%" == "on" pause
|
||||||
|
|
||||||
|
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
|
||||||
|
|
||||||
|
exit /B %ERROR_CODE%
|
106
pom.xml
Normal file
106
pom.xml
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" 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">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>2.2.2.RELEASE</version>
|
||||||
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
|
</parent>
|
||||||
|
<groupId>com.phy</groupId>
|
||||||
|
<artifactId>ebuy</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
<name>ebuy</name>
|
||||||
|
<description>Demo project for Spring Boot</description>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<java.version>1.8</java.version>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis.spring.boot</groupId>
|
||||||
|
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||||
|
<version>2.1.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.junit.vintage</groupId>
|
||||||
|
<artifactId>junit-vintage-engine</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<!--模板引擎-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ibeetl</groupId>
|
||||||
|
<artifactId>beetl</artifactId>
|
||||||
|
<version>2.8.5</version>
|
||||||
|
</dependency>
|
||||||
|
<!--lombok插件是为了方便实体类bean快速生成get set方法,从而不用手动添加
|
||||||
|
该插件可以在idea的file–>plugins–>搜索框搜索安装-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>1.16.10</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--commons-lang3是Apache的Jakarta commons工程下具有一系列公共基础类。
|
||||||
|
Apache的Jakarta commons工程项目列表路径:http://commons.apache.org
|
||||||
|
Commons基础类包基本上是基于JDK API开发而来,依赖微小,可重用性是Jakarta commons的灵魂所在。
|
||||||
|
Lang组件主要是一些工具类,涉及到数组工具类,字符串工具类,字符工具类,数学方面,时间日期工具类,异常,事件等工具类。-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
<version>3.9</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--<dependency>-->
|
||||||
|
<!--<groupId>org.springframework.boot</groupId>-->
|
||||||
|
<!--<artifactId>spring‐boot‐starter‐thymeleaf</artifactId>-->
|
||||||
|
<!--<version>2.1.6</version>-->
|
||||||
|
<!--</dependency>-->
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/webapp</directory>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/java</directory>
|
||||||
|
<includes>
|
||||||
|
<include>**/*.xml</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
|
||||||
|
</project>
|
20
src/main/java/com/phy/ebuy/Beetl/BeetlConfiguration.java
Normal file
20
src/main/java/com/phy/ebuy/Beetl/BeetlConfiguration.java
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
package com.phy.ebuy.Beetl;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.RandomUtils;
|
||||||
|
import org.beetl.ext.spring.BeetlGroupUtilConfiguration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @version 1.0
|
||||||
|
* @description: beetl拓展配置, 绑定一些工具类, 方便在模板中直接调用.直接配置groupTemplate
|
||||||
|
* @author: taozhiyaoyao
|
||||||
|
* @date 2018/7/5
|
||||||
|
*/
|
||||||
|
public class BeetlConfiguration extends BeetlGroupUtilConfiguration {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 注册自定义方法
|
||||||
|
*/
|
||||||
|
public void initOther() {
|
||||||
|
groupTemplate.registerFunctionPackage("random", new RandomUtils());
|
||||||
|
}
|
||||||
|
}
|
58
src/main/java/com/phy/ebuy/Beetl/BeetlProperties.java
Normal file
58
src/main/java/com/phy/ebuy/Beetl/BeetlProperties.java
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
package com.phy.ebuy.Beetl;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ConfigurationProperties(prefix = BeetlProperties.BEETLCONF_PREFIX)
|
||||||
|
public class BeetlProperties {
|
||||||
|
|
||||||
|
public static final String BEETLCONF_PREFIX = "beetl";
|
||||||
|
|
||||||
|
private String delimiterStatementStart;
|
||||||
|
|
||||||
|
private String delimiterStatementEnd;
|
||||||
|
|
||||||
|
private String resourceTagroot;
|
||||||
|
|
||||||
|
private String resourceTagsuffix;
|
||||||
|
|
||||||
|
private String resourceAutoCheck;
|
||||||
|
|
||||||
|
@Value("${spring.mvc.view.prefix}")
|
||||||
|
private String prefix;
|
||||||
|
|
||||||
|
public Properties getProperties() {
|
||||||
|
Properties properties = new Properties();
|
||||||
|
if (StringUtils.isNotBlank(delimiterStatementStart)) {
|
||||||
|
if (delimiterStatementStart.startsWith("\\")) {
|
||||||
|
delimiterStatementStart = delimiterStatementStart.substring(1);
|
||||||
|
}
|
||||||
|
properties.setProperty("DELIMITER_STATEMENT_START", delimiterStatementStart);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(delimiterStatementEnd)) {
|
||||||
|
properties.setProperty("DELIMITER_STATEMENT_END", delimiterStatementEnd);
|
||||||
|
} else {
|
||||||
|
properties.setProperty("DELIMITER_STATEMENT_END", "null");
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(resourceTagroot)) {
|
||||||
|
properties.setProperty("RESOURCE.tagRoot", resourceTagroot);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(resourceTagsuffix)) {
|
||||||
|
properties.setProperty("RESOURCE.tagSuffix", resourceTagsuffix);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(resourceAutoCheck)) {
|
||||||
|
properties.setProperty("RESOURCE.autoCheck", resourceAutoCheck);
|
||||||
|
}
|
||||||
|
return properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPrefix() {
|
||||||
|
return prefix;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
39
src/main/java/com/phy/ebuy/Beetl/MyBeetlConfig.java
Normal file
39
src/main/java/com/phy/ebuy/Beetl/MyBeetlConfig.java
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
package com.phy.ebuy.Beetl;
|
||||||
|
|
||||||
|
import org.beetl.core.resource.ClasspathResourceLoader;
|
||||||
|
import org.beetl.ext.spring.BeetlSpringViewResolver;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@EnableConfigurationProperties(BeetlProperties.class)
|
||||||
|
public class MyBeetlConfig {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BeetlProperties beetlProperties;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* beetl的配置
|
||||||
|
*/
|
||||||
|
@Bean(initMethod = "init")
|
||||||
|
public BeetlConfiguration beetlConfiguration() {
|
||||||
|
BeetlConfiguration beetlConfiguration = new BeetlConfiguration();
|
||||||
|
beetlConfiguration.setResourceLoader(new ClasspathResourceLoader(MyBeetlConfig.class.getClassLoader(), beetlProperties.getPrefix()));
|
||||||
|
beetlConfiguration.setConfigProperties(beetlProperties.getProperties());
|
||||||
|
return beetlConfiguration;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* beetl的视图解析器
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public BeetlSpringViewResolver beetlViewResolver() {
|
||||||
|
BeetlSpringViewResolver beetlSpringViewResolver = new BeetlSpringViewResolver();
|
||||||
|
beetlSpringViewResolver.setConfig(beetlConfiguration());
|
||||||
|
beetlSpringViewResolver.setContentType("text/html;charset=UTF-8");
|
||||||
|
beetlSpringViewResolver.setOrder(0);
|
||||||
|
return beetlSpringViewResolver;
|
||||||
|
}
|
||||||
|
}
|
13
src/main/java/com/phy/ebuy/EbuyApplication.java
Normal file
13
src/main/java/com/phy/ebuy/EbuyApplication.java
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package com.phy.ebuy;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
public class EbuyApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(EbuyApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
14
src/main/java/com/phy/ebuy/controller/EbuyController.java
Normal file
14
src/main/java/com/phy/ebuy/controller/EbuyController.java
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package com.phy.ebuy.controller;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/ebuy")
|
||||||
|
public class EbuyController {
|
||||||
|
|
||||||
|
@RequestMapping("/login")
|
||||||
|
public String login() {
|
||||||
|
return "/login.html";
|
||||||
|
}
|
||||||
|
}
|
77
src/main/resources/application-dev.yml
Normal file
77
src/main/resources/application-dev.yml
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
##########################################################
|
||||||
|
################### 开发环境的profile ###################
|
||||||
|
##########################################################
|
||||||
|
spring:
|
||||||
|
profiles: dev
|
||||||
|
redis:
|
||||||
|
host: redis.jxdinfo.com
|
||||||
|
port: 6379
|
||||||
|
password:
|
||||||
|
jedis:
|
||||||
|
pool:
|
||||||
|
max-active: 3 # 连接池最大连接数(使用负值表示没有限制)
|
||||||
|
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||||
|
max-idle: 3 # 连接池中的最大空闲连接
|
||||||
|
min-idle: 0 # 连接池中的最小空闲连接
|
||||||
|
timeout: 0 # 连接超时时间(毫秒)
|
||||||
|
################### mongodb配置 ###################
|
||||||
|
# data:
|
||||||
|
# mongodb:
|
||||||
|
# host: mongodb.jxdinfo.com
|
||||||
|
# port: 27017
|
||||||
|
# database: log4j
|
||||||
|
################### mysql配置 ###################
|
||||||
|
datasource:
|
||||||
|
url: jdbc:mysql://127.0.0.1:3306/ebuy?serverTimezone=Hongkong&useUnicode=true&characterEncoding=utf8
|
||||||
|
username: root
|
||||||
|
password: 123456
|
||||||
|
db-name: ebuy
|
||||||
|
filters: log4j,wall,mergeStat
|
||||||
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
|
################### oracle配置 ###################
|
||||||
|
# datasource:
|
||||||
|
# url: jdbc:oracle:thin:@127.0.0.1:1521:orcl
|
||||||
|
# username: zwe
|
||||||
|
# password: zwe
|
||||||
|
# db-name: zwe
|
||||||
|
# filters: log4j,wall,mergeStat
|
||||||
|
# driverClassName: oracle.jdbc.OracleDriver
|
||||||
|
# validation-query: select 1 from dual
|
||||||
|
# datasource-one:
|
||||||
|
# url: jdbc:mysql://127.0.0.1:3306/hussar_v8_clean?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
|
||||||
|
# username: root
|
||||||
|
# password: root
|
||||||
|
# driverClassName: com.mysql.jdbc.Driver
|
||||||
|
# validation-query: select 1
|
||||||
|
# datasource-two:
|
||||||
|
# url: jdbc:mysql://127.0.0.1:3306/hussar_v8_clean?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
|
||||||
|
# username: root
|
||||||
|
# password: root
|
||||||
|
# driverClassName: com.mysql.jdbc.Driver
|
||||||
|
# validation-query: select 1
|
||||||
|
################### DM7配置 ###################
|
||||||
|
# datasource:
|
||||||
|
# driverClassName: dm.jdbc.driver.DmDriver
|
||||||
|
# url: jdbc:dm://dm.jxdinfo.com:5236
|
||||||
|
# username: HUSSAR_V8
|
||||||
|
# password: HUSSAR_V8
|
||||||
|
# db-name: HUSSAR_V8
|
||||||
|
# filters: log4j,mergeStat
|
||||||
|
################### Oscar配置 ###################
|
||||||
|
# datasource:
|
||||||
|
# url: jdbc:oscar://192.168.6.29:2003/osrdb
|
||||||
|
# username: HUSSAR_V8
|
||||||
|
# password: HUSSAR_V8
|
||||||
|
# db-name: HUSSAR_V8
|
||||||
|
# filters: log4j,mergeStat
|
||||||
|
# driverClassName: com.oscar.Driver
|
||||||
|
# validation-query: select 1 from dual
|
||||||
|
################### KingBase配置 ###################
|
||||||
|
# datasource:
|
||||||
|
# url: jdbc:kingbase://192.168.14.118/HUSSAR_V8
|
||||||
|
# username: system
|
||||||
|
# password: system
|
||||||
|
# db-name: HUSSAR_V8
|
||||||
|
# filters: log4j,mergeStat
|
||||||
|
# driverClassName: com.kingbase.Driver
|
||||||
|
# validation-query: SET SEARCH_PATH TO PUBLIC,wmsys,SYS_CATALOG;SELECT 1 FROM DUAL
|
195
src/main/resources/application.yml
Normal file
195
src/main/resources/application.yml
Normal file
@ -0,0 +1,195 @@
|
|||||||
|
############################## 项目启动信息配置 开始 ##############################
|
||||||
|
server:
|
||||||
|
port: 8888
|
||||||
|
# servlet:
|
||||||
|
# context-path: /ebuy
|
||||||
|
tomcat:
|
||||||
|
port-header: HEAD,PUT,DELETE,OPTIONS,TRACE,COPY,SEARCH,PROPFIND
|
||||||
|
min-spare-threads: 20
|
||||||
|
max-threads: 500
|
||||||
|
max-connections: 10000
|
||||||
|
|
||||||
|
############################## 项目启动信息配置 结束 ##############################
|
||||||
|
|
||||||
|
############################## spring配置 开始 ##############################
|
||||||
|
spring:
|
||||||
|
main:
|
||||||
|
allow-bean-definition-overriding: true
|
||||||
|
profiles:
|
||||||
|
active: dev # 当前激活的配置文件
|
||||||
|
mvc:
|
||||||
|
static-path-pattern: /static/** # 静态资源路径
|
||||||
|
view:
|
||||||
|
prefix: /WEB-INF/view # 页面文件路径
|
||||||
|
http:
|
||||||
|
converters:
|
||||||
|
preferred-json-mapper: fastjson # Json转换器
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
max-request-size: 100MB # 最大请求大小
|
||||||
|
max-file-size: 100MB # 最大文件大小
|
||||||
|
devtools:
|
||||||
|
restart:
|
||||||
|
enabled: true # 是否开启开发者工具(true/false)
|
||||||
|
additional-paths:
|
||||||
|
exclude: static/**
|
||||||
|
aop:
|
||||||
|
proxy-target-class: true #false为启用jdk默认动态代理,true为cglib动态代理
|
||||||
|
activiti:
|
||||||
|
check-process-definitions: false
|
||||||
|
############################## spring配置 结束 ##############################
|
||||||
|
|
||||||
|
############################## mybatis-plus配置 开始 ##############################
|
||||||
|
mybatis-plus:
|
||||||
|
mapper-locations: classpath*:com/**/mapping/*.xml
|
||||||
|
typeAliasesPackage: com.jxdinfo.hussar.**.model,com.xxxx.**.model
|
||||||
|
typeEnumsPackage: com.jxdinfo.hussar.common.constant.enums
|
||||||
|
global-config:
|
||||||
|
id-type: 3 # 0:数据库ID自增 1:用户输入id 2:全局唯一id(IdWorker) 3:全局唯一ID(uuid)
|
||||||
|
db-column-underline: false
|
||||||
|
refresh-mapper: true
|
||||||
|
logic-delete-value: 0
|
||||||
|
logic-not-delete-value: 1
|
||||||
|
sql-injector: com.baomidou.mybatisplus.mapper.LogicSqlInjector
|
||||||
|
configuration:
|
||||||
|
map-underscore-to-camel-case: false
|
||||||
|
cache-enabled: true # 配置的缓存的全局开关
|
||||||
|
lazyLoadingEnabled: true # 延时加载的开关
|
||||||
|
multipleResultSetsEnabled: true # 开启的话,延时加载一个属性时会加载该对象全部属性,否则按需加载属性
|
||||||
|
#jdbc-type-for-null: 'null' #Oracle数据库开启,否则使用updateAllColumnById()这种方法,如果列值为空,就会报错
|
||||||
|
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 打印sql语句,调试用
|
||||||
|
############################## mybatis-plus配置 结束 ##############################
|
||||||
|
|
||||||
|
############################## quartz配置 结束 ##############################
|
||||||
|
org:
|
||||||
|
quartz:
|
||||||
|
jobStore:
|
||||||
|
class: org.quartz.impl.jdbcjobstore.JobStoreTX # 持久化
|
||||||
|
dataSource: hussar # 定时任务数据源别名,非数据库别名
|
||||||
|
misfireThreshold: 5000 # 容许的最大作业延长时
|
||||||
|
tablePrefix: SYS_QRTZ_ # 表的前缀
|
||||||
|
threadPool:
|
||||||
|
threadCount: 5 # 并发个数
|
||||||
|
threadPriority: 5 # 优先级
|
||||||
|
threadsInheritContextClassLoaderOfInitializingThread: true # 自创建父线程
|
||||||
|
############################## quartz配置 结束 ##############################
|
||||||
|
|
||||||
|
############################## 日志配置 开始 ##############################
|
||||||
|
#logging:
|
||||||
|
# config: classpath:log4j2.xml # 详细日志配置文件
|
||||||
|
# level:
|
||||||
|
# root: ERROR # 日志默认输出级别
|
||||||
|
############################## 日志配置 结束 ##############################
|
||||||
|
|
||||||
|
############################## hussar配置 开始 ##############################
|
||||||
|
hussar:
|
||||||
|
spring-session-open: false # 是否开启spring session,如果是多机环境需要开启(true/false)
|
||||||
|
stand-alone: true # true 为单机环境 false 是集群环境
|
||||||
|
welcome-page: / # 配置项目访问路径
|
||||||
|
login-upper-open: true # 是否区分登录账号大小写 (true/false)
|
||||||
|
download-path: g:/GXDownload
|
||||||
|
############## 登录密码传输加密的加密方式 默认提供三种加密方式 非对称RSA、对称AES 、Base64;存储加密方式默认提供SM4(国密4算法)、MD5哈希算法,可自行扩展其他算法
|
||||||
|
encrypt-type:
|
||||||
|
type: RSA # 登录传输加密的加密方式 不区分大小写
|
||||||
|
db-encrypt-type: SM4 # 存储加密的加密方式 不区分大小写 默认提供国密4算法;!!!!!!!! 修改该配置,需要重置数据库中密码所有密码!!!!!
|
||||||
|
secret-free-ip: 192.168.1.1 # 这里配置一个有登录权限的IP
|
||||||
|
|
||||||
|
############################## 外部接口配置 ##############################
|
||||||
|
open-orgservice: false #是否启用组织机构外部接口
|
||||||
|
|
||||||
|
############## JWT认证所需参数
|
||||||
|
jwt:
|
||||||
|
auth-path: /auth # 认证请求的路径
|
||||||
|
############################## 以下配置为系统默认配置 ##############################
|
||||||
|
# header: Authorization # http请求头所需要的字段
|
||||||
|
# secret: mySecret # jwt秘钥
|
||||||
|
# expiration: 604800 # 7天 单位:秒
|
||||||
|
# md5-key: randomKey # md5加密混淆key
|
||||||
|
# static-version: 1111 # 项目自定义静态文件版本 在引入静态文件后加上 XXX.js?v=${h_version}
|
||||||
|
# muti-datasource-open: false # 是否开启多数据源
|
||||||
|
# useJNDI: false # 是否开启JNDI(默认为false)
|
||||||
|
# swagger-open: true # 是否开启swagger (true/false)
|
||||||
|
# kaptcha-open: false # 是否开启登录时验证码 (true/false)
|
||||||
|
# file-upload-path-windows: e:/hussar # 文件上传目录(不配置的话为java.io.tmpdir目录)
|
||||||
|
# file-upload-path-linux: /usr/local/hussar
|
||||||
|
# file-upload-path-mac: /tmp/hussar
|
||||||
|
# file-date-split: true # 上传路径日期区分
|
||||||
|
# session-invalidate-time: 1800 # session失效时间 单位:秒
|
||||||
|
# session-validation-interval: 900 # 多久检测一次失效的session(只在单机环境下生效) 单位:秒
|
||||||
|
# firewall-xss-level: B # XSS过滤级别,共ABC三级,过滤严格程度依次增强,建议默认开启B级
|
||||||
|
# xss-whitelist: #XSS过滤白名单
|
||||||
|
# - /notice/update
|
||||||
|
# - /notice/add
|
||||||
|
# login-html: /login.html # 登录页html
|
||||||
|
index-config: true #是否开启欢迎页配置 true开启 false不开启
|
||||||
|
default-index: /gxswJcsjInfo/view #默认欢迎页访问路径
|
||||||
|
# shiro: # shiro 通用配置
|
||||||
|
# login-url: /login # 登录页面URL
|
||||||
|
# unauthorized-url: /global/403 # 授权失败跳转地址
|
||||||
|
# security-whitelist: # 权限拦截白名单(可以配置多项)
|
||||||
|
# - /static/**
|
||||||
|
# - /login
|
||||||
|
|
||||||
|
############## rest请求 jwt认证开关 默认关闭rest请求认证,开启后,需要认证
|
||||||
|
# rest:
|
||||||
|
# auth-open: true # jwt鉴权机制是否开启(true或者false)
|
||||||
|
# sign-open: true # 签名机制是否开启(true或false)
|
||||||
|
# swagger-open: true # 是否开启swagger (true/false)
|
||||||
|
# url-pattern: /hussarrest/* # rest请求路径 : 默认/rest/*
|
||||||
|
# token-header-code: Hussar # 请求头识别码
|
||||||
|
|
||||||
|
|
||||||
|
############################## hussar配置 结束 ##############################
|
||||||
|
|
||||||
|
############################## 系统监控配置 开始 ##############################
|
||||||
|
# monitor:
|
||||||
|
# stat-view-servlet:
|
||||||
|
# hosts: 127.0.0.1:8080
|
||||||
|
# enabled: true
|
||||||
|
# local: 127.0.0.1:8080
|
||||||
|
# url-pattern: /smon
|
||||||
|
# web-stat-filter:
|
||||||
|
# enabled: true
|
||||||
|
# url-pattern: /smon
|
||||||
|
############################## 系统监控配置 结束 ##############################
|
||||||
|
|
||||||
|
############################## beetl配置 开始 ##############################
|
||||||
|
beetl:
|
||||||
|
delimiter-statement-start: \@ # 开始结束标签(yaml不允许@开头)
|
||||||
|
delimiter-statement-end: null
|
||||||
|
resource-tagroot: common/tags # 自定义标签文件Root目录和后缀
|
||||||
|
resource-tagsuffix: tag
|
||||||
|
resource-auto-check: true # 是否检测文件变化,开发用true合适,但线上要改为false
|
||||||
|
############################## beetl配置 结束 ##############################
|
||||||
|
|
||||||
|
############################## global配置开始 ##############################
|
||||||
|
#global:
|
||||||
|
# title: HussarV8 #当前项目名,当在一台服务器上部署多个V8项目时,务必修改此配置以防止cookie冲突
|
||||||
|
# default-password: 123456 # 用户默认密码
|
||||||
|
# pwd-complexity-regular: /^[\S]{6,12}$/ #密码复杂度正则
|
||||||
|
# unmatched-hint: 密码必须6到12位,且不能出现空格 #不满足时的提示信息
|
||||||
|
# force-change-pwd: true # 是否在第一次登录或一段时间后强制用户修改密码
|
||||||
|
# password-hist: 90 # 密码生命周期 多少天后强制修改密码 单位(天)
|
||||||
|
# pwd-repeat-time: 2 # 密码不能和前几次相同
|
||||||
|
# try-login-time: 3 # 用户尝试登陆次数
|
||||||
|
# lock-time: 1 # 多次登陆失败后锁定时间(单位:小时)
|
||||||
|
# session-limit: true # 是否开启会话限制
|
||||||
|
# kickout-after: false # 会话超出限制时,是否踢出后者(true剔除后者即新登录用户不能登录,,false,剔除最先登录的)
|
||||||
|
# default-theme: default # 默认皮肤主题,目前已有的主题(default生命绿,blue科技蓝)
|
||||||
|
# change-theme: true # 是否允许用户更换皮肤
|
||||||
|
# role-audit: true # 用户角色是否需要审核
|
||||||
|
# tree-lazy-load: true # jsTree是否为懒加载
|
||||||
|
# user-on-one-emp: true # 用户人员一对一
|
||||||
|
# operate-staff-with-user: true #操作人员同时操作用户(新增、修改、删除、转移)
|
||||||
|
|
||||||
|
############################## global配置 结束 ##############################
|
||||||
|
|
||||||
|
############################## 连接池监控配置 开始 ##############################
|
||||||
|
#druid:
|
||||||
|
# merge-sql: false
|
||||||
|
# need-login: true #连接池监控页面是否需要登陆
|
||||||
|
# login-username: druid #连接池监控页面用户名(需要登陆时有效)
|
||||||
|
# login-password: hussar #连接池监控页面密码(需要登陆时有效)
|
||||||
|
# slow-sql-millis: 2000 #慢SQL时间(单位:毫秒;执行时间超过此时间的sql会被标红)
|
||||||
|
# log-slow-sql: false #慢SQL是否记录日志
|
||||||
|
############################## 连接池监控配置 结束 ##############################
|
21
src/main/resources/beetl.properties
Normal file
21
src/main/resources/beetl.properties
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
ENGINE=org.beetl.core.engine.DefaultTemplateEngine
|
||||||
|
DELIMITER_PLACEHOLDER_START=${
|
||||||
|
DELIMITER_PLACEHOLDER_END=}
|
||||||
|
DELIMITER_STATEMENT_START=<%
|
||||||
|
DELIMITER_STATEMENT_END=%>
|
||||||
|
DIRECT_BYTE_OUTPUT = FALSE
|
||||||
|
HTML_TAG_SUPPORT = true
|
||||||
|
HTML_TAG_FLAG = #
|
||||||
|
HTML_TAG_BINDING_ATTRIBUTE = var
|
||||||
|
NATIVE_CALL = TRUE
|
||||||
|
TEMPLATE_CHARSET = UTF-8
|
||||||
|
ERROR_HANDLER = org.beetl.core.ConsoleErrorHandler
|
||||||
|
NATIVE_SECUARTY_MANAGER= org.beetl.core.DefaultNativeSecurityManager
|
||||||
|
MVC_STRICT = FALSE
|
||||||
|
|
||||||
|
#资源配置,resource后的属性只限于特定ResourceLoader
|
||||||
|
RESOURCE_LOADER=org.beetl.core.resource.ClasspathResourceLoader
|
||||||
|
#classpath 根路径
|
||||||
|
#RESOURCE.root= /templates/
|
||||||
|
#是否检测文件变化,开发用true合适,但线上要改为false
|
||||||
|
RESOURCE.autoCheck= true
|
17
src/main/webapp/WEB-INF/view/login.html
Normal file
17
src/main/webapp/WEB-INF/view/login.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>登录页面</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="head">
|
||||||
|
<div class="log">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="middle">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user