I think it should be possible to use the application plugin to setup an executable web application in the container. This means the application plugin “run” task would download/install the specified container and launch it with the built war file.
the install feature would also package up the web container along with the war file and be executable on unzip.
Why not use the jetty plugin and just run jettyRun???
Nevermind, I see what you mean… the packaged artifact actually runs in a standalone web container, much like artifactory does when you download and run it.
One can also turn this idea inside out, that is, embedding the container inside the application.
This is for example what Jenkins does. It is a war that can be deployed to a container like a normal war or it can be started from the command line like this:
java -jar jenkins.war
There is a gradle plugin doing this already: https://github.com/mkrabset/gradle-execwar-plugin
I like Stig’s idea as well. I’m not sure of pros and cons on this, but it’s a really good idea.
Stig, do you have to specify an -Xmx on this?
If you need more memory than what running java without this option gives you, yes. Just like all java apps. When using the -jar option, VM-options like -Xmx must come first, like this:
java -Xmx1024m -jar webapp.war
Or did I not understand your question?
yes, that was my question. Pretty awkward having to type in JVM settings every time IMO.
So, what you are missing is the automatically generated startup scripts which you get when using the application plugin? Could you create an issue for this?