2

I've just started using cargo-maven2-plugin to merge WAR artifacts during build process and I encountered problem with uberwar mojo. Merging works fine but resulting web.xml file contains extra "xmlns" attributes that cause error when deploying on Jboss.

For example original context-param element looks like this:

<context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>/WEB-INF/config/web-application-config.xml</param-value>
</context-param>

and after merging it has extra "xmlns" attribute:

<context-param xmlns="">
  <param-name>contextConfigLocation</param-name>
  <param-value>/WEB-INF/config/web-application-config.xml</param-value>
</context-param>

I have found the following Jira issue but suggested solution is not clear to me: http://jira.codehaus.org/browse/CARGO-639

Anybody faced similar problem and could share the solution? If you use other tools (that work) to merge WARs please let me know.

My configuration is: Mac OS X

Java 1.6

Maven 2.1

cargo-maven2-plugin 1.1.0-SNAPSHOT

Servlets spec 2.5 (web.xml)

misiekmw
  • 21
  • 3
  • Do the web.xml's from both WAR's have the DOCTYPE declaration? If not, try adding it to both and re-try. – Neel Jan 05 '15 at 17:39

1 Answers1

0

We had issues using cargo uberwar feature since we not only had common xml files, but also property files.

We overcame the issue (albeit in an ugly way) using war overlay. We ensured that the master war file had the superset of configurations that we wanted in the application.

Raghuram
  • 51,854
  • 11
  • 110
  • 122