Application Plugin should work for web apps


(Phil Swenson) #1

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.


(james.r.carr) #2

Why not use the jetty plugin and just run jettyRun???


(james.r.carr) #3

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.


(Adam Murdoch) #4

An excellent idea.


(Stig Kleppe-Jørgensen) #5

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


(Phil Swenson) #6

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?


(Stig Kleppe-Jørgensen) #7

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?


(Phil Swenson) #8

yes, that was my question. Pretty awkward having to type in JVM settings every time IMO.


(Stig Kleppe-Jørgensen) #9

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?