Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsProblem using maven and wtp (resources and libraries are not handle correctly)
https://www.eclipse.org/forums/index.php/mv/msg/72268/225917/#msg_225917
I've got a problem using WTP with a maven project. In fact I have create a
maven project and add a Dynamic Web Project facet. Everything is working
fine but I need to use maven resource directory (src/main/resources).
Configuration files present in this directory (log4j.properties for
example) are well copied in the target directory and all my JUnit test are
working. But when I publish this application to a server, only the
directory (src/main/webapp) content and the classes compilation result of
the directory (src/main/java) are published. In fact, all resources
present are not publish making my application not working because of
missing some configuration files... I forgot that dependencies are working
fine too...
In the other hand, the dependency managment doesn't work well too because,
in my case, the scope of a dependency is not take into account when
copying libraries to the deployement directory
(.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpweba pps/ <WebAppName>/WEB-INF/lib).
Even if a dependency is marked as scope compile it is copied.
Is anybody have an idea or an example of an application working fine with
maven and wtp ? I surely made a mistake in the initial project creation or
facet add...
Thanks a lot.]]>Jerome Blanchard2009-01-05T17:55:20-00:00Re: Problem using maven and wtp (resources and libraries are not handle correctly)
https://www.eclipse.org/forums/index.php/mv/msg/72268/225925/#msg_225925
Originally posted by: dcarver.starstandard.org
This seems specific to the M2E plugin, so I've copied their newsgroup on
this message as well.
Jerome Blanchard wrote:
> Hy,
> I've got a problem using WTP with a maven project. In fact I have create
> a maven project and add a Dynamic Web Project facet. Everything is
> working fine but I need to use maven resource directory
> (src/main/resources). Configuration files present in this directory
> (log4j.properties for example) are well copied in the target directory
> and all my JUnit test are working. But when I publish this application
> to a server, only the directory (src/main/webapp) content and the
> classes compilation result of the directory (src/main/java) are
> published. In fact, all resources present are not publish making my
> application not working because of missing some configuration files... I
> forgot that dependencies are working fine too...
> In the other hand, the dependency managment doesn't work well too
> because, in my case, the scope of a dependency is not take into account
> when copying libraries to the deployement directory
> (.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpweba pps/ <WebAppName>/WEB-INF/lib).
> Even if a dependency is marked as scope compile it is copied.
>
> Is anybody have an idea or an example of an application working fine
> with maven and wtp ? I surely made a mistake in the initial project
> creation or facet add...
>
> Thanks a lot.
>]]>2009-01-05T18:21:49-00:00Re: Problem using maven and wtp (resources and libraries are not handle correctly)
https://www.eclipse.org/forums/index.php/mv/msg/72268/225933/#msg_225933
Anyways, if you want to give it a try, you can install m2eclipse (I
recommend using dev update site, as it have additional fixes for WTP).
You need to make sure to install WTP integration for Maven feature, then
you can import your Maven project into Eclipse using Import Maven
projects wizard. This way you'll get your web projects configured to
work with WTP. See some more details on the wiki:
David Carver wrote:
> This seems specific to the M2E plugin, so I've copied their newsgroup
> on this message as well.
>
> Jerome Blanchard wrote:
>> Hy,
>> I've got a problem using WTP with a maven project. In fact I have
>> create a maven project and add a Dynamic Web Project facet.
>> Everything is working fine but I need to use maven resource directory
>> (src/main/resources). Configuration files present in this directory
>> (log4j.properties for example) are well copied in the target
>> directory and all my JUnit test are working. But when I publish this
>> application to a server, only the directory (src/main/webapp) content
>> and the classes compilation result of the directory (src/main/java)
>> are published. In fact, all resources present are not publish making
>> my application not working because of missing some configuration
>> files... I forgot that dependencies are working fine too...
>> In the other hand, the dependency managment doesn't work well too
>> because, in my case, the scope of a dependency is not take into
>> account when copying libraries to the deployement directory
>> (.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpweba pps/ <WebAppName>/WEB-INF/lib).
>> Even if a dependency is marked as scope compile it is copied.
>>
>> Is anybody have an idea or an example of an application working fine
>> with maven and wtp ? I surely made a mistake in the initial project
>> creation or facet add...
>>
>> Thanks a lot.
>>]]>Eugene Kuleshov2009-01-05T18:30:51-00:00Re: Problem using maven and wtp (resources and libraries are not handle correctly)
https://www.eclipse.org/forums/index.php/mv/msg/72268/225940/#msg_225940
new project ; I supposed that refactoring my project using the same way
will solve the problem.
Nevertheless thank you very much for your help and the rapidity of your
answer. thanks again.]]>Jerome Blanchard2009-01-05T21:46:39-00:00Re: Problem using maven and wtp (resources and libraries are not handle correctly)
https://www.eclipse.org/forums/index.php/mv/msg/72268/225955/#msg_225955
> Ok, very fine, following the wiki guide everything works fine in a
> blank new project ; I supposed that refactoring my project using the
> same way will solve the problem. Nevertheless thank you very much for
> your help and the rapidity of your answer. thanks again.
I am glad to hear that it worked for you. Thanks to David for
forwarding message to us. In a future you can just ask your
Maven-related questions at eclipse.technology.m2e