Apache Tomcat Maven Plugin
  1. Apache Tomcat Maven Plugin
  2. MTOMCAT-46

Plugins tomcat:run and tomcat:run-war are not loading the Provided and Runtime dependencies.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.0-beta-1
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      User Story: Developers checkout a Web Application from our SCM Repository(SVN) and through the tomcat:run (or tomcat:run-war) plugin can bootstrap and start a Tomcat Server and test the Web Application locally without even having Tomcat instances previously deployed either locally or remotely.

      To fulfill such User Story I started with the tomcat:run plugin but had issues with the Provided and Runtime dependencies. I then jumped to the tomcat:run-war using my own tomcat configuration files but had similar issues. I see that the tomcat:run-war plugin doesn't create a ClassLoader for the Catalina container in a similar way Tomcat's Bootstrap class does. I downloaded the code of the tomcat plugin and I am working in the fix but I need to share some thoughts about this...

      Approach A) Use a similar schema as the Tomcat Bootstrap in the Run*Mojos, let the developer provide those dependencies through the dependency:copy-dependencies to lets say target/tomcat/lib and load them from there. So the User controls what is deployed in lib.

      Approach B) Use a similar schema as the Tomcat Bootstrap in the Run*Mojos, the dependencies will be fetched using the dependencies defined in the pom.xml file (including transitive dependency resolution) and added to the ClassLoader.

      Thoughts and ideas are welcomed.

        Issue Links

          Activity

          Hide
          Mark Thomas added a comment -

          you mean included by example servlet-api because it's provided ?
          Not agree on this !! Fix the pom and everything will be fine !

          Show
          Mark Thomas added a comment - you mean included by example servlet-api because it's provided ? Not agree on this !! Fix the pom and everything will be fine !
          Hide
          Mark Thomas added a comment -

          Not exactly. I have a hierarchical structure of Parent-Child POMs and I am enforcing versions and scopes of dependencies through the parent POMs. ie. In a parent POM I have a specific version of the org.springframework components among others and I am enforcing the version ans scope in the parent.

          Show
          Mark Thomas added a comment - Not exactly. I have a hierarchical structure of Parent-Child POMs and I am enforcing versions and scopes of dependencies through the parent POMs. ie. In a parent POM I have a specific version of the org.springframework components among others and I am enforcing the version ans scope in the parent.
          Hide
          Ludwig Magnusson added a comment -

          I encountered this error as well when I had a multi module project and my war project had a runtime dependency to another module. The dependency was not included when executing tomcat:run which it should be, they are included in the packaging right? Although I agree that provided scope dependencies should not be included.

          Show
          Ludwig Magnusson added a comment - I encountered this error as well when I had a multi module project and my war project had a runtime dependency to another module. The dependency was not included when executing tomcat:run which it should be, they are included in the packaging right? Although I agree that provided scope dependencies should not be included.
          Hide
          Olivier Lamy (*$^¨%`£) added a comment -
          Show
          Olivier Lamy (*$^¨%`£) added a comment - see MTOMCAT-206

            People

            • Assignee:
              Olivier Lamy (*$^¨%`£)
              Reporter:
              Bernardo Gomez Palacio
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development