1. Setup a local folder structure to hold custom libraries using maven/ivy naming convention. Add a system environment variable for the path to the local folder
2. Edit grails-app/conf/BuildConfig.groovy to add the local repository.
3. Edit grails-app/conf/BuildConfig.groovy to add the new local dependency jar.
4. Test the build by running grails command dependency-report
5. Create a new build with grails command war
6. Regenerate the Spring Source Tool Suite project and classpath files using grails command integrate-with --eclipse
Listing for step 1 Local Repository
C:. ├───lib │ └───com │ └───fourgablesguy │ └───myapplication │ └───1.0.0 │ └───myapplication-1.0.0.jar set LOCAL_REPOSITORY=C:\libListing for step 2 and 3 BuildConfig.groovy
if (System.getenv().LOCAL_REPOSITORY == null) {
println "*"
println "* ERROR - LOCAL_REPOSITORY environment variable is undefined."
System.exit(1)
} else {
println "* LOCAL_REPOSITORY=" + System.getenv().LOCAL_REPOSITORY
localRepoDir = System.getenv().LOCAL_REPOSITORY
}
grails.project.dependency.resolution = {
//snip
repositories {
//snip
mavenRepo "file:${localRepoDir}"
}
dependencies {
//snip
compile "com.fourgablesguy:myapplication:1.0.0"
}
}
Listing for step 4-6 Grails commandsgrails dependency-report grails package grails integrate-with --eclipse

No comments:
Post a Comment