Maven Eclipse Plugin
  1. Maven Eclipse Plugin
  2. MECLIPSE-184

Ear utility-jar are put in WEB-INF/lib of the wtp ear

    Details

    • Type: Improvement Improvement
    • Status: Open Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 2.3
    • Fix Version/s: None
    • Component/s: WTP support
    • Labels:
      None
    • Environment:
      Tested on Windows XP and Linux Ubuntu Dapper Drake
    • Number of attachments :
      0

      Description

      It seems that the maven eclipse plugin add ear jar dependencies in the
      WEB-INF/lib directory.

      I've used the following command : mvn eclipse:clean
      eclipse:eclipse -Dwtpversion=1.0 (I've also tried 1.5 with the snapshot
      version)

      And when deploy the ear project through WTP in a J2EE Server I see the
      following structure :

      my-ear
        |---- my-ejb.jar
        |---- my-webapp.war
        |---- META-INF/
                      |---- application.xml
                      |---- MANIFEST.MF
        |
        |----- WEB-INF/
                      |---- lib
                              |---- dependency-1.jar
                              |---- dependency-2.jar

      But I don't expect these dependencies to be here, I expect something like
      this :

      my-ear
        |---- my-ejb.jar
        |---- my-webapp.war
        |---- META-INF/
                      |---- application.xml
                      |---- MANIFEST.MF
        |
        |----- dependency-1.jar
        |----- dependency-2.jar

      So I've checked quickly the SVN repository and it seems that the directory in
      which we put "ear utility jar" is hard coded as "WEB-INF/lib" (->
      AbstractWtpResourceWritter.addDependency() which is the same for the war and the ear ... )

      Are you OK with this packaging ? It can be a good thing if we could configure where wtp will
      put these ear utility-jars and by default it would be in "/" or "lib".

      Thanks In Advance

      Elid OR

        Issue Links

          Activity

          Hide
          Jos van der Heiden added a comment -

          Adding <defaultLibBundleDir>lib</defaultLibBundleDir> might put the jars in that folder when packaging an ear with maven.
          However, the org.eclipse.wst.common.component file generated by maven-eclipse-plugin still uses /WEB-INF/lib as deploy-path for these utility jars.

          Now when another project (in my case a simple java project with some utility classes) needs one of these jars on it's classpath, the wtp wizard 'J2EE modules dependencies' in the properties of that project in eclipse allows you to add the jars available in the ear to the classpath in the manifest of that project.
          This wizard doesn't recognize the /WEB-INF/lib deploy-path in the ear settings (perhaps a bug in wtp, but still...), so I end up with a 'broken' class path.

          And anyway it just doesn't feel right to generate an .ear file with a WEB-INF/lib folder in it's root for the utility jars.

          So I would agree that writeWarOrEarResources() should be replace with two dedicated methods writeWarResources() and writeEarResources()

          Show
          Jos van der Heiden added a comment - Adding <defaultLibBundleDir>lib</defaultLibBundleDir> might put the jars in that folder when packaging an ear with maven. However, the org.eclipse.wst.common.component file generated by maven-eclipse-plugin still uses /WEB-INF/lib as deploy-path for these utility jars. Now when another project (in my case a simple java project with some utility classes) needs one of these jars on it's classpath, the wtp wizard 'J2EE modules dependencies' in the properties of that project in eclipse allows you to add the jars available in the ear to the classpath in the manifest of that project. This wizard doesn't recognize the /WEB-INF/lib deploy-path in the ear settings (perhaps a bug in wtp, but still...), so I end up with a 'broken' class path. And anyway it just doesn't feel right to generate an .ear file with a WEB-INF/lib folder in it's root for the utility jars. So I would agree that writeWarOrEarResources() should be replace with two dedicated methods writeWarResources() and writeEarResources()
          Hide
          Siarhei Dudzin added a comment -

          Jos, it appears you mean slightly different (but quite related) problem. The original issue is about having the directory layout. The problem with EAR module having libs in WEB-INF/lib does not exist anymore (the issue is dated Nov. 2006).

          Your problem is that org.eclipse.wst.common.component still has the wrong setting.

          Arnaud, does it make sense to create a separate issue for that and close this one (if everyone agrees of course)? This issue is 1.5 years old...

          I am getting lost now... Is this in fact a different issue?

          Show
          Siarhei Dudzin added a comment - Jos, it appears you mean slightly different (but quite related) problem. The original issue is about having the directory layout. The problem with EAR module having libs in WEB-INF/lib does not exist anymore (the issue is dated Nov. 2006). Your problem is that org.eclipse.wst.common.component still has the wrong setting. Arnaud, does it make sense to create a separate issue for that and close this one (if everyone agrees of course)? This issue is 1.5 years old... I am getting lost now... Is this in fact a different issue?
          Hide
          Arnaud Heritier added a comment -

          Completely agree.

          Show
          Arnaud Heritier added a comment - Completely agree.
          Hide
          Rob Stryker added a comment -

          This bug should be fixed once the patch at eclipse bugzilla makes it in.

          https://bugs.eclipse.org/bugs/show_bug.cgi?id=247090

          Show
          Rob Stryker added a comment - This bug should be fixed once the patch at eclipse bugzilla makes it in. https://bugs.eclipse.org/bugs/show_bug.cgi?id=247090
          Hide
          Rob Stryker added a comment -

          For those too lazy to click on the link, the class in charge of WTP's ear module and how it should be published is J2EEFlexProjDeployable. This is the class that, if there are children modules, the EAR will add the child module's dependencies in to the ear.

          The bug was some internal voo-doo, but basically it was adding all such child-module classpath jars rather than just those specifically designated as going in the ear.

          Show
          Rob Stryker added a comment - For those too lazy to click on the link, the class in charge of WTP's ear module and how it should be published is J2EEFlexProjDeployable. This is the class that, if there are children modules, the EAR will add the child module's dependencies in to the ear. The bug was some internal voo-doo, but basically it was adding all such child-module classpath jars rather than just those specifically designated as going in the ear.

            People

            • Assignee:
              Unassigned
              Reporter:
              Elid OR
            • Votes:
              10 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated: