You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Andy Jefferson <an...@ajsoft.net> on 2003/07/17 21:00:34 UTC

WAR file naming

Its been raised as an issue by others but for a Maven newcomer, is there
any reason why the WAR file has a naming that omits the version and
hence is inconsistent with the JAR and EAR namings. In addition, it uses
the Ant task 'jar' instead of the Ant task 'war'.


-- 
Andy

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


Re: WAR file naming

Posted by Nathan Coast <na...@codeczar.com>.
I'm sure this was a requirement for the ear plugin to generate the 
application.xml, not sure if it was ever implemented.

James Ward wrote:

> Actually if you are packaging your war into an ear, you can specify the
> context, or if you have jboss you can put a jboss-web.xml in your
> WEB-INF and specify it there.  Regardless, the default behavior should
> be the same as the jar and ejb plugins where it is named with the
> version.  And of course there should be some way to override the name if
> you do not want to specifically set the war's context using one of the
> previously mentioned methods (or a different method).
> 
> -James
> 
> 
> On Thu, 2003-07-17 at 13:37, Michal Maczka wrote:
> 
>>>-----Original Message-----
>>>From: Andy Jefferson [mailto:andy@ajsoft.net]
>>>Sent: Thursday, July 17, 2003 9:01 PM
>>>To: Maven Users List
>>>Subject: WAR file naming
>>>
>>>
>>>Its been raised as an issue by others but for a Maven newcomer, is there
>>>any reason why the WAR file has a naming that omits the version and
>>>hence is inconsistent with the JAR and EAR namings.
>>
>>Yes. For many(all?) Servlet engines war file name = root context of the web
>>application.
>>That's why many users prefer to have an artifact which is ready to deploy.
>>
>>
>>>In addition, it uses
>>>the Ant task 'jar' instead of the Ant task 'war'.
>>>
>>
>>Basically war task is simple extension of jar task:
>>
>>http://cvs.apache.org/viewcvs/ant/src/main/org/apache/tools/ant/taskdefs/War
>>.java
>>
>>and really does nothing special but provides you some nested tags which help
>>you
>>to put together files from different locations into war file.
>>In maven this is already solved/configurable in different way
>>and processing without using war task seems to be simpler
>>(e.g. no warning is printed when WEB-INF folder contains web.xml file).
>>
>>
>>Michal
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>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: WAR file naming

Posted by Michal Maczka <mm...@cqs.ch>.
On Fri, 2003-07-18 at 09:07, Rafal Krzewski wrote:
> I'd vote for generating versioned war artifacts as a policy, and people
> who are too lazy to read their's servers docs can still make an
> unversioned copy of the war in their maven.xml
> 

Last time I changed the war plug-in so it started to produce versioned
wars, many people were "crying". So I quickly rolled back this
change....
Personally I am also for versioned wars. I don't also think 
that the name of the produced war should be configurable...


Michal


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


Re: WAR file naming

Posted by Rafal Krzewski <Ra...@caltha.pl>.
Andy Jefferson wrote:
>>>Actually if you are packaging your war into an ear, you can specify the
>>>context, or if you have jboss you can put a jboss-web.xml in your
>>>WEB-INF and specify it there.
>>
>>Can you do this with Tomact :P?

Setting the context name is trivial with Tomcat. In version 3.x you can
do it in the server.xml file, using <context> tag:

<context name="/foo" docBase="/some/path/foo.war"/>

In 4.1.x it's even easier, you don't need to fuss around wiht server.xml
Instead of dropping the war into $TOMCAT_HOME/webapps you put in a
a little xml file in there, containing the <context> tag only.

I don't know if maven j2ee support plugins provide war deployment goals,
but if so I imagine that this file could be generated on the fly, based
on the war's final name, TOMCAT_HOME and context name configured in
project.properties.

I'd vote for generating versioned war artifacts as a policy, and people
who are too lazy to read their's servers docs can still make an
unversioned copy of the war in their maven.xml

R.

PS. Now I recall that Tomcat 3.x also had some way of declaring contexts
outside server.xml, but the files were looked up in $TOMCAT_HOME/conf.
Don't remeber the syntax though.





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


RE: WAR file naming

