Stefan Kopf created MTOMCAT-269:
-----------------------------------
Summary: Context file of additional web apps is ignored
Key: MTOMCAT-269
URL: https://issues.apache.org/jira/browse/MTOMCAT-269
Project: Apache Tomcat Maven Plugin
Issue Type: Bug
Components: tomcat6, tomcat7
Affects Versions: 2.2
Reporter: Stefan Kopf
Assignee: Olivier Lamy (*$^¨%`£)
While the default context file (/META-INF/context.xml) is respected for the
project itself, it is ignored for the additional web apps.
In org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java line 1425:
for ( AbstractWebapp additionalWebapp : getAdditionalWebapps() )
{
String contextPath = additionalWebapp.getContextPath();
if ( !contextPath.startsWith( "/" ) )
{
contextPath = "/" + contextPath;
}
addContextFromArtifact( container, contexts, getArtifact(
additionalWebapp ), contextPath,
additionalWebapp.getContextFile(),
additionalWebapp.isAsWebapp() );
}
Proposed fix:
for ( AbstractWebapp additionalWebapp : getAdditionalWebapps() )
{
String contextPath = additionalWebapp.getContextPath();
if ( !contextPath.startsWith( "/" ) )
{
contextPath = "/" + contextPath;
}
String contextFile = null;
if(additionalWebapp.getContextFile() != null)
{
contextFile = additionalWebapp.getContextFile();
}
else
{
File defaultConfigFile = new File( configurationDir,
"webapps/"+artifact.getArtifactId()+"/META-INF/context.xml" );
if(defaultConfigFile.exists())
{
contextFile = defaultConfigFile.getAbsolutePath();
}
}
addContextFromArtifact( container, contexts, getArtifact(
additionalWebapp ), contextPath,
contextFile, additionalWebapp.isAsWebapp()
);
}
These might be a similar problem with tomcat6-maven-plugin
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]