So, what I want to do is configure maven plugin jetty to run multiple – in my case two – instances of jetty server on different ports and with different apps.
So, I want to have something like:
localhost:8080/webapp1
localhost:8081/webapp2
And I want to do this with one single command: mvn jetty:run
which of course means that I have to configure it in pom.xml
I already have two different jetty config files: jettyA.xml and jettyB.xml in which there are different connectors defined.
The problem is just i can’t figure it out how to do this with one pom.xml
I tried with two profiles but is somehow did not work.
Just jetty in the last profile mentioned was started.
Replace the port number in pom.xml by a property variable like this:
Then run maven using the following command:
To define a default port numer, add this default property to your pom file:
If you need any more advanced method for determining the port number, you will need to embed jetty in your main class.