How can I change the ContextRoot that Maven Glassfish Plugin deploys to?

Go To


I'm deploying a webapp (WebApp.war, say) using the Maven Glassfish Plugin. Rather than it being deployed to http://localhost/WebApp I want it to be deployed to http://localhost/AnotherName - that is, I want to change the context root it's deployed to. I can't work out how to do this with the plugin, is it an option?

2009-06-16 10:25
by mtrc


Context Root is defined by XML files in the WAR. Check the sun-web.xml, which should define this.

2009-06-16 15:21
by mtrc


When you are using Netbeans you can select the context root under the project properties/run. When you deploy it via Glassfish admin you can enter it there.

2010-11-03 14:27
by Albert