Gradle overlay CAS 5.0.0 + cas-server-support-ehcache-ticket-registry: some libraries are doubled in WEB-INF/lib

53 views
Skip to first unread message

Yauheni Sidarenka

unread,
Nov 28, 2016, 11:41:49 AM11/28/16
to CAS Community
I have bare Gradle Overlay Git repo of CAS 5.0.0, master branch, latest commit - 426847c1690723401a82f1c274c10d7a4a210107.
OS: Windows 7 Pro x64
JDK: Oracle 8u60

When I add in cas/build.gradle line

compile "org.apereo.cas:cas-server-support-ehcache-ticket-registry:${project.'cas.version'}"

after executing gradlew clean build these libraries will appear twice (two versions) in WEB-INF/lib  in resulted war file (version of library that was added by this dependency is in yellow):

attoparser-2.0.0.RELEASE.jar
attoparser-2.0.1.RELEASE.jar
hibernate-core-5.2.2.Final.jar
hibernate-core-5.2.4.Final.jar
hibernate-entitymanager-5.2.2.Final.jar
hibernate-entitymanager-5.2.4.Final.jar
HikariCP-2.4.7.jar
HikariCP-2.5.1.jar
jackson-annotations-2.8.3.jar
jackson-annotations-2.8.4.jar
jackson-core-2.8.3.jar
jackson-core-2.8.4.jar
jackson-databind-2.8.3.jar
jackson-databind-2.8.4.jar
jackson-dataformat-yaml-2.8.3.jar
jackson-dataformat-yaml-2.8.4.jar
jackson-datatype-guava-2.8.3.jar
jackson-datatype-guava-2.8.4.jar
jackson-datatype-jsr310-2.8.3.jar
jackson-datatype-jsr310-2.8.4.jar
spring-aop-4.3.3.RELEASE.jar
spring-aop-4.3.4.RELEASE.jar
spring-beans-4.3.3.RELEASE.jar
spring-beans-4.3.4.RELEASE.jar
spring-context-4.3.3.RELEASE.jar
spring-context-4.3.4.RELEASE.jar
spring-context-support-4.3.3.RELEASE.jar
spring-context-support-4.3.4.RELEASE.jar
spring-core-4.3.3.RELEASE.jar
spring-core-4.3.4.RELEASE.jar

spring-expression-4.3.3.RELEASE.jar
spring-expression-4.3.4.RELEASE.jar
spring-jdbc-4.3.3.RELEASE.jar
spring-jdbc-4.3.4.RELEASE.jar
spring-jms-4.3.3.RELEASE.jar
spring-jms-4.3.4.RELEASE.jar
spring-messaging-4.3.3.RELEASE.jar
spring-messaging-4.3.4.RELEASE.jar
spring-orm-4.3.3.RELEASE.jar
spring-orm-4.3.4.RELEASE.jar
spring-tx-4.3.3.RELEASE.jar
spring-tx-4.3.4.RELEASE.jar
spring-web-4.3.3.RELEASE.jar
spring-web-4.3.4.RELEASE.jar
spring-webmvc-4.3.3.RELEASE.jar
spring-webmvc-4.3.4.RELEASE.jar
spring-websocket-4.3.3.RELEASE.jar
spring-websocket-4.3.4.RELEASE.jar
thymeleaf-3.0.1.RELEASE.jar
thymeleaf-3.0.2.RELEASE.jar
thymeleaf-spring4-3.0.1.RELEASE.jar
thymeleaf-spring4-3.0.2.RELEASE.jar
unbescape-1.1.3.RELEASE.jar
unbescape-1.1.4.RELEASE.jar

How to disable extra libraries and which are correct ones?

Yauheni Sidarenka

unread,
Nov 29, 2016, 11:28:15 AM11/29/16
to CAS Community
There is a partial solution for this.

When I replace this line:


in cas/build.gradle file with the following line:


only one library is still doubled and it is HikariCP.
Even if I write:

apply from: 'https://raw.githubusercontent.com/apereo/cas/5.0.x/gradle/overrides.gradle'
ext
["hikariVersion"] = "2.5.1"
ext
["HikariCP.version"] = ext["hikariVersion"]

to make something like in that overrides.gradle file, mentioned library is doubled again.

By the way, I have noticed that "yellow" version of HikariCP comes in from Spring Boot.

Any ideas?

Yauheni Sidarenka

unread,
Nov 29, 2016, 11:42:01 AM11/29/16
to CAS Community
I have solved this problem.

Instead of writing this

ext["hikariVersion"] = "2.5.1"
ext
["HikariCP.version"] = ext["hikariVersion"]

in the top of cas/build.gradle file, I have added this

compile "com.zaxxer:HikariCP:2.5.1"

to dependencies section.

T
he solution is pretty straightforward but it saves my time.

Many thanks to everyone!

Yauheni Sidarenka

unread,
Dec 5, 2016, 8:04:10 AM12/5/16
to CAS Community
Hi all,

I have realized after guessing game, that


ext["HikariCP.version"] = ext["hikariVersion"]

does not help because it should be

ext["hikaricp.version"] = ext["hikariVersion"]

Looks like it is a bug in spring-boot Gradle plugin.

By the way, variable hikariVersion is unnecessary in CAS Gradle overlay project, it is only used in full distribution repository in gradle/dependencies.gradle file to create dependencies.

So, the solution can be either

ext["hikaricp.version"] = "2.5.1"

somewhere in the top of cas/build.gradle file or

compile "com.zaxxer:hikaricp:2.5.1"

in dependencies section in the file mentioned above.

Regards,
Yauheni

Yauheni Sidarenka

unread,
Dec 5, 2016, 8:19:22 AM12/5/16
to CAS Community
Sorry for misprinting.

The line in dependencies section must be

compile "com.zaxxer:HikariCP:2.5.1"

instead of

compile "com.zaxxer:hikaricp:2.5.1"

I do apologize.

Yauheni

Yauheni Sidarenka

unread,
Dec 5, 2016, 9:13:56 AM12/5/16
to CAS Community


This could be even improved using concrete version of file from commit tagged for release:

apply from: "https://raw.githubusercontent.com/apereo/cas/v${project.'cas.version'}/gradle/overrides.gradle" 

Regards,
Yauheni
Reply all
Reply to author
Forward
0 new messages