Eclipse, Tomcat, m2e and War Overlay from artifact

Go To StackoverFlow.com

1

I think this is a change precipitated by the move to automatic publishing in Tomcat?, but basically, it looks like when I have a project in eclipse that uses the war overlay, the resources are being copied from the local parent project, rather than that parent's war file. There's lots of building going on in the parent project, and pulling in files will not work, I need to base the child project off of the parent projects war file. Ideas on how to do this?

*Edit -- some more details.

The overlay works, and is specified in the POM as:

 <dependency>
   <groupId>org.parentproject</groupId>
   <artifactId>parentproject-web</artifactId>
   <version>2.0-SNAPSHOT</version>
   <type>war</type>
</dependency>

this leads to the following the org.eclipse.wst.common.component

<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="eurekastreams-web-ym2">
    <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
    <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
    <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
    <dependent-module deploy-path="/" handle="module:/overlay/prj/parentproject-web?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="parentproject-web-childproject"/>
    <property name="java-output-path" value="/parentproject-web-childproject/target/classes"/>
</wb-module>

2012-04-04 19:22
by chrismarx
Can you please elaborate what you meant by "There's lots of building going on in the parent project, and pulling in files will not work, I need to base the child project off of the parent projects war file. Ideas on how to do this? - Eugene Kuleshov 2012-04-05 13:51
the final war that is created by the parent project it itself the result of a complicated build, with its own war overlays, gwt compilationsm file and folder inclusions, etc. Right now, when I looked at the files that are getting deployed in my child project, only the files that are present in the parent project are being copied over, and not the full assortment of files that are present in the targer/war folder. Those files are however in the the child project's target/war folder after I do a maven package, but it seems eclipse/m2e/wtp is not looking ther - chrismarx 2012-04-05 13:58


0

Seems the answer is to add the target folder to the deployment assembly:

<wb-resource deploy-path="/" source-path="/target/ROOT"/>

where ROOT is the target build folder with the results of the maven war overlay-

2012-04-05 15:19
by chrismarx
i'm going to mark this as the correct answer, unless someone can indicate there is a more preferred method for doing this - chrismarx 2012-04-09 14:03
Yuck, how is this working for you? Any issues with Maven->Update? Seems like editing any of the . files by and could be a bad direction to take... may have to go this route tooLucas 2013-10-04 15:32
haven't touched this in ages, I think this was the solution I moved forward with - chrismarx 2013-10-04 16:04


0

You need to install m2e-wtp extension to handle WAR overlays. Then you declare overlay project as dependency and should also have it in your Eclipse Workspace.

2012-04-04 20:09
by Eugene Kuleshov
hi, Maven Integration for WTP from JBoss is already installed, and the war overlay is working, but I want to overlay the war file from the parent, not the current state of the parent project. I'll edit the question with more detal - chrismarx 2012-04-04 20:35
Have you tried to remove the overlay project from Eclipse workspace or close it - Eugene Kuleshov 2012-04-05 14:05
ok, that moved me in the right direction, im posting the actual solution - chrismarx 2012-04-05 15:17
Ads