Posted by Andy Jefferson <an...@ajsoft.net>.
> > Actually if you are packaging your war into an ear, you can specify the
> > context, or if you have jboss you can put a jboss-web.xml in your
> > WEB-INF and specify it there.
> 
> Can you do this with Tomact :P?

I've no idea what you can or can't do on Tomcat, but my experience of
servlet engines is that you can configure the servlet context for any
war passed in. PS. Tomcat can be used by JBoss, and JBoss manages to
pass it into the correct servlet context on Tomcat :P


> >Regardless, the default behavior should
> > be the same as the jar and ejb plugins where it is named with the
> > version.  And of course there should be some way to override the name if
> > you do not want to specifically set the war's context using one of the
> > previously mentioned methods (or a different method).
> >
> I see almost no reason why user would like to override war file name.
> If you have good reasons for that rise an issue in JIRA.
> (I myself believe that what is in POM is sufficient).
> 
> I think that Maven should be as strict with war file naming as it is with
> jars and do not let user override it.

Can't agree with you on that one. Consistency is consistency - and Maven
doesnt have it at present. Name the files in a consistent manner. If
your servlet engine really doesn't allow you to cope with a versioned
file then why not allow you the option of configuring the filename.


-- 
Andy

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


RE: WAR file naming

Posted by Michal Maczka <mm...@interia.pl>.

> -----Original Message-----
> From: James Ward [mailto:jamesw@ectropic.com]
> Sent: Thursday, July 17, 2003 9:50 PM
> To: Maven Users List
> Subject: RE: WAR file naming
>
>
> Actually if you are packaging your war into an ear, you can specify the
> context, or if you have jboss you can put a jboss-web.xml in your
> WEB-INF and specify it there.

Can you do this with Tomact :P?

>Regardless, the default behavior should
> be the same as the jar and ejb plugins where it is named with the
> version.  And of course there should be some way to override the name if
> you do not want to specifically set the war's context using one of the
> previously mentioned methods (or a different method).
>
I see almost no reason why user would like to override war file name.
If you have good reasons for that rise an issue in JIRA.
(I myself believe that what is in POM is sufficient).

I think that Maven should be as strict with war file naming as it is with
jars
and do not let user override it.

Note that when war is deployed/installed to repository the war file name
_always_ contains the version. IMHO communication between project
and artifact exchange via local repository is better practice,
then digging in folders of some other projects. So if you use repository you
have
versioned artifacts.
So e.g. when you are building your ear - and you want to use some war
created
by other subproject, you should take this artifact from repository.
And you do this by putting appropriate dependency into your POM.

Michal



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


RE: WAR file naming

Posted by Michal Maczka <mm...@interia.pl>.

> -----Original Message-----
> From: Vincent Massol [mailto:vmassol@pivolis.com]
> Sent: Monday, July 21, 2003 1:18 PM
> To: 'Maven Users List'
> Subject: RE: WAR file naming
>
>
>
>
> > -----Original Message-----
> > From: James Ward [mailto:jamesw@ectropic.com]
> > Sent: 17 July 2003 21:50
> > To: Maven Users List
> > Subject: RE: WAR file naming
> >
> > Actually if you are packaging your war into an ear, you can specify
> the
> > context, or if you have jboss you can put a jboss-web.xml in your
> > WEB-INF and specify it there.  Regardless, the default behavior should
> > be the same as the jar and ejb plugins where it is named with the
> > version.
>
> +1
>

I am also +1 to change it.
Last time I changed it I was asked on the mailing list to change it back....

If nobody from committers has something against I would like to change
a value of property maven.war.final.name
from: ${pom.artifactId}}.war
to:    ${maven.final.name}.war



Michal



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


RE: WAR file naming

Posted by Vincent Massol <vm...@pivolis.com>.

> -----Original Message-----
> From: James Ward [mailto:jamesw@ectropic.com]
> Sent: 17 July 2003 21:50
> To: Maven Users List
> Subject: RE: WAR file naming
> 
> Actually if you are packaging your war into an ear, you can specify
the
> context, or if you have jboss you can put a jboss-web.xml in your
> WEB-INF and specify it there.  Regardless, the default behavior should
> be the same as the jar and ejb plugins where it is named with the
> version.  

+1

