You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by pa...@kuruma.co.uk on 2014/02/28 11:38:00 UTC

Deploying web apps from war file using different url path

I am trying to work out how I can build my war file and then deploy it
using a different path. I have looked at the tomcat docs (specifically):

The locations for Context Descriptors are:
1.	$CATALINA_BASE/conf/[enginename]/[hostname]/[webappname].xml

I want to be able to build a war file with a name like
myapp-0.0.1-SNAPSHOT.war and deploy this without having to put
myapp-0.0.1-SNAPSHOT into the URL but I also don’t really want to have to
change the name of the context file every time I release a new version to
tomcat.

On  a separate note deploying my warfile and adding a context to
tomcat\conf\catalina\localhost\myapp-0.0.1-SNAPSHOT.xml the tomcat logs
tell me the context is being used but it ignores my path setting and uses
myapp-0.0.1-SNAPSHOT which gives me a 404 error for the url I really want:

<Context crossContext="true" path="/myapp" reloadable="true">
</Context>

Any help is appreciated as I don’t want to have to set a final name of
myapp for the generated war file.

Is there a way to redefine the web app path from within the war file so it
always deploys with the build and tomcat uses this instead of the name of
the warfile\webapp and there is no changes to the tomcat configuration?

Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Deploying web apps from war file using different url path

Posted by pa...@kuruma.co.uk.
Thanks for that, I changed my pom file finalName to look like:

<finalName>myApp##${version}</finalName>

This is exactly what I wanted and now my web app in the url is just myApp.

On Fri, February 28, 2014 2:56 am, Mark Thomas wrote:

> On 28/02/2014 10:38, paul@kuruma.co.uk wrote:
>
>> Is there a way to redefine the web app path from within the war file so
>> it always deploys with the build and tomcat uses this instead of the
>> name of the warfile\webapp and there is no changes to the tomcat
>> configuration?
>
> Use the version marker. i.e.:
> myapp##0.0.1-SNAPSHOT.war
>
> Mark
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Deploying web apps from war file using different url path

Posted by Mark Thomas <ma...@apache.org>.
On 28/02/2014 10:38, paul@kuruma.co.uk wrote:
> Is there a way to redefine the web app path from within the war file so it
> always deploys with the build and tomcat uses this instead of the name of
> the warfile\webapp and there is no changes to the tomcat configuration?

Use the version marker. i.e.:
myapp##0.0.1-SNAPSHOT.war

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org