jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x WAR Plugin
  • MWAR-30

I can't build a war-file without a web.xml.

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 2.1-alpha-2
  • Component/s: None
  • Labels:
    None

Description

I have a small webapp with a small number of jsps, to overlay on a larger webapp.
The larger webapp already has a web.xml and the small one doesn't need one.

I can't build a war of the small webapp, because the war-plugin requires a web.xml.

I realise that a war-file without a web.xml might not be considered a comple war-file, and i only need it to unzip on top of the larger webapp.

Maybe packaging the small webapp in a zip would be better?

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    MWAR-30.patch
    25/Jul/07 7:25 AM
    9 kB
    Denis Cabasson

Issue Links

duplicates

Bug - A problem which impairs or prevents the functions of the product. MWAR-53 WAR plugin does not allow for ignoring the web.xml file

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.
relates to

Bug - A problem which impairs or prevents the functions of the product. PLXCOMP-45 ignoreWebXML flag use is opposite of what the name implies.

  • Major - Major loss of function.
  • Open - The issue is open and ready for the assignee to start work on it.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Grzegorz Slowikowski added a comment - 05/Apr/06 11:01 AM

war plugin could generate empty web.aml if there is none in the sources.

Show
Grzegorz Slowikowski added a comment - 05/Apr/06 11:01 AM war plugin could generate empty web.aml if there is none in the sources.
Hide
Permalink
Christoffer Hammarström added a comment - 05/Apr/06 11:16 AM

An empty web.xml would overwrite an existing web.xml when unzipped over an existing webapp.

Show
Christoffer Hammarström added a comment - 05/Apr/06 11:16 AM An empty web.xml would overwrite an existing web.xml when unzipped over an existing webapp.
Hide
Permalink
Denis Cabasson added a comment - 15/Feb/07 9:40 AM

a war without a web.xml is definitly not a war.

I suggest you add an empty web.xml to your smaller war, and then configure the overlaying to keep the relevant web.xml.

Show
Denis Cabasson added a comment - 15/Feb/07 9:40 AM a war without a web.xml is definitly not a war. I suggest you add an empty web.xml to your smaller war, and then configure the overlaying to keep the relevant web.xml.
Hide
Permalink
lin sun added a comment - 05/Mar/07 10:46 PM

Actually, with Java EE5, web.xml is optional. For example, here is a link to Java EE5 intro:

Show
lin sun added a comment - 05/Mar/07 10:46 PM Actually, with Java EE5, web.xml is optional. For example, here is a link to Java EE5 intro:
Hide
Permalink
lin sun added a comment - 05/Mar/07 10:48 PM

Sorry, hit enter accidentally a min ago.

Actually, with Java EE5, web.xml is optional. For example, here is a link to Java EE5 intro:
b
http://java.sun.com/developer/technicalArticles/J2EE/intro_ee5/

and it says:

For example, a simple web application that provides a web service and an index page that describes the web service might contain only the following files:

  • index.jsp
  • image/logo.gif
  • WEB-INF/classes/MyWebService.class

No web.xml, webservices.xml, or Java API for XML-based RPC (JAX-RPC) files are required.

It would be great to implement this feature for everyone who uses maven to build war file for this new optional web.xml feature in Java EE 5. Thanks. Lin

Show
lin sun added a comment - 05/Mar/07 10:48 PM Sorry, hit enter accidentally a min ago. Actually, with Java EE5, web.xml is optional. For example, here is a link to Java EE5 intro: b http://java.sun.com/developer/technicalArticles/J2EE/intro_ee5/ and it says: For example, a simple web application that provides a web service and an index page that describes the web service might contain only the following files:
  • index.jsp
  • image/logo.gif
  • WEB-INF/classes/MyWebService.class
No web.xml, webservices.xml, or Java API for XML-based RPC (JAX-RPC) files are required. It would be great to implement this feature for everyone who uses maven to build war file for this new optional web.xml feature in Java EE 5. Thanks. Lin
Hide
Permalink
Petr Kozelka added a comment - 18/Jun/07 8:02 AM

Also when using war overlays, it makes pretty good sense to create a war without web.xml and add this file in an overlay.
I suggest at least to add configuration option allowing WARs without web.xml, defaulting to current behavior.

Show
Petr Kozelka added a comment - 18/Jun/07 8:02 AM Also when using war overlays, it makes pretty good sense to create a war without web.xml and add this file in an overlay. I suggest at least to add configuration option allowing WARs without web.xml, defaulting to current behavior.
Hide
Permalink
Denis Cabasson added a comment - 25/Jul/07 7:23 AM

Resolution of this issue should be kept in line with PLXCOMP-45

Show
Denis Cabasson added a comment - 25/Jul/07 7:23 AM Resolution of this issue should be kept in line with PLXCOMP-45
Hide
Permalink
Denis Cabasson added a comment - 25/Jul/07 7:25 AM

Following PLX-170 it is possible to create a war file with Plexus Archiver even without a web.xml file.

Provided patch adds a new property (failOnMissingWebXml) to allow for wars containing no web.xml file.

Added test cases for the property too.

Show
Denis Cabasson added a comment - 25/Jul/07 7:25 AM Following PLX-170 it is possible to create a war file with Plexus Archiver even without a web.xml file. Provided patch adds a new property (failOnMissingWebXml) to allow for wars containing no web.xml file. Added test cases for the property too.
Hide
Permalink
Stéphane Nicoll added a comment - 28/Oct/07 5:41 AM

Applied, thanks.

Show
Stéphane Nicoll added a comment - 28/Oct/07 5:41 AM Applied, thanks.
Hide
Permalink
Steve Mitchell added a comment - 12/Jun/09 2:55 PM - edited

Is this really fixed? Even using 2.1-beta-1 I still get:

Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)

Is another parmameter needed to turn off "update mode?" I am creating a partial WAR that will be exploded and merged with an existing WAR directory on a Tomcat "appliance." I don't want to take any chance of overwriting the Web.xml file of the target dir. I want to skip the manifest too, but didn't see any options to do that.

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1-beta-1</version>
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
<archiveClasses>true</archiveClasses>
<failonmissingwebxml>false</failonmissingwebxml>
</configuration>
</plugin>

Show
Steve Mitchell added a comment - 12/Jun/09 2:55 PM - edited Is this really fixed? Even using 2.1-beta-1 I still get: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) Is another parmameter needed to turn off "update mode?" I am creating a partial WAR that will be exploded and merged with an existing WAR directory on a Tomcat "appliance." I don't want to take any chance of overwriting the Web.xml file of the target dir. I want to skip the manifest too, but didn't see any options to do that. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1-beta-1</version> <configuration> <archive> <addMavenDescriptor>false</addMavenDescriptor> </archive> <archiveClasses>true</archiveClasses> <failonmissingwebxml>false</failonmissingwebxml> </configuration> </plugin>
Hide
Permalink
Steve Mitchell added a comment - 12/Jun/09 3:22 PM

The problem was I did have the right case in my tag. This worked.

<failOnMissingWebXml>false</failOnMissingWebXml>

Show
Steve Mitchell added a comment - 12/Jun/09 3:22 PM The problem was I did have the right case in my tag. This worked. <failOnMissingWebXml>false</failOnMissingWebXml>

People

  • Assignee:
    Stéphane Nicoll
    Reporter:
    Christoffer Hammarström
Vote (5)
Watch (4)

Dates

  • Created:
    05/Apr/06 10:32 AM
    Updated:
    12/Jun/09 3:22 PM
    Resolved:
    28/Oct/07 5:41 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.