@@ -38,13 +38,38 @@ ext {
3838version = projectVersion
3939group = ' org.apache.grails'
4040
41+ configurations {
42+ shadowCombined
43+ }
44+
4145evaluationDependsOn(' :grails-cli-shadow' )
4246dependencies {
4347 implementation platform(" org.apache.grails:grails-bom:$projectVersion " )
4448 implementation ' org.apache.groovy:groovy'
4549
46- // forge & shell-cli dependencies have to be pulled via a file to ensure the transforms are applied to both dependencies and our own projects
47- runtimeOnly files(project(' :grails-cli-shadow' ). tasks. named(' shadowJar' ))
50+ // shell-cli dependencies
51+ implementation ' org.apache.grails:grails-shell-cli'
52+ implementation ' org.springframework.boot:spring-boot-cli'
53+ implementation ' org.apache.groovy:groovy'
54+ implementation ' org.apache.groovy:groovy-ant'
55+ implementation ' org.apache.groovy:groovy-templates'
56+
57+ // The commands are pulled from the shellCliDependencies in the shell project, but they are not in the shell jar file,
58+ // so they must be added here. To keep the jar file smaller, only a subset is included here
59+ implementation ' org.apache.grails:grails-core' // for ApplicationContextCommandFactory to lookup commands
60+ implementation ' org.apache.grails:grails-url-mappings' // for UrlMappingsReportCommand
61+ // profiles will add additional libraries as needed to surface commands
62+
63+ // forge dependencies
64+ implementation project(' :grails-forge-cli' ), {
65+ exclude group : ' org.slf4j' , module : ' slf4j-nop'
66+ }
67+
68+ // for the shadow jar, configure forge & shell-cli dependencies to be pulled from a file to ensure the shadow
69+ // transforms are applied to both dependencies and our own projects
70+ shadowCombined platform(" org.apache.grails:grails-bom:$projectVersion " )
71+ shadowCombined ' org.apache.groovy:groovy'
72+ shadowCombined files(project(' :grails-cli-shadow' ). tasks. named(' shadowJar' ))
4873}
4974
5075apply {
@@ -66,6 +91,9 @@ TaskProvider<Jar> shadowJarTask = tasks.named('shadowJar', ShadowJar)
6691shadowJarTask. configure { ShadowJar it ->
6792 it. archiveClassifier. set(' all' )
6893
94+ // use a separate configuration path so we can still publish the cli project with a non-shadow jar
95+ it. configurations = [project. configurations. shadowCombined]
96+
6997 // services & custom grails.factories have to be merged since commands can be created from both sources
7098 it. mergeServiceFiles()
7199 it. mergeServiceFiles(' META-INF/grails.factories' )
0 commit comments