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

EclipsePlugin does not properly support WTP project dependencies

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 0.9
    • Fix Version/s: 1.0-milestone-1

      Description

      Gradle's support for generating Eclipse project files does not cover all cases for WTP (Web Tools Platform).

      • All Java projects which a Dynamic Web Project depends must be configured as with the WTP Utility facet. This includes
        • Adding the jst.utility facet to the org.eclipse.wst.common.project.facet.core.xml file.
        • Adding the following natures to the .project file: org.eclipse.wst.common.project.facet.core.nature, org.eclipse.jem.workbench.JavaEMFNature, org.eclipse.wst.common.modulecore.ModuleCoreNature.
        • Adding the following builders to the .project file: org.eclipse.wst.common.project.facet.core.builder, org.eclipse.wst.validation.validationbuilder.
        • An org.eclipse.wst.common.component file must be added
      • Each 1st level JAR dependency of each Utility project must be flagged as a runtime dependency. This is accomplished by adding the org.eclipse.jst.component.dependency attribute to the appropriate classpathentry in the .classpath file.
      • Each project dependency (both 1st level and transitive) of a Dynamic Web Project must be adding as a runtime dependency. This is accomplished by adding an entry to the org.eclipse.wst.common.component file in the web project.

      I have attached a very simple multi-module project which demonstrates the proper Eclipse files. The sample project contains the TestWeb Dynamic Web project which depends directly on the TestModuleA Utility project. The TestModuleA Utility project depends on the TestModuleB Utility project. Both TestModuleA and TestModuleB each have one JAR dependency. The result of deploying or exporting the WAR file from Eclipse should result in the following contents:

      META-INF/MANIFEST.MF
      WEB-INF/lib/TestModuleA.jar
      WEB-INF/lib/TestModuleB.jar
      WEB-INF/lib/commons-collections-3.2.jar
      WEB-INF/lib/commons-lang-2.5.jar

        Attachments

        1. Eclipse-Screenshots.zip
          318 kB
        2. test.zip
          6 kB
        3. test-v2.zip
          13 kB
        4. UtilityModulesWorkaround.txt
          0.6 kB
        5. UtilityModulesWorkaround-v2.txt
          0.9 kB
        6. WebModulesWorkaround.txt
          0.8 kB
        7. wtp-fix.gradle
          2 kB

          Activity

            People

            Assignee:
            pniederw Peter Niederwieser
            Reporter:
            mraccola Matt Accola
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: