11 Replies Latest reply on Nov 4, 2011 12:53 PM by diaxwm

    m2e-wtp War Overlay

    bpickens.ibsys

      Hi, I'm hoping Fred Bricon can help me. I wasn't sure where better to post so here it is.

       

      I'm having trouble getting the new War Overlay features to work.  I have a standard war dependancy and overlay configured. However it doesn't showup in the /target/m2e-wtp/overlays/ folder. In fact, there is no overlays folder inside the m2e-wtp/ folder. I'm hesitant to create a bug because I think this may be a configuration issue, or some other use error on my part.

       

      <dependency>

          <groupId>com.ibsys.toolshed</groupId>

          <artifactId>my-web-lib</artifactId>

          <version>4.0.0-SNAPSHOT</version>

          <type>war</type>

          <scope>runtime</scope>

          <optional>false</optional>

      </dependency>

       

      <overlay>

                                      <groupId>com.ibsys.toolshed</groupId>

                                      <artifactId>my-web-lib</artifactId>

      </overlay>

        • 1. Re: m2e-wtp War Overlay
          fbricon

          Is my-web-lib an artifact from your maven repository or another project in your workspace?

          * overlay archives (.war) will be expanded to /target/m2e-wtp/overlays/ upon deployment to the server.

          * workspace projects won't show up in /target/m2e-wtp/overlays/ but will be declared in .settings/org.eclipse.wst.common.component

           

          What server are you deploying to?

          • 2. Re: m2e-wtp War Overlay
            bpickens.ibsys

            1) my-web-lib is a project in my maven repository that is also a project in my workspace.

            2) I am deploying to a tomcat 6 server configured in eclipse with the wtp plugin.

             

            Let me check my org.eclipse.wst.common.component file and look for my workspace project dependency.

            • 3. Re: m2e-wtp War Overlay
              bpickens.ibsys

              Alright, so I'm not sure what this is supposed to look like so here is the entire file. Webscan-lib-4.0.0-SNAPSHOT.war is my war project that isn't deploying.

               

              {code:xml}

              <?xml version="1.0" encoding="UTF-8"?>

              <project-modules id="moduleCoreId" project-version="1.5.0">

                  <wb-module deploy-name="pps">

                      <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>

                      <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>

                      <wb-resource deploy-path="/" source-path="/src/main/webapp"/>

                      <dependent-module archiveName="webscan-lib-4.0.0-SNAPSHOT.war" deploy-path="/WEB-INF/lib"handle="module:/resource/webscan-lib/webscan-lib">

                          <dependency-type>uses</dependency-type>

                      </dependent-module>

                      <dependent-module archiveName="webscan-traffic-1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib"handle="module:/resource/webscan-traffic/webscan-traffic">

                          <dependency-type>uses</dependency-type>

                      </dependent-module>

                      <property name="context-root" value="pps"/>

                      <property name="java-output-path" value="/pps/target/classes"/>

                  </wb-module>

              </project-modules>

              {code}

              • 4. Re: m2e-wtp War Overlay
                fbricon

                What version of m2e-wtp are you using? This look very different from the file you'd had if the overlay support was properly active.

                Overlay support was added in 0.13.0. Version 0.13.1 is currently available from the eclipse marketplace or http://download.jboss.org/jbosstools/updates/m2eclipse-wtp/ directly.

                If that's what you already use, have you tried removing the war dependency, saving, then putting it back?

                Have you tried deleting the project from the workspace, deleting all eclipse config files (.classpath, .project, ./settings/*) and reimporting it as a maven project?

                • 5. Re: m2e-wtp War Overlay
                  bpickens.ibsys

                  Okay so I did some messing around, we're actually overlaying some jar files that contain web content as well. This seems to throw a validation error in the pom file overlay [dependency] is not a dependency of the project where dependency is clearly defined. We ignore it because maven itself seems to handle this just fine. In fact maven can handle overlays of types other than war files including jars and zips. But now I'm wondering if this is the cause of the failure as far as m2e-wtp is concerned. I removed those dependencies just to see if it would deploy correctly but nothing has changed yet. Ill keep playing around with it here.

                   

                  This is the org.eclipse.wst.common.component file with those dependencys removed (no more errors). Does this look closer to what it should be? (webscan-lib is the war project that should deploy)

                   

                  {code:xml}

                  <?xml version="1.0" encoding="UTF-8"?>

                  <project-modules id="moduleCoreId" project-version="1.5.0">

                      <wb-module deploy-name="pps">

                          <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>

                          <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>

                          <wb-resource deploy-path="/" source-path="/src/main/webapp"/>

                          <dependent-module archiveName="webscan-traffic-1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/webscan-traffic/webscan-traffic">

                              <dependency-type>uses</dependency-type>

                          </dependent-module>

                          <dependent-module deploy-path="/" handle="module:/overlay/prj/webscan-lib?includes=**/**&amp;excludes=META-INF/MANIFEST.MF">

                              <dependency-type>consumes</dependency-type>

                          </dependent-module>

                          <dependent-module deploy-path="/" handle="module:/overlay/slf/?includes=**/**&amp;excludes=META-INF/MANIFEST.MF">

                              <dependency-type>consumes</dependency-type>

                          </dependent-module>

                          <property name="context-root" value="pps"/>

                          <property name="java-output-path" value="/pps/target/classes"/>

                      </wb-module>

                  </project-modules>

                  {code}

                  P.S. Yes I'm using the latest version of .13

                  • 6. Re: m2e-wtp War Overlay
                    fbricon

                    This looks better indeed.

                    Overlaying jar/zip artifacts is buggy in 0.13.1 (https://issues.sonatype.org/browse/MECLIPSEWTP-141).

                    Try 0.14.0-SNAPSHOT : http://download.jboss.org/jbosstools/builds/staging/m2eclipse-wtp-e37/all/repo/ and tell me if it works for you

                    • 7. Re: m2e-wtp War Overlay
                      bpickens.ibsys

                      That seems to solve the problems with the jar overlays deploying. Everything is deploying correctly using 0.14.0 from staging. The pom file is still throwing a validation error however saying overlay [dependency] is not a dependency of the project where dependency has a type of jar. Is that something you'd like me to comment in the MECLIPSEWTP-141 ticket?

                      • 8. Re: m2e-wtp War Overlay
                        fbricon

                        If the content of the overlaid jar is deployed, then the marker is maybe a stale one, from previous builds.

                        If you delete it manually, then change the project dependencies and it reappears, then something's wrong.

                        In this case, please reopen the aforementioned issue and add a sample project so I can reproduce the issue.

                        • 9. Re: m2e-wtp War Overlay
                          bpickens.ibsys

                          Thanks Fred, you've been helpful. Indeed that marker was stale, the pom file got refreshed and it went away. Do you have an idea when 0.14.0 will be released? I'm wondering if its worth pointing my coworkers to the staging site for the new version.

                          • 10. Re: m2e-wtp War Overlay
                            fbricon

                            I should release it before the end of September.

                            If you could now flag the answer you consider is the right one, that might help other people. Thx.

                            • 11. Re: m2e-wtp War Overlay
                              diaxwm

                              I had a similar problem (overlays directory not created at all) caused by a different reason. I just want to document it here for others having the same problem...

                               

                              We had a new installation and forgot to set M2E_HOME (and JAVA_HOME) environment variables. Eclipse worked well but the overlay-directory was not created. When we checked out the overlays it worked. So the problem only occured when we tried to use an overlay out of the repository. There were no errors or log statements or anything else showing the problem.

                               

                              Setting the M2_HOME system environment variable solved this problem.

                               

                              At this point a big thanks to Fred for his very good work on the wtp integration!

                               

                              Regards Michael