Maven 2.x WAR Plugin

Rename containerConfigXML if it does not match context.xml

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 2.1-beta-1
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Maven 2.0.10, JDK6, XP SP3
  • Number of attachments :
    1

Description

I ran into some problems with this plugin in use with profiles. I deploy different context.xml files. So I made up some names like:

remote-context.xml and set <containerConfigXML>src/main/conf/remote-context.xml </containerConfigXML> but when I run the package phase the file is copied as is and is not renamed to context.xml. Which of course makes no sense without renaming.

Files should be renamed if necessary.

Activity

Hide
Tom added a comment -

I can confirm this on:

  • Apache Maven 2.2.1 (r801777; 2009-08-06 22:16:01+0300)
  • Java version: 1.6.0_15
  • OS name: "linux" version: "2.6.31-15-generic" arch: "amd64" Family: "unix"

Besides not working in profiles, it does not work in when put in build > plugins > plugin, too.

Show
Tom added a comment - I can confirm this on:
  • Apache Maven 2.2.1 (r801777; 2009-08-06 22:16:01+0300)
  • Java version: 1.6.0_15
  • OS name: "linux" version: "2.6.31-15-generic" arch: "amd64" Family: "unix"
Besides not working in profiles, it does not work in when put in build > plugins > plugin, too.
Hide
Dennis Lundberg added a comment -

Confirmed with this sample project.

Show
Dennis Lundberg added a comment - Confirmed with this sample project.
Hide
Dennis Lundberg added a comment -

Having thought some more about this, isn't "context.xml" a Tomcat specific name. IIRC there is no such thing in the Servlet spec. So the name of the file is different for different Servlet Containers. To accommodate your request we would need another parameter "containerConfigXMLOutputName", that can be set to "context.xml" for Tomcat specific projects. The default value should be to use the same name as the input, i.e. the current behavior.

Show
Dennis Lundberg added a comment - Having thought some more about this, isn't "context.xml" a Tomcat specific name. IIRC there is no such thing in the Servlet spec. So the name of the file is different for different Servlet Containers. To accommodate your request we would need another parameter "containerConfigXMLOutputName", that can be set to "context.xml" for Tomcat specific projects. The default value should be to use the same name as the input, i.e. the current behavior.
Hide
Michael Osipov added a comment -

Dennis, your assumption is correct. "context.xml" is Tomcat-specific. Jetty handles this completely different (http://docs.codehaus.org/display/JETTY/ContextDeployer). However, I think that all app servers which use Tomcat as servlet container use the context.xml too. The param you suggest would be a whise step.

Show
Michael Osipov added a comment - Dennis, your assumption is correct. "context.xml" is Tomcat-specific. Jetty handles this completely different (http://docs.codehaus.org/display/JETTY/ContextDeployer). However, I think that all app servers which use Tomcat as servlet container use the context.xml too. The param you suggest would be a whise step.
Hide
Dennis Lundberg added a comment -

Here's a suggestion for a work-around until this issues can be solved.

Put our context.xml files in different directories which all contains a file named context.xml. So instead of doing

<containerConfigXML>src/main/conf/remote-context.xml</containerConfigXML>

you'd do

<containerConfigXML>src/main/conf-remote/context.xml</containerConfigXML>
Show
Dennis Lundberg added a comment - Here's a suggestion for a work-around until this issues can be solved. Put our context.xml files in different directories which all contains a file named context.xml. So instead of doing
<containerConfigXML>src/main/conf/remote-context.xml</containerConfigXML>
you'd do
<containerConfigXML>src/main/conf-remote/context.xml</containerConfigXML>
Hide
Michael Osipov added a comment -

Dennis,

this is exactly what I did when the problem came up.

Show
Michael Osipov added a comment - Dennis, this is exactly what I did when the problem came up.
Hide
Dennis Lundberg added a comment -

With a functioning work-around, I'm lowering the priority from critical to major.

Show
Dennis Lundberg added a comment - With a functioning work-around, I'm lowering the priority from critical to major.

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated: