Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0-beta-1
    • Component/s: None
    • Labels:
      None

      Description

      Need to support context.xml for environment properties such as JNDI etc.

        Activity

        Hide
        Mark Thomas added a comment -

        Doesn't this already work.

        You can put a context.xml file in /WEB-INF/META-INF

        This works file for me.

        Show
        Mark Thomas added a comment - Doesn't this already work. You can put a context.xml file in /WEB-INF/META-INF This works file for me.
        Hide
        Mark Thomas added a comment -

        In your asnwer, which of the following are you referring to?

        Do you mean:

        [webapp]/WEB-INF/context.xml
        [webapp]/WEB-INF/META-INF/context.xml
        [webapp]/META-INF/context.xml

        ...because this doesn't work for me either.

        Show
        Mark Thomas added a comment - In your asnwer, which of the following are you referring to? Do you mean: [webapp] /WEB-INF/context.xml [webapp] /WEB-INF/META-INF/context.xml [webapp] /META-INF/context.xml ...because this doesn't work for me either.
        Hide
        Mark Thomas added a comment -

        According to the docs:
        http://mojo.codehaus.org/tomcat-maven-plugin/deployment.html

        It should be here:
        src/main/webapp/META-INF/context.xml

        However, it fails to work with:
        mvn tomcat:run

        If I use:
        mvn package
        and deploy the war file to a standalone tomcat server. That works.

        Looking in "target/tomcat/conf/" shows that the context file is not being deployed during the tomcat:run task.

        Show
        Mark Thomas added a comment - According to the docs: http://mojo.codehaus.org/tomcat-maven-plugin/deployment.html It should be here: src/main/webapp/META-INF/context.xml However, it fails to work with: mvn tomcat:run If I use: mvn package and deploy the war file to a standalone tomcat server. That works. Looking in "target/tomcat/conf/" shows that the context file is not being deployed during the tomcat:run task.
        Hide
        Mark Thomas added a comment -

        This patch adds support for using "context.xml".

        Note: It only works when running "mvn tomcat:run-war"
        It will not work for "mvn tomcat:run" unless "contextFile" is set in the pom configuration.

        Show
        Mark Thomas added a comment - This patch adds support for using "context.xml". Note: It only works when running "mvn tomcat:run-war" It will not work for "mvn tomcat:run" unless "contextFile" is set in the pom configuration.
        Hide
        Mark Thomas added a comment -

        Added documentation for the feature.
        This patch should be used instead of the one I submitted earlier.

        Show
        Mark Thomas added a comment - Added documentation for the feature. This patch should be used instead of the one I submitted earlier.
        Hide
        Mark Thomas added a comment -

        Thanks for the patch, although I ended up implementing this by configuring the context directly. META-INF/context.xml is now picked up for both tomcat:run and tomcat:run-war.

        Show
        Mark Thomas added a comment - Thanks for the patch, although I ended up implementing this by configuring the context directly. META-INF/context.xml is now picked up for both tomcat:run and tomcat:run-war.
        Hide
        Mark Thomas added a comment -

        Is there a way i can get a version of the plugin with this patch applied without having to compile ?

        Show
        Mark Thomas added a comment - Is there a way i can get a version of the plugin with this patch applied without having to compile ?
        Hide
        Mark Thomas added a comment -

        I'd like to see another release of the plugin soon, but in the meantime I've deployed a snapshot:
        http://snapshots.repository.codehaus.org/org/codehaus/mojo/tomcat-maven-plugin/1.0-alpha-2-SNAPSHOT/

        Show
        Mark Thomas added a comment - I'd like to see another release of the plugin soon, but in the meantime I've deployed a snapshot: http://snapshots.repository.codehaus.org/org/codehaus/mojo/tomcat-maven-plugin/1.0-alpha-2-SNAPSHOT/
        Hide
        Mark Thomas added a comment -

        The 1.0-alpha-2-SNAPSHOT version uses <artifactId> as context root, not <build><finalName> like earlier version.
        So I first thought it didn't work..
        But it did, and it picks up src/main/webapp/META-INF/context.xml without any additional configuration.
        Finally able to run 'mvn tomcat:run' with a datasource

        Show
        Mark Thomas added a comment - The 1.0-alpha-2-SNAPSHOT version uses <artifactId> as context root, not <build><finalName> like earlier version. So I first thought it didn't work.. But it did, and it picks up src/main/webapp/META-INF/context.xml without any additional configuration. Finally able to run 'mvn tomcat:run' with a datasource
        Hide
        Mark Thomas added a comment -

        reopen to set fixed version

        Show
        Mark Thomas added a comment - reopen to set fixed version

          People

          • Assignee:
            Mark Hobson
            Reporter:
            Mark Hobson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Due:
              Created:
              Updated:
              Resolved:

              Development