Uploaded image for project: 'Gradle'
  1. Gradle
  2. GRADLE-2123

WTP Plugin should add org.eclipse.jst.component.dependency to all WEB-INF/lib deps and not add them to the WTP component file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 1.0-milestone-7, 1.0-milestone-8
    • Fix Version/s: 3.0-milestone-1, 3.0-rc-2

      Description

      Currently Gradle is generating classpath entries like this for JAR dependencies in the WAR:

      <classpathentry kind="lib" path="C:\Documents and Settings\it403\.gradle\caches\artifacts\ch.qos.logback\logback-core\ef28c670c723aafc18a1f247a00c89bb\jars\logback-core-0.9.29.jar" exported="true" />
      

      It should be generating:

      <classpathentry kind="lib" path="C:\Documents and Settings\it403\.gradle\caches\artifacts\ch.qos.logback\logback-core\ef28c670c723aafc18a1f247a00c89bb\jars\logback-core-0.9.29.jar" exported="true">
        <attributes>
          <attribute name="org.eclipse.jst.component.dependency" value="WEB-INF/lib"/>
        </attributes>
      </classpath>
      

      And once it starts using "org.eclipse.jst.component.dependency", the entries from the WTP component file should be removed. Without removing them the JARs may be included in the classloader twice when using a server within Eclipse.

      <dependent-module deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/C:\Documents and Settings\it403\.gradle\caches\artifacts\ch.qos.logback\logback-core\ef28c670c723aafc18a1f247a00c89bb\jars\logback-core-0.9.29.jar">
        <dependency-type>uses</dependency-type>
      </dependent-module>
      

      This seems related to a bunch of issues that have been reported (and some of them fixed before):
      http://issues.gradle.org/browse/GRADLE-1134
      http://issues.gradle.org/browse/GRADLE-1275
      http://issues.gradle.org/browse/GRADLE-1412
      http://issues.gradle.org/browse/GRADLE-1707

      This Maven issue was linked from one of them, which recommends the approach I documented above:
      http://jira.codehaus.org/browse/MECLIPSE-264

      Bear in mind that one difference in my use case is that we are using SelfResolvingDependencies. I don't know if these are handled differently in the WTP plugin than the module dependencies you would get from using a Maven/Ivy repo.

      Even if that is the issue, they should be handled consistently.

        Attachments

          Activity

            People

            Assignee:
            donat Donát Csikós
            Reporter:
            andrew.oberstar Andrew Oberstar
            Votes:
            5 Vote for this issue
            Watchers:
            14 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: