Hi all, dumb question: in a Grails multi-project i...
# questions
i
Hi all, dumb question: in a Grails multi-project is it possible to have more than one web-app? I only found examples with a single web-app (
profile: web
) and multiple plugins (
profile: plugin
). I’m trying to better understand if a multi-project build would fit my needs: I’m thinking of having 2 separate web-apps, sharing a bunch of code that I’d organize in one or more plugins. If this is doable, what would
./gradlew assemble
include in the .war archive? Both web-apps + all my plugins? Would
./gradlew appName:assemble
create a .war for a single web-app?
g
yes. as long as you put the plugins into your build.gradle
j
Hi @ilPittiz we have this exact setup. A simplified overview of our setup looks like this: 1. build-logic (shared build plugins) 2. common (shared plugin) 3. web1 (web app #1 ) 4. web2 (web app #2 ) 5. web3 (web app #3 ) The biggest suggestion I can offer you is that even though you can have a root build.gradle, dont' be tempted to define logic in the allProjects { } or subProject { } blocks. Instead, use composition to mix in functionality. So in our build-logic, we have a compile.gradle to define all of the compile related settings, a run.gradle to define all our local dev run options, a docker.gradle to define our docker image, etc.
i
Thank you @gaolei and @jdaugherty for your suggestions! I’m going to dive in now
👍 1