Skip to content

Commit 610e249

Browse files
committed
Improved: Update build.gradle to the latest dependencies (OFBIZ-13194)
Thanks to previous precious Danny Trunk's work at OFBIZ-13123, this time the effort was not too hard. There are 2 aspects: 1) In build.gradle: Uses <<version "latest.release">> for plugins following https://docs.gradle.org/7.0/release-notes.html#using-dynamic-versions-in-the-plugins-block Updates junitReport to 'org.apache.ant:ant-junit:1.10.15' checkstyle to toolVersion = '10.20.2' Adds a commented out "useLatestVersions" section. Commented out because I tried to use the recommended useLatestVersions and useLatestVersionsCheck ie gradlew -PenableDependencyUpdates useLatestVersions && gradlew -PenableDependencyUpdates useLatestVersionsCheck and got an issue: Execution failed for task ':useLatestVersionsCheck' Maybe because of: Failed to determine the latest version for the following dependencies - org.apereo.cas:cas-server-support-ldap-core - org.safehaus.jug:jug This said it was useful, could be more if we complete the "useLatestVersions" section 2) In Dependencies the "standard" updates with new comments when needed ie removing or commenting issues in code with the help of useLatestVersions feature
1 parent 80f61f1 commit 610e249

File tree

2 files changed

+75
-37
lines changed

2 files changed

+75
-37
lines changed

build.gradle

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,21 @@ import org.asciidoctor.gradle.jvm.AsciidoctorTask
2323
* Project setup
2424
* ======================================================== */
2525
plugins {
26-
id 'application'
26+
id 'application' // plugins that are versioned as part of Gradle are using simple quotes to differentiate them
2727
id 'groovy'
2828
id 'eclipse'
2929
id 'checkstyle'
3030
id 'codenarc'
3131
id 'maven-publish'
32-
id 'org.asciidoctor.jvm.convert' version '4.0.2'
33-
id 'org.asciidoctor.jvm.pdf' version '4.0.2'
34-
id 'org.owasp.dependencycheck' version '10.0.2' apply false
35-
id 'se.patrikerdes.use-latest-versions' version '0.2.18' apply false
36-
id 'com.github.ben-manes.versions' version '0.51.0' apply false
37-
id "com.github.ManifestClasspath" version "0.1.0-RELEASE"
38-
id "com.github.jakemarsden.git-hooks" version "0.0.2"
39-
id "com.github.node-gradle.node" version '7.0.2' apply false
32+
id "org.asciidoctor.jvm.convert" version "latest.release"
33+
id "org.asciidoctor.jvm.pdf" version "latest.release"
34+
id "org.owasp.dependencycheck" version "latest.release" apply false
35+
//id 'se.patrikerdes.use-latest-versions' version '0.2.18' apply false
36+
id "se.patrikerdes.use-latest-versions" version "latest.release" apply false
37+
id "com.github.ben-manes.versions" version "latest.release" apply false
38+
id "com.github.ManifestClasspath" version "latest.release"
39+
id "com.github.jakemarsden.git-hooks" version "latest.release"
40+
id "com.github.node-gradle.node" version "latest.release" apply false
4041
}
4142

4243
/* OWASP plugin
@@ -71,6 +72,43 @@ if (project.hasProperty('enableDependencyUpdates')) {
7172
apply plugin: 'se.patrikerdes.use-latest-versions'
7273
}
7374

75+
/* Configuration and default values. By default not available as it breacks Gradle build even when useLatestVersionsCheck (see above) is used.
76+
useLatestVersions {
77+
// A whitelist of dependencies to update, in the format of group:name
78+
// Equal to command line: --update-dependency=[values]
79+
updateWhitelist = []
80+
// A blacklist of dependencies to update, in the format of group:name
81+
// Equal to command line: --ignore-dependency=[values]
82+
updateBlacklist = []
83+
// When enabled, root project gradle.properties will also be populated with
84+
// versions from subprojects in multi-project build
85+
// Equal to command line: --update-root-properties
86+
updateRootProperties = false
87+
// By default plugin tries to find all relevant gradle files (e.g. *.gradle, gradle.properties etc).
88+
// This can be slow in some cases when project has a lot of gradle files. For example when using conventions
89+
// in buildSrc. With this option you can specify what files should plugin search and check. Plugin will ignore
90+
// files that don't exist. Empty list means use default strategy. File paths are relative to project dir.
91+
//
92+
// Example:
93+
// versionFiles = ["gradle.build", "gradle.properties"]
94+
// Will check just $projectDir/gradle.build and $projectDir/gradle.properties
95+
//
96+
// Note:
97+
// You always have to specify file that has dependencies in some common dependency format with artifact coordinates,
98+
// e.g. compileOnly "group:module:version" or compileOnly("group:module:version") or val dependency = "group:module:version" etc.
99+
// For example if you set just versionFiles = ["gradle.properties"] this won't work, since plugin
100+
// won't be able to correlate variable with artifact coordinates.
101+
//
102+
// Equal to command line: --version-files=[values]
103+
versionFiles = []
104+
// List of root project files to update when updateRootProperties is enabled.
105+
// `build.gradle` is not an acceptable entry here as it breaks other expected
106+
// functionality. Version variables in `build.gradle` need to be moved into
107+
// a separate file which can be listed here.
108+
// Equal to command line: --root-version-files=[values]
109+
//rootVersionFiles = ['gradle.properties']
110+
}*/
111+
74112
apply from: 'common.gradle'
75113
apply from: 'dependencies.gradle'
76114

