Of course,

This is the *org.eclipse.wst.common.component* from a jar module in my app:

<project-modules id="moduleCoreId" project-version="1.5.0">
    <wb-module deploy-name="agrored-dao">
        <wb-resource deploy-path="/" source-path="/src/main/java"/>
        <wb-resource deploy-path="/" source-path="/src/main/resources"/>
        <wb-resource deploy-path="/" source-path="/src/test/java"/>
        <wb-resource deploy-path="/" source-path="/src/test/resources"/>
    </wb-module>
</project-modules>

And this is the same file for my war module:

<project-modules id="moduleCoreId" project-version="1.5.0">
  <wb-module deploy-name="agrored-web-1.0">
        <dependent-module deploy-path="/WEB-INF/lib"
handle="module:/resource/aao-commons/aao-commons">
            <dependency-type>uses</dependency-type>
        </dependent-module>
        <dependent-module deploy-path="/WEB-INF/lib"
handle="module:/resource/agrored-service/agrored-service">
            <dependency-type>uses</dependency-type>
        </dependent-module>
        <dependent-module deploy-path="/WEB-INF/lib"
handle="module:/resource/agrored-entity/agrored-entity">
            <dependency-type>uses</dependency-type>
        </dependent-module>
        <dependent-module deploy-path="/WEB-INF/lib"
handle="module:/resource/agrored-dao/agrored-dao">
            <dependency-type>uses</dependency-type>
        </dependent-module>
        <dependent-module deploy-path="/WEB-INF/lib"
handle="module:/resource/agrored-dto/agrored-dto">
            <dependency-type>uses</dependency-type>
        </dependent-module>
        <dependent-module deploy-path="/WEB-INF/lib"
handle="module:/resource/agrored-util/agrored-util">
            <dependency-type>uses</dependency-type>
        </dependent-module>
    <property name="context-root" value="agrored-web"/>
    <wb-resource deploy-path="/" source-path="src/main/webapp"/>
    <property name="java-output-path" value="/target/classes"/>
    <wb-resource deploy-path="/WEB-INF/classes"
source-path="src/main/resources"/>
        <wb-resource deploy-path="/WEB-INF/classes"
source-path="/src/main/java/model"/>
        <wb-resource deploy-path="/WEB-INF/classes" source-path="/"/>
        <wb-resource deploy-path="/WEB-INF/classes"
source-path="/src/main/java/com/ttec/aao/agrored/controller"/>
  </wb-module>
</project-modules>

This project has been created using *maven-archetype-j2ee-simple* this way:

*mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes
-DarchetypeArtifactId=maven-archetype-j2ee-simple
-DgroupId=com.ttec.aao.agrored-DartifactId=agrored*

We have 3 modules: *ear*, *projects *and *servlets*. *Servlets*, is a
modular project too where we can create war modules. At the momente we have
only one war module: *agrored-web*. This module has dependencies with all
jar modules inside *projects *module. We have 6 jar modules inside *projects
*. Finally, ear module has a dependency with our war module.

I wrote a tutorial at work, but it's written in spanish. Do you know
spanish?
***
*
2010/2/3 Martin Schayna <martin.scha...@abra.eu>

> Hi Manuel,
>
> I have tried same except "eclipse:eclipse" instead of "eclipse:m2eclipse"
> which didn't work for me also :(
>
> My humble findings are summarized in other message in this thread:
> http://old.nabble.com/Maven-and-WTP-integration-td27403219.html#a27405004
>
> Please, could you post here example of file:
>  $(PROJECT_DIR)/.settings/org.eclipse.wst.common.component
> from your "app" and "lib" projects?
>
> Are there in root of your projects some special files starting with period
> (except .project and .classpath of course)? Eclipse plugin didn't make
> these, but I have seen some in some projects on Google Code Search.
>
> Thank you
>
> Martin
>
>
>
>
> Manuel Grau wrote:
>
>> Hi Martin,
>>
>> My setup is similar to yours. Enter each appN folder and type this:
>>
>> mvn -Dwtpversion=2.0 eclipse:m2eclipse
>>
>> Is what I did and it works for me.
>>
>> 2010/2/1 Martin Schayna <martin.scha...@abra.eu>
>>
>>
>>
>>> Hi all,
>>>
>>> we have pretty large project, successfully "mavenized" with Maven 2,
>>> split into several module projects under one parent pom. We are using
>>> m2eclipse plugin in Eclipse 3.5.
>>>
>>> Project tree looks like:
>>>
>>> parent/         (pom project)
>>>  +-- lib-core/ (jar project)
>>>  +-- lib-web/  (jar project, with shared webapp folder)
>>>  +-- app1/     (war project)
>>>  +-- app2/     (war project)
>>>  +-- app3/     (war project)
>>>
>>> parent project serves as agregator, its pom.xml defines common settings.
>>> lib-web project depends on lib-core project, application projects depend
>>> on both lib projects. All projects share same version, we are releasing
>>> all applications at once through parent pom.
>>>
>>> For everyday develepment we use SNAPSHOT postfix in version, dependecies
>>> on module projects are specified as "project dependencies", so changes
>>> in library projects in Eclipse cause rebuild dependent application
>>> projects. Snapshots are disabled in our repository (Archiva).
>>>
>>> But when I try setup WTP support through maven-eclipse-plugin goal
>>> "eclipse:eclipse" and some necessary changes in Eclipse, publishing to
>>> Tomcat creates only WEB-INF/lib folder with (correct) out-of-project
>>> jar dependencies and WEB-INF/classes folder with CURRENT project
>>> classes. No binaries from "project dependencies" lib-core and lib-web.
>>>
>>> I have tried to change org.eclipse.wst.common.component file in many
>>> ways,
>>> e.g. <dependent-module>, but without success.
>>>
>>> Another weird thing: when I try to include resources from shared webapp
>>> folder from lib-web project and use relative source-path like this:
>>>
>>>  <wb-resource deploy-path="/"
>>>               source-path="../lib-web/src/main/webapp"/>
>>>
>>> publish can't copy subfolders content to Tomcat. Must explicitly
>>> specified:
>>>
>>>  <wb-resource deploy-path="/btns"
>>>               source-path="../lib-web/src/main/webapp/btns"/>
>>>  <wb-resource deploy-path="/icons"
>>>               source-path="../lib-web/src/main/webapp/icons"/>
>>>  <wb-resource deploy-path="/imgs"
>>>               source-path="../lib-web/src/main/webapp/imgs"/>
>>>  ...
>>>
>>> Please, what is the right WTP setup for multi modules configuration with
>>> "project
>>> dependencies" and shared resources? Or is there any documentation for
>>> file
>>> org.eclipse.wst.common.component?
>>>
>>> I'm going little bit crazy... thank God debugging with Jetty works like a
>>> charm,
>>> either with shared resources (must hack with
>>> WebAppContext.setResourceBase() in
>>> starter class).
>>>
>>> Thanks a lot.
>>>
>>> Martin Schayna
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>


-- 
"Everything should be made as simple as possible, but not simpler" Albert
Einstein

Reply via email to