[ 
https://issues.apache.org/jira/browse/MTOMCAT-269?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Kopf updated MTOMCAT-269:
--------------------------------

    Description: 
While the default context file (/META-INF/context.xml) is respected for the 
project itself, it is ignored for the additional web apps.

{code:title=org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java 
line 1425|borderStyle=solid}
        for ( AbstractWebapp additionalWebapp : getAdditionalWebapps() )
        {
            String contextPath = additionalWebapp.getContextPath();
            if ( !contextPath.startsWith( "/" ) )
            {
                contextPath = "/" + contextPath;
            }
            addContextFromArtifact( container, contexts, getArtifact( 
additionalWebapp ), contextPath,
                                    additionalWebapp.getContextFile(), 
additionalWebapp.isAsWebapp() );
        }
{code}

Proposed fix:
{code:title=org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java 
Proposed fix|borderStyle=solid}
        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() 
);
        }
{code}

These might be a similar problem with tomcat6-maven-plugin

  was:
While the default context file (/META-INF/context.xml) is respected for the 
project itself, it is ignored for the additional web apps.

{code:title=org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java 
line 1425|borderStyle=solid}
        for ( AbstractWebapp additionalWebapp : getAdditionalWebapps() )
        {
            String contextPath = additionalWebapp.getContextPath();
            if ( !contextPath.startsWith( "/" ) )
            {
                contextPath = "/" + contextPath;
            }
            addContextFromArtifact( container, contexts, getArtifact( 
additionalWebapp ), contextPath,
                                    additionalWebapp.getContextFile(), 
additionalWebapp.isAsWebapp() );
        }
{code}

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


> 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.
> {code:title=org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java 
> line 1425|borderStyle=solid}
>         for ( AbstractWebapp additionalWebapp : getAdditionalWebapps() )
>         {
>             String contextPath = additionalWebapp.getContextPath();
>             if ( !contextPath.startsWith( "/" ) )
>             {
>                 contextPath = "/" + contextPath;
>             }
>             addContextFromArtifact( container, contexts, getArtifact( 
> additionalWebapp ), contextPath,
>                                     additionalWebapp.getContextFile(), 
> additionalWebapp.isAsWebapp() );
>         }
> {code}
> Proposed fix:
> {code:title=org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java 
> Proposed fix|borderStyle=solid}
>         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() );
>         }
> {code}
> These might be a similar problem with tomcat6-maven-plugin



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to