> And of course there should be some way to override the name if
> you do not want to specifically set the war's context using one of the
> previously mentioned methods (or a different method).
> 
> -James
> 
> 
> On Thu, 2003-07-17 at 13:37, Michal Maczka wrote:
> > > -----Original Message-----
> > > From: Andy Jefferson [mailto:andy@ajsoft.net]
> > > Sent: Thursday, July 17, 2003 9:01 PM
> > > To: Maven Users List
> > > Subject: WAR file naming
> > >
> > >
> > > Its been raised as an issue by others but for a Maven newcomer, is
> there
> > > any reason why the WAR file has a naming that omits the version
and
> > > hence is inconsistent with the JAR and EAR namings.
> >
> > Yes. For many(all?) Servlet engines war file name = root context of
the
> web
> > application.
> > That's why many users prefer to have an artifact which is ready to
> deploy.
> >
> > > In addition, it uses
> > > the Ant task 'jar' instead of the Ant task 'war'.
> > >
> >
> > Basically war task is simple extension of jar task:
> >
> >
>
http://cvs.apache.org/viewcvs/ant/src/main/org/apache/tools/ant/taskdefs
/W
> ar
> > .java
> >
> > and really does nothing special but provides you some nested tags
which
> help
> > you
> > to put together files from different locations into war file.
> > In maven this is already solved/configurable in different way
> > and processing without using war task seems to be simpler
> > (e.g. no warning is printed when WEB-INF folder contains web.xml
file).
> >
> >
> > Michal
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
---------------------------------------------------------------------
> > 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: WAR file naming

Posted by James Ward <ja...@ectropic.com>.
Actually if you are packaging your war into an ear, you can specify the
context, or if you have jboss you can put a jboss-web.xml in your
WEB-INF and specify it there.  Regardless, the default behavior should
be the same as the jar and ejb plugins where it is named with the
version.  And of course there should be some way to override the name if
you do not want to specifically set the war's context using one of the
previously mentioned methods (or a different method).

-James


On Thu, 2003-07-17 at 13:37, Michal Maczka wrote:
> > -----Original Message-----
> > From: Andy Jefferson [mailto:andy@ajsoft.net]
> > Sent: Thursday, July 17, 2003 9:01 PM
> > To: Maven Users List
> > Subject: WAR file naming
> >
> >
> > Its been raised as an issue by others but for a Maven newcomer, is there
> > any reason why the WAR file has a naming that omits the version and
> > hence is inconsistent with the JAR and EAR namings.
> 
> Yes. For many(all?) Servlet engines war file name = root context of the web
> application.
> That's why many users prefer to have an artifact which is ready to deploy.
> 
> > In addition, it uses
> > the Ant task 'jar' instead of the Ant task 'war'.
> >
> 
> Basically war task is simple extension of jar task:
> 
> http://cvs.apache.org/viewcvs/ant/src/main/org/apache/tools/ant/taskdefs/War
> .java
> 
> and really does nothing special but provides you some nested tags which help
> you
> to put together files from different locations into war file.
> In maven this is already solved/configurable in different way
> and processing without using war task seems to be simpler
> (e.g. no warning is printed when WEB-INF folder contains web.xml file).
> 
> 
> Michal
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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: WAR file naming

Posted by Michal Maczka <mm...@interia.pl>.

> -----Original Message-----
> From: Andy Jefferson [mailto:andy@ajsoft.net]
> Sent: Thursday, July 17, 2003 9:01 PM
> To: Maven Users List
> Subject: WAR file naming
>
>
> Its been raised as an issue by others but for a Maven newcomer, is there
> any reason why the WAR file has a naming that omits the version and
> hence is inconsistent with the JAR and EAR namings.

Yes. For many(all?) Servlet engines war file name = root context of the web
application.
That's why many users prefer to have an artifact which is ready to deploy.

> In addition, it uses
> the Ant task 'jar' instead of the Ant task 'war'.
>

Basically war task is simple extension of jar task:

http://cvs.apache.org/viewcvs/ant/src/main/org/apache/tools/ant/taskdefs/War
.java

and really does nothing special but provides you some nested tags which help
you
to put together files from different locations into war file.
In maven this is already solved/configurable in different way
and processing without using war task seems to be simpler
(e.g. no warning is printed when WEB-INF folder contains web.xml file).


Michal












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