You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "David Bernard (JIRA)" <ji...@codehaus.org> on 2009/01/08 08:49:19 UTC

[jira] Commented: (MWAR-158) Overlaying breaks configuration of webXml with a fatal error

    [ http://jira.codehaus.org/browse/MWAR-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=160339#action_160339 ] 

David Bernard commented on MWAR-158:
------------------------------------

The following seems to work as a workaround.  
The "overlay" is laid down first excluding web.xml and the web app is then overlayed on top.


          <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <webXml>${project.build.directory}/jspweb.xml</webXml>
                    <warName>${project.build.finalName}</warName>
                    <overlays>
                        <overlay>
                            <groupId>com.xxxx.core</groupId>
                            <artifactId>xxx-user</artifactId>
                            <type>war</type>
                            <excludes>
                                <exclude>WEB/web.xml</exclude>
                            </excludes>
                        </overlay>
                        <overlay>

                        </overlay>
                    </overlays>
                </configuration>
            </plugin>


> Overlaying breaks configuration of webXml with a fatal error
> ------------------------------------------------------------
>
>                 Key: MWAR-158
>                 URL: http://jira.codehaus.org/browse/MWAR-158
>             Project: Maven 2.x War Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1-alpha-1
>         Environment: Maven 2.0.9
> SuSE Linux 10.3
> java version "1.5.0_09"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b03)
> Java HotSpot(TM) Server VM (build 1.5.0_09-b03, mixed mode)
>            Reporter: Michael Heß
>            Priority: Critical
>         Attachments: webXmlBug.tar.gz
>
>
> When using overlays, it is no longer possible to use the webXml configuration value. The following exception is thrown:
> [INFO] [war:war]
> [INFO] Packaging webapp
> [INFO] Assembling webapp[webXmlBug] in [/home/mhe/workspace_spielwiese/webXmlBug/target/webXmlBug]
> [INFO] Processing war project
> OverlayPackagingTask performPackaging overlay.getTargetPath() null[INFO] Processing overlay[ id de.ordix.webXmlBug:overlay]
> [INFO] Unpacking overlay[ id de.ordix.webXmlBug:overlay]
> [INFO] Expanding: /home/mhe/.m2/repository/de/ordix/webXmlBug/overlay/1.0-SNAPSHOT/overlay-1.0-SNAPSHOT.war into /home/mhe/workspace_spielwiese/webXmlBug/target/war/work/de.ordix.webXmlBug/overlay
> [INFO] ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Should not happen, path[WEB-INF/web.xml] is flagged as being registered but was not found.
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.IllegalStateException: Should not happen, path[WEB-INF/web.xml] is flagged as being registered but was not found.
>         at org.apache.maven.plugin.war.util.WebappStructure.getOwner(WebappStructure.java:157)
>         at org.apache.maven.plugin.war.util.WebappStructure.registerFile(WebappStructure.java:105)
>         at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask.copyFile(AbstractWarPackagingTask.java:140)
> [...]
> I have attached a testcase, which reproduces the problem. Just build overlay and webXmlBug with "mvn clean install".
> (I know the testcase is synthetic. If you want a "real world" scenario, just replace the resources-copy step with e.g. jsp-precompiling.)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira