You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ron Wheeler <rw...@artifact-software.com> on 2010/08/23 20:42:01 UTC

deploying WAR files to Tomcat

  This is a bit on the edge of Tomcat and Maven but I am hoping that 
there is a Maven solution or some little trick that makes the problem go 
away.

Our LMS portal consists of 60 separate modules that we build using 
Maven. About  45 are webapps that we need to deploy to make a new 
release. Another 10 or so are libraries that get deployed to the 
sharable lib folder n Tomcat.

When we build them with Maven, we get a nice xyz-1.9.1.war file but we 
can't (or do not know how to) deploy it with the version number intact 
and still have it run. Tomcat includes the version in the deployed 
webapp which screws up names of things.

The lib files don't care about names.

We have solved this with an Ant script that strips off the version 
number to give us xyz.war.

What is the "Best Practice" solution  to this.

We still end up with a bunch of war files that are not deployed to Nexus 
since Maven deploys the xyz-1.9.1.war file.


Ron

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


RE: deploying WAR files to Tomcat

Posted by "Haszlakiewicz, Eric" <EH...@transunion.com>.
>-----Original Message-----
>From: Ron Wheeler [mailto:rwheeler@artifact-software.com]
>
>  This is a bit on the edge of Tomcat and Maven but I am hoping that
>there is a Maven solution or some little trick that makes the problem
go
>away.
>
>Our LMS portal consists of 60 separate modules that we build using
>Maven. About  45 are webapps that we need to deploy to make a new
>release. Another 10 or so are libraries that get deployed to the
>sharable lib folder n Tomcat.
>
>When we build them with Maven, we get a nice xyz-1.9.1.war file but we
>can't (or do not know how to) deploy it with the version number intact
>and still have it run. Tomcat includes the version in the deployed
>webapp which screws up names of things.
>
>The lib files don't care about names.
>
>We have solved this with an Ant script that strips off the version
>number to give us xyz.war.

If you're using an ant script, you can use the tasks included with
tomcat to deploy things with whatever name you want.  Try looking at the
instructions on this page:
http://raibledesigns.com/wiki/Wiki.jsp?page=TomcatAntTasks (there are
many others on the web too)

If you don't need something quite so automated, you can also use the
"deploy war file located on server" portion of the tomcat manager
webapp, and specify whatever context path you need.

However, if you're using maven's tomcat-maven-plugin, you might want to
examine the "path" parameter on
http://mojo.codehaus.org/tomcat-maven-plugin/deploy-mojo.html

eric


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


Re: deploying WAR files to Tomcat

Posted by Ron Wheeler <rw...@artifact-software.com>.
  On 23/08/2010 4:09 PM, Justin Edelson wrote:
> On 8/23/10 2:42 PM, Ron Wheeler wrote:
>>   This is a bit on the edge of Tomcat and Maven but I am hoping that
>> there is a Maven solution or some little trick that makes the problem go
>> away.
>>
>> Our LMS portal consists of 60 separate modules that we build using
>> Maven. About  45 are webapps that we need to deploy to make a new
>> release. Another 10 or so are libraries that get deployed to the
>> sharable lib folder n Tomcat.
>>
>> When we build them with Maven, we get a nice xyz-1.9.1.war file but we
>> can't (or do not know how to) deploy it with the version number intact
>> and still have it run. Tomcat includes the version in the deployed
>> webapp which screws up names of things.
> You mean that Tomcat includes the version in the context path? That
> should be easy to change with a context.xml file. Not sure if this fixes
> your whole problem, but I think it's a Tomcat/J2EE "best practice" to
> not depend upon the container's default context path and always try to
> specify it yourself.
>

The version number is not on the file since we are manually removing it.
I may have misspoke above. It may be Jetspeed that has the problem.

We have added information to the MANIFEST.MF that identifies the version 
so we can track versions so we just need to get the version off the war 
file to ease our manual labour.

> Justin
>
>
>> The lib files don't care about names.
>>
>> We have solved this with an Ant script that strips off the version
>> number to give us xyz.war.
>>
>> What is the "Best Practice" solution  to this.
>>
>> We still end up with a bunch of war files that are not deployed to Nexus
>> since Maven deploys the xyz-1.9.1.war file.
>>
>>
>> Ron
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


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


Re: deploying WAR files to Tomcat

Posted by Justin Edelson <ju...@gmail.com>.
On 8/23/10 2:42 PM, Ron Wheeler wrote:
>  This is a bit on the edge of Tomcat and Maven but I am hoping that
> there is a Maven solution or some little trick that makes the problem go
> away.
> 
> Our LMS portal consists of 60 separate modules that we build using
> Maven. About  45 are webapps that we need to deploy to make a new
> release. Another 10 or so are libraries that get deployed to the
> sharable lib folder n Tomcat.
> 
> When we build them with Maven, we get a nice xyz-1.9.1.war file but we
> can't (or do not know how to) deploy it with the version number intact
> and still have it run. Tomcat includes the version in the deployed
> webapp which screws up names of things.

You mean that Tomcat includes the version in the context path? That
should be easy to change with a context.xml file. Not sure if this fixes
your whole problem, but I think it's a Tomcat/J2EE "best practice" to
not depend upon the container's default context path and always try to
specify it yourself.

Justin


> 
> The lib files don't care about names.
> 
> We have solved this with an Ant script that strips off the version
> number to give us xyz.war.
> 
> What is the "Best Practice" solution  to this.
> 
> We still end up with a bunch of war files that are not deployed to Nexus
> since Maven deploys the xyz-1.9.1.war file.
> 
> 
> Ron
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


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


Re: deploying WAR files to Tomcat

Posted by Benson Margulies <bi...@gmail.com>.
<finalName> in your POM can be used to get a plainly-named version in
the target directory.

The maven assembly plugin could be use to collect all the war files
into a directory or tarball with their names changed following a
pattern.

the dependency plugin could be used to fetch them with their names changed.


On Mon, Aug 23, 2010 at 2:42 PM, Ron Wheeler
<rw...@artifact-software.com> wrote:
>  This is a bit on the edge of Tomcat and Maven but I am hoping that there is
> a Maven solution or some little trick that makes the problem go away.
>
> Our LMS portal consists of 60 separate modules that we build using Maven.
> About  45 are webapps that we need to deploy to make a new release. Another
> 10 or so are libraries that get deployed to the sharable lib folder n
> Tomcat.
>
> When we build them with Maven, we get a nice xyz-1.9.1.war file but we can't
> (or do not know how to) deploy it with the version number intact and still
> have it run. Tomcat includes the version in the deployed webapp which screws
> up names of things.
>
> The lib files don't care about names.
>
> We have solved this with an Ant script that strips off the version number to
> give us xyz.war.
>
> What is the "Best Practice" solution  to this.
>
> We still end up with a bunch of war files that are not deployed to Nexus
> since Maven deploys the xyz-1.9.1.war file.
>
>
> Ron
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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