Upgraded the gradle and Java version. FatJar doesn't work with the latest gradle version. Looked outdated, so replaced the same with shadow jar plugin.
Merge commit 'refs/pull/8/head' of https://github.com/apache/incubator-freemarker-online-tester
diff --git a/.travis.yml b/.travis.yml
index f5c99a7..c4f11b7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1 +1,3 @@
-language: java
\ No newline at end of file
+language: java
+jdk:
+ - oraclejdk8
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index 13a2624..7b98d96 100644
--- a/build.gradle
+++ b/build.gradle
@@ -18,11 +18,11 @@
*/
group = 'org.apache.freemarker.onlinetester'
-project.projectName = "freemarker-online"
+project.ext.projectName = "freemarker-online"
def BUILD_NUMBER = project.hasProperty('BUILD_NUMBER') ? "$BUILD_NUMBER" : 'undef'
project.version = "0.1.$BUILD_NUMBER"
-project.yml = "$rootDir/src/main/resources/${projectName}.yml"
-project.jarName = "$rootDir/build/libs/${projectName}-${project.version}.jar"
+project.ext.yml = "$rootDir/src/main/resources/${projectName}.yml"
+project.ext.jarName = "${projectName}-${project.version}"
apply from: "intellij.gradle"
apply from: "${rootDir}/dependencies.gradle"
@@ -30,20 +30,20 @@
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'project-report'
-apply plugin: 'fatjar'
apply plugin: 'fpm-packaging'
+apply plugin: 'com.github.johnrengelman.shadow'
// Because Spring 3 doesn't officially support Java 8, and indeed asm fails with it:
// Must be after `apply plugin: 'java'`!
-project.sourceCompatibility = "1.7"
-project.targetCompatibility = "1.7"
+project.sourceCompatibility = "1.8"
+project.targetCompatibility = "1.8"
buildscript {
repositories {
mavenCentral()
}
dependencies {
- classpath 'eu.appsatori:gradle-fatjar-plugin:0.2-rc1'
+
classpath 'com.kenshoo:gradle-fpm:+'
}
}
@@ -53,6 +53,17 @@
}
+buildscript {
+ repositories {
+ maven {
+ url "https://plugins.gradle.org/m2/"
+ }
+ }
+ dependencies {
+ classpath "com.github.jengelman.gradle.plugins:shadow:1.2.4"
+ }
+}
+
dependencies {
compile libraries.dropwizard
compile libraries.dropwizard_views
@@ -92,10 +103,10 @@
}
task wrapper(type: Wrapper) {
- gradleVersion = '1.10'
+ gradleVersion = '3.5'
}
-fatJar {
+jar {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
@@ -105,11 +116,7 @@
}
}
-// this merges the spring files into META-INF properly
-fatJarPrepareFiles {
- include 'META-INF/spring.handlers'
- include 'META-INF/spring.schemas'
-}
+
// wrap jar, upstart and yml into deb package:
@@ -142,8 +149,14 @@
baseDir = stagingDir
}
+shadowJar {
+ baseName = "${jarName}"
+ classifier = null
+ version = null
+ mergeServiceFiles()
+}
-fatJar.dependsOn jar
-build.dependsOn fatJar
+shadowJar.dependsOn jar
+build.dependsOn shadowJar
stageFiles.dependsOn build
debian.dependsOn stageFiles
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index a7634b0..b979729 100644
--- a/gradle/wrapper/gradle-wrapper.jar
+++ b/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 0a9abd7..d959dfc 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,6 @@
+#Wed May 03 11:59:02 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.7-bin.zip
+distributionUrl=http\://services.gradle.org/distributions/gradle-3.5-bin.zip
diff --git a/gradlew.bat b/gradlew.bat
index 5968903..aec9973 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -1,91 +1,90 @@
-
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windowz variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega