Closed vikanezrimaya closed 7 years ago
This is definitely possible; it just needs build system legwork.
By default, Gradle builds "fat WARs" - the WAR includes all libraries necessary to run it. For an I2P plugin, we don't want that - we include the libraries separately inside the plugin, along with a "thin WAR" that only contains the I2P-Bote code. It is trivial to exclude the libraries from the WAR in the build.config
(by putting the dependencies in the providedCompile
configuration instead of compile
), but I have not yet worked out how to have one Gradle project generate both thin and fat WARs.
Once both types of WARs can be built, all that remains is to bundle it with e.g. Tomcat.
i managed to make a fat jar in my gradle-fat
branch https://github.com/majestrate/i2p.i2p-bote/tree/gradle-fat
the problem is that it doesn't quite grab everything yet because of some i2p.i2p libs not being added right in the i2p.i2p subproject
I think it misses i2p.i2p's jetty-i2p.jar
at least.
That also generates fat JARs, not fat WARs, so it probably misses the JSP code too. But it's probably on the right track...
I think the full solution will be something along the lines of Gradle's EAR plugin: http://stackoverflow.com/questions/6337148/is-there-a-right-way-to-create-skinny-wars-and-an-ear-file-in-gradle
It sounds similar to what I'm doing already to build I2P plugins, so hopefully the Gradle logic in there will be useful.
eeh, this seems kinda complicated for me, can you provide instructions and/or script to do it automagically? because I have literally zero experience with tweaking Gradle.
@kisik21 it'll be added sooooon™
Done! It's now as simple as ./gradlew :webapp:tomcatRunWar
(after copying your I2P-Bote data directory into the webapp
folder).
I use i2pd as my router and I can't afford to launch another router to use Bote, can it be un-tethered from Java router and launched in separate Jetty instance, for example?
Where it all started