I have tried adding an external .jar file to a grails 4.0 application, and though this has been answered in 3.0 version, I can't find an answer for 4.0. (Grails 4.0 has changed significantly from 3.0.)
Here's what I've done so far:
- generated a clean project with grails create-app --inplace
- added the following to dependencies section of build.gradle (from root)
runtime fileTree(dir: '/vagrant/libs', include: '*.jar')
- Created a /vagrant/libs folder and dropped in .jar file
- From controller class, imported the path and tried constructing object.
import ext.*;
...
AnnotationRenderer ar = new AnnotationRenderer()
But I always get "unable to resolve class AnnotationRenderer".
Any tips to resolve this?