migrates from maven to gradle (prepares kotlin migration)

Fri, 23 Oct 2020 18:01:40 +0200

author
Mike Becker <universe@uap-core.de>
date
Fri, 23 Oct 2020 18:01:40 +0200
changeset 147
dfec8c5f8db0
parent 146
b0e83cab0bde
child 148
87364e7ec333

migrates from maven to gradle (prepares kotlin migration)

.hgignore file | annotate | diff | comparison | revisions
build.gradle.kts file | annotate | diff | comparison | revisions
gradle.properties file | annotate | diff | comparison | revisions
gradle/wrapper/gradle-wrapper.jar file | annotate | diff | comparison | revisions
gradle/wrapper/gradle-wrapper.properties file | annotate | diff | comparison | revisions
gradlew file | annotate | diff | comparison | revisions
gradlew.bat file | annotate | diff | comparison | revisions
pom.xml file | annotate | diff | comparison | revisions
settings.gradle.kts file | annotate | diff | comparison | revisions
     1.1 --- a/.hgignore	Fri Oct 23 13:29:33 2020 +0200
     1.2 +++ b/.hgignore	Fri Oct 23 18:01:40 2020 +0200
     1.3 @@ -10,3 +10,5 @@
     1.4  \.conflict\~$
     1.5  \.iml$
     1.6  \.idea/
     1.7 +\.gradle/
     1.8 +local.properties
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/build.gradle.kts	Fri Oct 23 18:01:40 2020 +0200
     2.3 @@ -0,0 +1,33 @@
     2.4 +
     2.5 +plugins {
     2.6 +    kotlin("jvm") version "1.4.10"
     2.7 +    war
     2.8 +}
     2.9 +group = "de.uapcore"
    2.10 +version = "0.5-SNAPSHOT"
    2.11 +
    2.12 +val log4jVersion = "2.13.1"
    2.13 +val slf4jVersion = "1.7.30"
    2.14 +
    2.15 +repositories {
    2.16 +    mavenCentral()
    2.17 +}
    2.18 +
    2.19 +tasks.war {
    2.20 +    archiveFileName.set("lightpit.war")
    2.21 +    from("src/main/resources")
    2.22 +}
    2.23 +
    2.24 +kotlin {
    2.25 +    sourceSets {
    2.26 +        val main by getting {
    2.27 +            dependencies {
    2.28 +                compileOnly("javax.servlet:javax.servlet-api:3.1.0")
    2.29 +                compileOnly("javax.servlet:jstl:1.2")
    2.30 +                implementation("org.slf4j:slf4j-api:${slf4jVersion}")
    2.31 +                implementation("org.apache.logging.log4j:log4j-core:${log4jVersion}")
    2.32 +                implementation("org.apache.logging.log4j:log4j-slf4j-impl:${log4jVersion}")
    2.33 +            }
    2.34 +        }
    2.35 +    }
    2.36 +}
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/gradle.properties	Fri Oct 23 18:01:40 2020 +0200
     3.3 @@ -0,0 +1,2 @@
     3.4 +kotlin.code.style=official
     3.5 +kotlin.js.generate.executable.default=false
     4.1 Binary file gradle/wrapper/gradle-wrapper.jar has changed
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/gradle/wrapper/gradle-wrapper.properties	Fri Oct 23 18:01:40 2020 +0200
     5.3 @@ -0,0 +1,5 @@
     5.4 +distributionBase=GRADLE_USER_HOME
     5.5 +distributionPath=wrapper/dists
     5.6 +distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
     5.7 +zipStoreBase=GRADLE_USER_HOME
     5.8 +zipStorePath=wrapper/dists
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/gradlew	Fri Oct 23 18:01:40 2020 +0200
     6.3 @@ -0,0 +1,183 @@
     6.4 +#!/usr/bin/env sh
     6.5 +
     6.6 +#
     6.7 +# Copyright 2015 the original author or authors.
     6.8 +#
     6.9 +# Licensed under the Apache License, Version 2.0 (the "License");
    6.10 +# you may not use this file except in compliance with the License.
    6.11 +# You may obtain a copy of the License at
    6.12 +#
    6.13 +#      https://www.apache.org/licenses/LICENSE-2.0
    6.14 +#
    6.15 +# Unless required by applicable law or agreed to in writing, software
    6.16 +# distributed under the License is distributed on an "AS IS" BASIS,
    6.17 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    6.18 +# See the License for the specific language governing permissions and
    6.19 +# limitations under the License.
    6.20 +#
    6.21 +
    6.22 +##############################################################################
    6.23 +##
    6.24 +##  Gradle start up script for UN*X
    6.25 +##
    6.26 +##############################################################################
    6.27 +
    6.28 +# Attempt to set APP_HOME
    6.29 +# Resolve links: $0 may be a link
    6.30 +PRG="$0"
    6.31 +# Need this for relative symlinks.
    6.32 +while [ -h "$PRG" ] ; do
    6.33 +    ls=`ls -ld "$PRG"`
    6.34 +    link=`expr "$ls" : '.*-> \(.*\)$'`
    6.35 +    if expr "$link" : '/.*' > /dev/null; then
    6.36 +        PRG="$link"
    6.37 +    else
    6.38 +        PRG=`dirname "$PRG"`"/$link"
    6.39 +    fi
    6.40 +done
    6.41 +SAVED="`pwd`"
    6.42 +cd "`dirname \"$PRG\"`/" >/dev/null
    6.43 +APP_HOME="`pwd -P`"
    6.44 +cd "$SAVED" >/dev/null
    6.45 +
    6.46 +APP_NAME="Gradle"
    6.47 +APP_BASE_NAME=`basename "$0"`
    6.48 +
    6.49 +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
    6.50 +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
    6.51 +
    6.52 +# Use the maximum available, or set MAX_FD != -1 to use that value.
    6.53 +MAX_FD="maximum"
    6.54 +
    6.55 +warn () {
    6.56 +    echo "$*"
    6.57 +}
    6.58 +
    6.59 +die () {
    6.60 +    echo
    6.61 +    echo "$*"
    6.62 +    echo
    6.63 +    exit 1
    6.64 +}
    6.65 +
    6.66 +# OS specific support (must be 'true' or 'false').
    6.67 +cygwin=false
    6.68 +msys=false
    6.69 +darwin=false
    6.70 +nonstop=false
    6.71 +case "`uname`" in
    6.72 +  CYGWIN* )
    6.73 +    cygwin=true
    6.74 +    ;;
    6.75 +  Darwin* )
    6.76 +    darwin=true
    6.77 +    ;;
    6.78 +  MINGW* )
    6.79 +    msys=true
    6.80 +    ;;
    6.81 +  NONSTOP* )
    6.82 +    nonstop=true
    6.83 +    ;;
    6.84 +esac
    6.85 +
    6.86 +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
    6.87 +
    6.88 +# Determine the Java command to use to start the JVM.
    6.89 +if [ -n "$JAVA_HOME" ] ; then
    6.90 +    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
    6.91 +        # IBM's JDK on AIX uses strange locations for the executables
    6.92 +        JAVACMD="$JAVA_HOME/jre/sh/java"
    6.93 +    else
    6.94 +        JAVACMD="$JAVA_HOME/bin/java"
    6.95 +    fi
    6.96 +    if [ ! -x "$JAVACMD" ] ; then
    6.97 +        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
    6.98 +
    6.99 +Please set the JAVA_HOME variable in your environment to match the
   6.100 +location of your Java installation."
   6.101 +    fi
   6.102 +else
   6.103 +    JAVACMD="java"
   6.104 +    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
   6.105 +
   6.106 +Please set the JAVA_HOME variable in your environment to match the
   6.107 +location of your Java installation."
   6.108 +fi
   6.109 +
   6.110 +# Increase the maximum file descriptors if we can.
   6.111 +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
   6.112 +    MAX_FD_LIMIT=`ulimit -H -n`
   6.113 +    if [ $? -eq 0 ] ; then
   6.114 +        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
   6.115 +            MAX_FD="$MAX_FD_LIMIT"
   6.116 +        fi
   6.117 +        ulimit -n $MAX_FD
   6.118 +        if [ $? -ne 0 ] ; then
   6.119 +            warn "Could not set maximum file descriptor limit: $MAX_FD"
   6.120 +        fi
   6.121 +    else
   6.122 +        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
   6.123 +    fi
   6.124 +fi
   6.125 +
   6.126 +# For Darwin, add options to specify how the application appears in the dock
   6.127 +if $darwin; then
   6.128 +    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
   6.129 +fi
   6.130 +
   6.131 +# For Cygwin or MSYS, switch paths to Windows format before running java
   6.132 +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
   6.133 +    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
   6.134 +    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
   6.135 +    JAVACMD=`cygpath --unix "$JAVACMD"`
   6.136 +
   6.137 +    # We build the pattern for arguments to be converted via cygpath
   6.138 +    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
   6.139 +    SEP=""
   6.140 +    for dir in $ROOTDIRSRAW ; do
   6.141 +        ROOTDIRS="$ROOTDIRS$SEP$dir"
   6.142 +        SEP="|"
   6.143 +    done
   6.144 +    OURCYGPATTERN="(^($ROOTDIRS))"
   6.145 +    # Add a user-defined pattern to the cygpath arguments
   6.146 +    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
   6.147 +        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
   6.148 +    fi
   6.149 +    # Now convert the arguments - kludge to limit ourselves to /bin/sh
   6.150 +    i=0
   6.151 +    for arg in "$@" ; do
   6.152 +        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
   6.153 +        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
   6.154 +
   6.155 +        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
   6.156 +            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
   6.157 +        else
   6.158 +            eval `echo args$i`="\"$arg\""
   6.159 +        fi
   6.160 +        i=`expr $i + 1`
   6.161 +    done
   6.162 +    case $i in
   6.163 +        0) set -- ;;
   6.164 +        1) set -- "$args0" ;;
   6.165 +        2) set -- "$args0" "$args1" ;;
   6.166 +        3) set -- "$args0" "$args1" "$args2" ;;
   6.167 +        4) set -- "$args0" "$args1" "$args2" "$args3" ;;
   6.168 +        5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
   6.169 +        6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
   6.170 +        7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
   6.171 +        8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
   6.172 +        9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
   6.173 +    esac
   6.174 +fi
   6.175 +
   6.176 +# Escape application args
   6.177 +save () {
   6.178 +    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
   6.179 +    echo " "
   6.180 +}
   6.181 +APP_ARGS=`save "$@"`
   6.182 +
   6.183 +# Collect all arguments for the java command, following the shell quoting and substitution rules
   6.184 +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
   6.185 +
   6.186 +exec "$JAVACMD" "$@"
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/gradlew.bat	Fri Oct 23 18:01:40 2020 +0200
     7.3 @@ -0,0 +1,103 @@
     7.4 +@rem
     7.5 +@rem Copyright 2015 the original author or authors.
     7.6 +@rem
     7.7 +@rem Licensed under the Apache License, Version 2.0 (the "License");
     7.8 +@rem you may not use this file except in compliance with the License.
     7.9 +@rem You may obtain a copy of the License at
    7.10 +@rem
    7.11 +@rem      https://www.apache.org/licenses/LICENSE-2.0
    7.12 +@rem
    7.13 +@rem Unless required by applicable law or agreed to in writing, software
    7.14 +@rem distributed under the License is distributed on an "AS IS" BASIS,
    7.15 +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    7.16 +@rem See the License for the specific language governing permissions and
    7.17 +@rem limitations under the License.
    7.18 +@rem
    7.19 +
    7.20 +@if "%DEBUG%" == "" @echo off
    7.21 +@rem ##########################################################################
    7.22 +@rem
    7.23 +@rem  Gradle startup script for Windows
    7.24 +@rem
    7.25 +@rem ##########################################################################
    7.26 +
    7.27 +@rem Set local scope for the variables with windows NT shell
    7.28 +if "%OS%"=="Windows_NT" setlocal
    7.29 +
    7.30 +set DIRNAME=%~dp0
    7.31 +if "%DIRNAME%" == "" set DIRNAME=.
    7.32 +set APP_BASE_NAME=%~n0
    7.33 +set APP_HOME=%DIRNAME%
    7.34 +
    7.35 +@rem Resolve any "." and ".." in APP_HOME to make it shorter.
    7.36 +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
    7.37 +
    7.38 +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
    7.39 +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
    7.40 +
    7.41 +@rem Find java.exe
    7.42 +if defined JAVA_HOME goto findJavaFromJavaHome
    7.43 +
    7.44 +set JAVA_EXE=java.exe
    7.45 +%JAVA_EXE% -version >NUL 2>&1
    7.46 +if "%ERRORLEVEL%" == "0" goto init
    7.47 +
    7.48 +echo.
    7.49 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
    7.50 +echo.
    7.51 +echo Please set the JAVA_HOME variable in your environment to match the
    7.52 +echo location of your Java installation.
    7.53 +
    7.54 +goto fail
    7.55 +
    7.56 +:findJavaFromJavaHome
    7.57 +set JAVA_HOME=%JAVA_HOME:"=%
    7.58 +set JAVA_EXE=%JAVA_HOME%/bin/java.exe
    7.59 +
    7.60 +if exist "%JAVA_EXE%" goto init
    7.61 +
    7.62 +echo.
    7.63 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
    7.64 +echo.
    7.65 +echo Please set the JAVA_HOME variable in your environment to match the
    7.66 +echo location of your Java installation.
    7.67 +
    7.68 +goto fail
    7.69 +
    7.70 +:init
    7.71 +@rem Get command-line arguments, handling Windows variants
    7.72 +
    7.73 +if not "%OS%" == "Windows_NT" goto win9xME_args
    7.74 +
    7.75 +:win9xME_args
    7.76 +@rem Slurp the command line arguments.
    7.77 +set CMD_LINE_ARGS=
    7.78 +set _SKIP=2
    7.79 +
    7.80 +:win9xME_args_slurp
    7.81 +if "x%~1" == "x" goto execute
    7.82 +
    7.83 +set CMD_LINE_ARGS=%*
    7.84 +
    7.85 +:execute
    7.86 +@rem Setup the command line
    7.87 +
    7.88 +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
    7.89 +
    7.90 +@rem Execute Gradle
    7.91 +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
    7.92 +
    7.93 +:end
    7.94 +@rem End local scope for the variables with windows NT shell
    7.95 +if "%ERRORLEVEL%"=="0" goto mainEnd
    7.96 +
    7.97 +:fail
    7.98 +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
    7.99 +rem the _cmd.exe /c_ return code!
   7.100 +if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
   7.101 +exit /b 1
   7.102 +
   7.103 +:mainEnd
   7.104 +if "%OS%"=="Windows_NT" endlocal
   7.105 +
   7.106 +:omega
     8.1 --- a/pom.xml	Fri Oct 23 13:29:33 2020 +0200
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,69 +0,0 @@
     8.4 -<?xml version="1.0" encoding="UTF-8"?>
     8.5 -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
     8.6 -         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     8.7 -    <modelVersion>4.0.0</modelVersion>
     8.8 -    <groupId>de.uapcore</groupId>
     8.9 -    <artifactId>lightpit</artifactId>
    8.10 -    <version>0.5-SNAPSHOT</version>
    8.11 -    <packaging>war</packaging>
    8.12 -    <properties>
    8.13 -        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    8.14 -        <maven.compiler.source>11</maven.compiler.source>
    8.15 -        <maven.compiler.target>11</maven.compiler.target>
    8.16 -        <version.maven.compiler>3.8.1</version.maven.compiler>
    8.17 -        <version.maven.war>3.2.0</version.maven.war>
    8.18 -        <version.slf4j>1.7.30</version.slf4j>
    8.19 -        <version.log4j>2.13.1</version.log4j>
    8.20 -    </properties>
    8.21 -    <dependencies>
    8.22 -        <dependency>
    8.23 -            <groupId>org.slf4j</groupId>
    8.24 -            <artifactId>slf4j-api</artifactId>
    8.25 -            <version>${version.slf4j}</version>
    8.26 -        </dependency>
    8.27 -        <dependency>
    8.28 -            <groupId>org.apache.logging.log4j</groupId>
    8.29 -            <artifactId>log4j-core</artifactId>
    8.30 -            <version>${version.log4j}</version>
    8.31 -        </dependency>
    8.32 -        <dependency>
    8.33 -            <groupId>org.apache.logging.log4j</groupId>
    8.34 -            <artifactId>log4j-slf4j-impl</artifactId>
    8.35 -            <version>${version.log4j}</version>
    8.36 -        </dependency>
    8.37 -        <dependency>
    8.38 -            <groupId>javax.servlet</groupId>
    8.39 -            <artifactId>javax.servlet-api</artifactId>
    8.40 -            <version>3.1.0</version>
    8.41 -            <scope>provided</scope>
    8.42 -        </dependency>
    8.43 -        <dependency>
    8.44 -            <groupId>javax.servlet</groupId>
    8.45 -            <artifactId>jstl</artifactId>
    8.46 -            <version>1.2</version>
    8.47 -            <scope>provided</scope>
    8.48 -        </dependency>
    8.49 -    </dependencies>
    8.50 -    <build>
    8.51 -        <finalName>${project.artifactId}</finalName>
    8.52 -        <plugins>
    8.53 -            <plugin>
    8.54 -                <groupId>org.apache.maven.plugins</groupId>
    8.55 -                <artifactId>maven-compiler-plugin</artifactId>
    8.56 -                <version>${version.maven.compiler}</version>
    8.57 -            </plugin>
    8.58 -            <plugin>
    8.59 -                <groupId>org.apache.maven.plugins</groupId>
    8.60 -                <artifactId>maven-war-plugin</artifactId>
    8.61 -                <version>${version.maven.war}</version>
    8.62 -                <configuration>
    8.63 -                    <webResources>
    8.64 -                        <resource>
    8.65 -                            <directory>${project.basedir}/src/main/resources</directory>
    8.66 -                        </resource>
    8.67 -                    </webResources>
    8.68 -                </configuration>
    8.69 -            </plugin>
    8.70 -        </plugins>
    8.71 -    </build>
    8.72 -</project>
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/settings.gradle.kts	Fri Oct 23 18:01:40 2020 +0200
     9.3 @@ -0,0 +1,3 @@
     9.4 +
     9.5 +rootProject.name = "LightPIT"
     9.6 +

mercurial