@@ -218,7 +256,7 @@ dependencies {
218256
}
219257

220258
junitReport 'junit:junit:4.13.2'
221-
junitReport 'org.apache.ant:ant-junit:1.10.14'
259+
junitReport 'org.apache.ant:ant-junit:1.10.15'
222260

223261
// Libraries downloaded manually
224262
implementation fileTree(dir: file("${rootDir}/lib"), include: '**/*.jar')
@@ -295,7 +333,7 @@ checkstyle {
295333
// Currently there are no errors so we can show new one when they appear
296334
showViolations = true
297335
// Specify tool version so we can keep it up-to-date
298-
toolVersion = '10.17.0'
336+
toolVersion = '10.20.2'
299337
}
300338
gitHooks {
301339
hooks = ['pre-push': 'checkstyleMain codenarcMain codenarcTest']

dependencies.gradle

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,64 +18,64 @@
1818
*/
1919
dependencies {
2020
implementation 'com.github.ben-manes.caffeine:caffeine:3.1.8'
21-
implementation 'com.google.guava:guava:33.2.1-jre'
21+
implementation 'com.google.guava:guava:33.3.1-jre'
2222
implementation 'com.google.zxing:core:3.5.3'
2323
implementation 'com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.4.2'
2424
implementation 'com.googlecode.ez-vcard:ez-vcard:0.12.1'
25-
implementation 'com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:20220608.1'
26-
implementation 'com.googlecode.libphonenumber:libphonenumber:8.13.31'
27-
implementation 'com.ibm.icu:icu4j:74.2'
25+
implementation 'com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:20240325.1'
26+
implementation 'com.googlecode.libphonenumber:libphonenumber:8.13.52'
27+
implementation 'com.ibm.icu:icu4j:76.1'
2828
implementation ('com.lowagie:itext:2.1.7') { // Don't update due to license change in newer versions, see OFBIZ-10455
2929
exclude group: 'bouncycastle', module: 'bcmail-jdk14'
3030
exclude group: 'bouncycastle', module: 'bcprov-jdk14'
3131
exclude group: 'bouncycastle', module: 'bctsp-jdk14'
3232
}
3333
implementation 'com.sun.mail:javax.mail:1.6.2'
3434
implementation 'com.rometools:rome:2.1.0'
35-
implementation 'com.thoughtworks.xstream:xstream:1.4.20'
35+
implementation 'com.thoughtworks.xstream:xstream:1.4.21'
3636
implementation 'commons-cli:commons-cli:1.5.0' // with 1.6.0, 2 tests of OfbizStartupUnitTests don't pass
3737
implementation 'commons-fileupload:commons-fileupload:1.5'
38-
implementation 'commons-net:commons-net:3.10.0'
39-
implementation 'commons-validator:commons-validator:1.8.0'
38+
implementation 'commons-net:commons-net:3.11.1'
39+
implementation 'commons-validator:commons-validator:1.9.0'
4040
implementation 'de.odysseus.juel:juel-impl:2.2.7'
4141
implementation 'javax.transaction:javax.transaction-api:1.3'
4242
implementation 'net.fortuna.ical4j:ical4j:1.0-rc4-atlassian-12'
4343
implementation 'net.lingala.zip4j:zip4j:2.11.5'
44-
implementation 'org.apache.ant:ant-junit:1.10.14'
44+
implementation 'org.apache.ant:ant-junit:1.10.15'
4545
implementation 'org.apache.commons:commons-collections4:4.4'
46-
implementation 'org.apache.commons:commons-csv:1.10.0'
46+
implementation 'org.apache.commons:commons-csv:1.12.0'
4747
implementation 'org.apache.commons:commons-dbcp2:2.13.0'
4848
implementation 'org.apache.commons:commons-imaging:1.0-alpha3' // Alpha but OK, "Imaging was working and was used by a number of projects in production even before reaching its initial release as an Apache Commons component." Since 1.0.0-alpha4 (note the use of semver) the API has changed. Better wait an "official release" to rewrite OFBiz code...
49-
implementation 'org.apache.commons:commons-text:1.11.0'
49+
implementation 'org.apache.commons:commons-text:1.12.0'
5050
implementation 'org.apache.geronimo.components:geronimo-transaction:3.1.5' // 4.0.0 does not compile
5151
implementation 'org.apache.geronimo.specs:geronimo-jms_1.1_spec:1.1.1'
5252
implementation 'org.apache.httpcomponents:httpclient-cache:4.5.14'
5353
implementation 'org.apache.logging.log4j:log4j-api:2.24.2' // the API of log4j 2
5454
implementation 'org.apache.logging.log4j:log4j-core:2.24.2' // Somehow needed by Buildbot to compile OFBizDynamicThresholdFilter.java
5555
implementation 'org.apache.poi:poi:5.3.0'
5656
implementation 'org.apache.pdfbox:pdfbox:2.0.32' // 3.0.1 does not compile
57-
implementation 'org.apache.shiro:shiro-core:1.13.0'
58-
implementation 'org.apache.shiro:shiro-crypto-cipher:2.0.0'
59-
implementation 'org.apache.sshd:sshd-core:2.13.1'
60-
implementation 'org.apache.sshd:sshd-sftp:2.13.1'
61-
implementation 'org.apache.tika:tika-core:2.9.2'
62-
implementation 'org.apache.tika:tika-parsers:2.9.2'
63-
implementation 'org.apache.tika:tika-parser-pdf-module:2.9.2'
57+
implementation 'org.apache.shiro:shiro-core:1.13.0' // Got "Exception in thread "main" java.lang.UnsupportedOperationException: Cannot create a hash with the given algorithm: argon2" with 2.0.2 in integration tests
58+
implementation 'org.apache.shiro:shiro-crypto-cipher:2.0.2'
59+
implementation 'org.apache.sshd:sshd-core:2.14.0'
60+
implementation 'org.apache.sshd:sshd-sftp:2.14.0'
61+
implementation 'org.apache.tika:tika-core:2.9.2' // To be compatible with tika-parser-pdf-module below
62+
implementation 'org.apache.tika:tika-parsers:2.9.2' // To be compatible with tika-parser-pdf-module below
63+
implementation 'org.apache.tika:tika-parser-pdf-module:2.9.2' // > 2.9.2 does not compile, see OFBIZ-13155
6464
implementation 'org.apache.cxf:cxf-rt-frontend-jaxrs:3.6.4' // 4.x+ requires javax.xml.bind -> jakarta.xml.bind namespace change
6565
implementation 'org.apache.tomcat:tomcat-catalina-ha:9.0.97' // Remember to change the version number (9 now) in javadoc block if needed.
6666
implementation 'org.apache.tomcat:tomcat-jasper:9.0.97'
6767
implementation 'org.apache.axis2:axis2-kernel:1.8.2'
68-
implementation 'org.apache.xmlgraphics:batik-anim:1.17'
69-
implementation 'org.apache.xmlgraphics:batik-util:1.17'
70-
implementation 'org.apache.xmlgraphics:batik-bridge:1.17'
68+
implementation 'org.apache.xmlgraphics:batik-anim:1.18'
69+
implementation 'org.apache.xmlgraphics:batik-util:1.18'
70+
implementation 'org.apache.xmlgraphics:batik-bridge:1.18'
7171
implementation 'org.apache.xmlgraphics:fop:2.3' // NOTE: since 2.4 dependencies are messed up. See https://github.com/moqui/moqui-fop/blob/master/build.gradle
72-
implementation 'org.clojure:clojure:1.11.3'
73-
implementation 'org.apache.groovy:groovy-all:4.0.22'
72+
implementation 'org.clojure:clojure:1.12.0'
73+
implementation 'org.apache.groovy:groovy-all:5.0.0-alpha-11'
7474
implementation 'org.freemarker:freemarker:2.3.34-SNAPSHOT' // Remember to change the version number in FreeMarkerWorker class when upgrading. See OFBIZ-10019 if >= 2.4
75-
implementation 'org.owasp.esapi:esapi:2.5.4.0'
75+
implementation 'org.owasp.esapi:esapi:2.6.0.0'
7676
implementation 'org.cyberneko:html:1.9.8'
7777
implementation 'org.springframework:spring-test:5.3.29' // 6.1.4 does not compile
78-
implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.1'
78+
implementation 'com.fasterxml.jackson.core:jackson-databind:2.18.2'
7979
implementation 'oro:oro:2.0.8'
8080
implementation 'wsdl4j:wsdl4j:1.6.3'
8181
implementation 'com.auth0:java-jwt:4.4.0'
@@ -88,7 +88,7 @@ dependencies {
8888
}
8989

9090
testImplementation 'org.hamcrest:hamcrest-library:2.2' // Enable junit4 to not depend on hamcrest-1.3
91-
testImplementation 'org.mockito:mockito-core:5.10.0'
91+
testImplementation 'org.mockito:mockito-core:5.14.2'
9292
testImplementation 'org.jmockit:jmockit:1.49'
9393
testImplementation 'com.pholser:junit-quickcheck-generators:1.0'
9494

@@ -108,7 +108,7 @@ dependencies {
108108
runtimeOnly 'org.apache.logging.log4j:log4j-jcl:2.24.2' // need to constrain to version to avoid classpath conflict (ReflectionUtil)
109109

110110
// specify last codenarc version for java 17 compliance
111-
codenarc('org.codenarc:CodeNarc:3.4.0')
111+
codenarc('org.codenarc:CodeNarc:3.5.0')
112112

113113
// use constraints to update transitive dependencies
114114
constraints {

0 commit comments

Comments
 (0)