diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 907d55e1..1084c776 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,14 +5,18 @@ on: [push] jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v1 - - name: set up JDK 1.11 - uses: actions/setup-java@v1 + - uses: actions/checkout@v2 with: - java-version: 1.11 + fetch-depth: 0 + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'adopt' + cache: maven - name: Move `private` folder run: mv private.sample private - name: Build with Gradle diff --git a/RMBTClient/build.gradle b/RMBTClient/build.gradle index d21d5303..c5db1179 100644 --- a/RMBTClient/build.gradle +++ b/RMBTClient/build.gradle @@ -16,12 +16,15 @@ buildscript { } dependencies { - compile group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.5' - compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.2' - compile group: 'net.sf.jopt-simple', name: 'jopt-simple', version: '5.0.4' - compile group: 'dnsjava', name: 'dnsjava', version: '2.1.8' - compile project(':RMBTSharedCode') - compile project(':RMBTUtil') + implementation group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.5' + implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.2' + implementation group: 'net.sf.jopt-simple', name: 'jopt-simple', version: '5.0.4' + implementation group: 'dnsjava', name: 'dnsjava', version: '2.1.8' + implementation "org.json:json:$jsonVersion" + implementation group: 'com.google.code.gson', name: 'gson', version: "$gsonVersion" + implementation group: 'com.google.guava', name: 'guava', version: "$guavaVersion" + implementation project(':RMBTSharedCode') + implementation project(':RMBTUtil') testImplementation group: 'org.jmockit', name: 'jmockit', version: '1.45' testImplementation group: 'junit', name: 'junit', version: '4.12' diff --git a/RMBTControlServer/build.gradle b/RMBTControlServer/build.gradle index 9d0bcbca..1c736dfc 100644 --- a/RMBTControlServer/build.gradle +++ b/RMBTControlServer/build.gradle @@ -16,7 +16,7 @@ project.webAppDirName = 'WebContent' repositories { mavenCentral() - maven{url 'http://maven.restlet.com'} + maven{url 'https://maven.restlet.talend.com'} maven{url 'https://oss.sonatype.org/content/repositories/snapshots/'} } @@ -41,7 +41,7 @@ def generatedContextXmlFile = file("${buildDir}/context.xml") dependencies { providedCompile "org.apache.tomcat:tomcat-catalina:$catalinaVersion" providedCompile "javax.servlet:javax.servlet-api:$servletVersion" - compile('commons-io:commons-io:2.4', + implementation('commons-io:commons-io:2.4', "org.json:json:$jsonVersion", "org.restlet.jse:org.restlet.ext.json:${restletVersion}", "org.restlet.jee:org.restlet.ext.servlet:$restletVersion", @@ -51,18 +51,21 @@ dependencies { "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion", group: 'net.bull.javamelody', name: 'javamelody-core', version: "$javaMelodyVersion" ) - testCompile 'net.sf.uadetector:uadetector-resources:2014.10' - compile project(':RMBTSharedCode') - compile project(':RMBTUtil') + implementation group: 'com.google.code.gson', name: 'gson', version: "$gsonVersion" + implementation group: 'com.google.guava', name: 'guava', version: "$guavaVersion" + implementation group: 'joda-time', name: 'joda-time', version: '2.9.7' + testImplementation 'net.sf.uadetector:uadetector-resources:2014.10' + implementation project(':RMBTSharedCode') + implementation project(':RMBTUtil') } - war { webXml = webXmlFile exclude 'WEB-INF/web.xml' exclude 'WEB-INF/lib/**' exclude 'WEB-INF/classes/**' exclude 'META-INF/context.xml' + duplicatesStrategy = DuplicatesStrategy.EXCLUDE from(buildDir){ into('META-INF') include 'context.xml' @@ -72,6 +75,7 @@ war { def revisionPropertiesFile = file("${buildDir}/resources/main/revision.properties") processResources { + duplicatesStrategy = DuplicatesStrategy.EXCLUDE doLast { String revisionProperties = "git.describe=" + getVersionNameFromGit() + "\n" revisionProperties = revisionProperties + "git.branch=" + getBranchFromGit() + "\n" diff --git a/RMBTMapServer/build.gradle b/RMBTMapServer/build.gradle index dcd9a9e6..13620db3 100644 --- a/RMBTMapServer/build.gradle +++ b/RMBTMapServer/build.gradle @@ -15,7 +15,7 @@ project.webAppDirName = 'WebContent' repositories { mavenCentral() - maven{url 'http://maven.restlet.com'} + maven{url 'https://maven.restlet.talend.com'} maven{url 'https://oss.sonatype.org/content/repositories/snapshots/'} } @@ -34,13 +34,16 @@ subprojects{ dependencies { providedCompile "org.apache.tomcat:tomcat-catalina:$catalinaVersion" providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version: "$servletVersion" - compile "org.json:json:$jsonVersion" - compile "org.restlet.jse:org.restlet.ext.json:$restletVersion" - compile "org.restlet.jee:org.restlet.ext.servlet:$restletVersion" - compile 'org.postgis:postgis-jdbc:1.3.3' - compile(group: 'net.bull.javamelody', name: 'javamelody-core', version: "$javaMelodyVersion") - compile project(':RMBTSharedCode') - compile project(':RMBTUtil') + implementation "org.json:json:$jsonVersion" + implementation "org.restlet.jse:org.restlet.ext.json:$restletVersion" + implementation "org.restlet.jee:org.restlet.ext.servlet:$restletVersion" + implementation group: 'com.google.code.gson', name: 'gson', version: "$gsonVersion" + implementation group: 'com.google.guava', name: 'guava', version: "$guavaVersion" + implementation group: 'net.spy', name: 'spymemcached', version: '2.12.1' + implementation 'org.postgis:postgis-jdbc:1.3.3' + implementation(group: 'net.bull.javamelody', name: 'javamelody-core', version: "$javaMelodyVersion") + implementation project(':RMBTSharedCode') + implementation project(':RMBTUtil') } @@ -48,6 +51,7 @@ war { exclude 'WEB-INF/lib/**' exclude 'WEB-INF/classes/**' exclude 'META-INF/context.xml' + duplicatesStrategy = DuplicatesStrategy.EXCLUDE from(buildDir){ into('META-INF') include 'context.xml' diff --git a/RMBTQoSServer/build.gradle b/RMBTQoSServer/build.gradle index c3f2bbd6..f5d76411 100644 --- a/RMBTQoSServer/build.gradle +++ b/RMBTQoSServer/build.gradle @@ -13,29 +13,32 @@ tasks.withType(JavaCompile) { repositories { mavenCentral() - maven{url 'http://maven.restlet.com'} + maven{url 'https://maven.restlet.talend.com'} } dependencies { - compile project(':RMBTUtil') - compile project(':RMBTSharedCode') - compile 'org.jumpmind.symmetric.jdbc:postgresql:9.2-1002-jdbc4' - compile 'org.apache.logging.log4j:log4j-core:2.16.0' - compile "org.json:json:$jsonVersion" - compile "org.restlet.jse:org.restlet:$restletVersion" + implementation project(':RMBTUtil') + implementation project(':RMBTSharedCode') + implementation 'org.jumpmind.symmetric.jdbc:postgresql:9.2-1002-jdbc4' + implementation 'org.apache.logging.log4j:log4j-core:2.16.0' + implementation "org.json:json:$jsonVersion" + implementation "org.restlet.jse:org.restlet:$restletVersion" + implementation group: 'com.google.code.gson', name: 'gson', version: "$gsonVersion" + implementation group: 'com.google.guava', name: 'guava', version: "$guavaVersion" testImplementation group: 'org.jmockit', name: 'jmockit', version: '1.45' testImplementation group: 'junit', name: 'junit', version: '4.12' } jar { - from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } + from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } } from(rootProject.file("private/qosserver.jks"),{ into('/crt') }) manifest { attributes 'Main-Class': 'at.rtr.rmbt.qos.testserver.TestServer' } + duplicatesStrategy = DuplicatesStrategy.EXCLUDE } task wrapper(type: Wrapper) { diff --git a/RMBTSharedCode/build.gradle b/RMBTSharedCode/build.gradle index bc69c8bc..1293ff15 100644 --- a/RMBTSharedCode/build.gradle +++ b/RMBTSharedCode/build.gradle @@ -18,23 +18,23 @@ repositories { dependencies { - testCompile group: 'junit', name: 'junit', version: '4.11' - compile group: 'dnsjava', name: 'dnsjava', version: '2.1.7' - compile group: 'net.spy', name: 'spymemcached', version: '2.12.1' - compile group: 'joda-time', name: 'joda-time', version: '2.9.7' - testCompile group: 'junit', name: 'junit', version: '4.11' - compile group: 'org.postgresql', name: 'postgresql', version: '42.2.18' - compile group: 'com.google.guava', name: 'guava', version: '20.0' + testImplementation group: 'junit', name: 'junit', version: '4.11' + implementation group: 'dnsjava', name: 'dnsjava', version: '2.1.7' + implementation group: 'net.spy', name: 'spymemcached', version: '2.12.1' + implementation group: 'joda-time', name: 'joda-time', version: '2.9.7' + testImplementation group: 'junit', name: 'junit', version: '4.11' + implementation group: 'org.postgresql', name: 'postgresql', version: '42.2.18' + implementation group: 'com.google.guava', name: 'guava', version: "$guavaVersion" providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version: "$servletVersion" - compile "org.json:json:$jsonVersion" - compile group: 'com.google.code.gson', name: 'gson', version: '2.8.0' - compile group: 'com.github.jknack', name: 'handlebars', version: '4.1.2' + implementation "org.json:json:$jsonVersion" + implementation group: 'com.google.code.gson', name: 'gson', version: "$gsonVersion" + implementation group: 'com.github.jknack', name: 'handlebars', version: '4.1.2' - compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: "$jacksonVersion" + implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: "$jacksonVersion" // https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind - compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "$jacksonVersion" - compile 'com.maxmind.geoip2:geoip2:2.15.0' - compile 'io.swagger:swagger-annotations:1.5.15' + implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "$jacksonVersion" + implementation 'com.maxmind.geoip2:geoip2:2.15.0' + implementation 'io.swagger:swagger-annotations:1.5.15' } sourceSets { diff --git a/RMBTStatisticServer/build.gradle b/RMBTStatisticServer/build.gradle index a9d316a6..11795ef5 100644 --- a/RMBTStatisticServer/build.gradle +++ b/RMBTStatisticServer/build.gradle @@ -20,7 +20,7 @@ project.webAppDirName = 'WebContent' repositories { mavenCentral() - maven{url 'http://maven.restlet.com'} + maven{url 'https://maven.restlet.talend.com'} maven{url 'https://oss.sonatype.org/content/repositories/snapshots/'} maven { url 'https://jitpack.io' } } @@ -54,26 +54,31 @@ def generatedContextXmlFile = file("${buildDir}/context.xml") dependencies { providedCompile "org.apache.tomcat:tomcat-catalina:$catalinaVersion" providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version: "$servletVersion" - testCompile group: 'junit', name: 'junit', version: '4.12' - testCompile 'org.mockito:mockito-core:2.7.17' - compile "org.restlet.jse:org.restlet:$restletVersion" - compile "org.restlet.jse:org.restlet.ext.json:$restletVersion" - compile "org.restlet.jee:org.restlet.ext.servlet:$restletVersion" - compile "org.restlet.jee:org.restlet.ext.fileupload:$restletVersion" - compile "org.json:json:$jsonVersion" - compile 'commons-io:commons-io:2.4' - compile 'org.apache.jcs:jcs:1.3' - compile "io.swagger:swagger-annotations:1.5.24" + testImplementation group: 'junit', name: 'junit', version: '4.12' + testImplementation 'org.mockito:mockito-core:2.7.17' + implementation "org.restlet.jse:org.restlet:$restletVersion" + implementation "org.restlet.jse:org.restlet.ext.json:$restletVersion" + implementation "org.restlet.jee:org.restlet.ext.servlet:$restletVersion" + implementation "org.restlet.jee:org.restlet.ext.fileupload:$restletVersion" + implementation "org.json:json:$jsonVersion" + implementation 'commons-io:commons-io:2.4' + implementation 'org.apache.jcs:jcs:1.3' + implementation "io.swagger:swagger-annotations:1.5.24" //compile 'io.swagger:swagger-core:1.5.15' - compile 'javax.ws.rs:javax.ws.rs-api:2.0.1' - compile "com.fasterxml.jackson:jackson-base:$jacksonVersion" - compile "com.fasterxml.jackson.dataformat:jackson-dataformat-csv:$jacksonVersion" + implementation 'javax.ws.rs:javax.ws.rs-api:2.0.1' + implementation "com.fasterxml.jackson:jackson-base:$jacksonVersion" + implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-csv:$jacksonVersion" implementation group: 'de.grundid.opendatalab', name: 'geojson-jackson', version: '1.14' - compile group: 'commons-dbutils', name: 'commons-dbutils', version: "$dbUtilsVersion" - compile "com.github.sett4:jackson-dataformat-xlsx-lite:2.9.10.1" - compile (group: 'net.bull.javamelody', name: 'javamelody-core', version: "$javaMelodyVersion") - compile project(':RMBTSharedCode') - compile project(':RMBTUtil') + implementation group: 'commons-dbutils', name: 'commons-dbutils', version: "$dbUtilsVersion" + implementation "com.github.sett4:jackson-dataformat-xlsx-lite:2.9.10.1" + implementation (group: 'net.bull.javamelody', name: 'javamelody-core', version: "$javaMelodyVersion") + implementation group: 'com.google.code.gson', name: 'gson', version: "$gsonVersion" + implementation group: 'com.google.guava', name: 'guava', version: "$guavaVersion" + implementation group: 'com.github.jknack', name: 'handlebars', version: '4.1.2' + implementation group: 'joda-time', name: 'joda-time', version: '2.9.7' + implementation group: 'net.spy', name: 'spymemcached', version: '2.12.1' + implementation project(':RMBTSharedCode') + implementation project(':RMBTUtil') } @@ -81,6 +86,7 @@ war { exclude 'WEB-INF/lib/**' exclude 'WEB-INF/classes/**' exclude 'META-INF/context.xml' + duplicatesStrategy = DuplicatesStrategy.EXCLUDE from(buildDir){ into('META-INF') include 'context.xml' @@ -121,6 +127,7 @@ swagger { def revisionPropertiesFile = file("${buildDir}/resources/main/revision.properties") processResources { + duplicatesStrategy = DuplicatesStrategy.EXCLUDE doLast { String revisionProperties = "git.describe=" + getVersionNameFromGit() + "\n" revisionProperties = revisionProperties + "git.branch=" + getBranchFromGit() + "\n" diff --git a/RMBTUtil/build.gradle b/RMBTUtil/build.gradle index 9eae23dd..bae60b83 100644 --- a/RMBTUtil/build.gradle +++ b/RMBTUtil/build.gradle @@ -7,7 +7,7 @@ repositories { dependencies { - testCompile group: 'junit', name: 'junit', version: '4.13.2' - compile group: 'org.json', name: 'json', version: "$jsonVersion" - compile group: 'com.google.code.gson', name: 'gson', version: '2.10.1' + testImplementation group: 'junit', name: 'junit', version: '4.13.2' + implementation group: 'org.json', name: 'json', version: "$jsonVersion" + implementation group: 'com.google.code.gson', name: 'gson', version: '2.10.1' } diff --git a/build.gradle b/build.gradle index 12dc63d2..7cf3b087 100644 --- a/build.gradle +++ b/build.gradle @@ -18,9 +18,6 @@ buildscript { } google() } - dependencies { - classpath 'com.android.tools.build:gradle:3.5.0' - } } def getVersionNameFromGit() { diff --git a/common.gradle b/common.gradle index d496ce84..764fc514 100644 --- a/common.gradle +++ b/common.gradle @@ -9,6 +9,8 @@ ext { jsonVersion = '20220924' javaMelodyVersion = '1.91.0' dbUtilsVersion = '1.7' + guavaVersion = '20.0' + gsonVersion = '2.8.0' } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1c879061..6717863f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ #Sat Jan 11 20:24:04 CET 2020 -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStorePath=wrapper/dists