How to use ./gradlew getResource for Overlay Customization with CAS 6.1

86 views
Skip to first unread message

Daudt, Carl

unread,
Nov 27, 2019, 10:57:03 AM11/27/19
to cas-...@apereo.org

I am attempting to upgrade from CAS 5.x to CAS 6.1 and am new to using gradle for my overlays (have used maven in the past).  I am able to build, configure, and run CAS in my test environment, and am now interested in customizing my messages.properties, templates, etc.  Instructions provided in https://apereo.github.io/2019/01/07/cas61-gettingstarted-overlay/ instruct me to use the following to pull the resources I wish to modify into src/main/resources via the ./gradlew wrapper using the ‘getResource’ procedure.  For the messages.properties resource, I am instructed to do the following:

 

./gradlew getResource -PresourceName=messages.properties

 

However, when I run this, I receive the following:

 

---- BEGIN OUTPUT ----

$ ./gradlew getResource -PresourceName=messages.properties

 

> Task :getResource

No resources could be found matching messages.properties

 

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.

Use '--warning-mode all' to show the individual deprecation warnings.

See https://docs.gradle.org/5.6.3/userguide/command_line_interface.html#sec:command_line_warnings

 

BUILD SUCCESSFUL in 2s

5 actionable tasks: 1 executed, 4 up-to-date

$

---- END OUTPUT ----

 

Since “No resources could be found matching messages.properties”, nothing was pulled into src/main/resources .

 

Are there some other gradlew procedures I need to run first (I tried ./gradlew explodeWar to no avail)?

 

 

Carl R. Daudt

Enterprise Applications Systems Analyst, Information Technology

Taylor University

 



The information in this communication is intended solely for the individual or entity to whom it is addressed. It may contain confidential or legally privileged information. If you are not the intended recipient, any disclosure, copying, distribution or reliance on the contents of this information is strictly prohibited, and may be unlawful. If you have received this communication in error, please notify us immediately by responding to the sender of this email, and then delete it from your system. Taylor University is not liable for the inaccurate or improper transmission of the information contained in this communication or for any delay in its receipt.

Andy Ng

unread,
Nov 27, 2019, 8:53:23 PM11/27/19
to CAS Community
Hi Carl,

The tutorial from https://apereo.github.io/2019/01/07/cas61-gettingstarted-overlay/ seems to be a bit off from the actual implementation.
See the actual implementation here https://github.com/apereo/cas-overlay-template/blob/6.1/gradle/tasks.gradle, it seems suffix cannot be added for the resources to be acquired.

I tried and actually succeed with the following command:
> ./gradlew getResource -PresourceName=messages

Can you try and see if it would work?

Cheers!
- Andy

crdaudt

unread,
Dec 4, 2019, 9:35:35 AM12/4/19
to CAS Community
Indeed, removing the suffix works for me as well.  Likewise, to get one of the template files, for example, templates/layout.html, I find that the following works:
./gradlew getResource -PresourceName=layout
(i.e., without the .html suffix for layout.html).

Thanks Andy!
Carl

Andy Ng

unread,
Dec 4, 2019, 10:00:05 AM12/4/19
to CAS Community
glad it helps, also FYI I have submitted a pull request to make suffix also work in the future.
https://github.com/apereo/cas-overlay-template/pull/40

if you want suffix to work as well in your current download project, you can add those logic yourself as well.

cheers!
Andy

Reply all
Reply to author
Forward
0 new messages