Does anyone have experience with setting up gretty...
# multiplatform
l
Does anyone have experience with setting up gretty in a multiplatform project? (or the war plugin)
t
not directly, but with the spring boot plugin. We ended up with another module targeting JVM only and we built our executable jar form that other module
l
I'd prefer not to use spring for this project. Were you still able to access common code from your JVM module using this setup?
t
the other module only existis to configure the aretefact. it does not contain any other code or logic
so this is not a "to spring or not to spring" question 😉 What i want to say is: at least we were not able to make use of spring boot to configure and create the jvm artifact (a jar in out case, a war in your case) when using an MPP. But that was made wasy as soon as we introduced a new gradle module which's only use was to configure this artefact. no furhter code required
l
I think I understand what you're trying to say, I'm trying it out right now(never used multiple modules within Gradle before). Do I have to define the dependencies to be included in the war twice, once in the main build.gradle and once in the new module's build.gradle?
t
no, the new module only contains a dependency on the actual module as well as the tools you need to creater your artifact
there is not that mich of a difference between a gradle multi-module project and e.g. a maven multi-module project
l
How do I add the dependency on the actual module?
I added the submodule to my settings.gradle.
t
implementation project(":otherModule")
l
For some reason my js jar file is added into the war instead of the jvm jar file.
t
at thsi point, i can't help 😄
l
Yeah, I think I will attempt writing a task that will create a war file manually using the CLI instead of the plugin as this should give me more control. Thanks a lot for your help though!
👍 1