Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Problem using maven and wtp (resources and libraries are not handle correctly)
Problem using maven and wtp (resources and libraries are not handle correctly) [message #225917] Mon, 05 January 2009 17:55 Go to next message
Jerome Blanchard is currently offline Jerome BlanchardFriend
Messages: 5
Registered: July 2009
Junior Member
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.
Re: Problem using maven and wtp (resources and libraries are not handle correctly) [message #225925 is a reply to message #225917] Mon, 05 January 2009 18:21 Go to previous messageGo to next message
Eclipse UserFriend
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.
>
Re: Problem using maven and wtp (resources and libraries are not handle correctly) [message #225933 is a reply to message #225925] Mon, 05 January 2009 18:30 Go to previous messageGo to next message
Eugene Kuleshov is currently offline Eugene KuleshovFriend
Messages: 504
Registered: July 2009
Senior Member
It is unclear from the original message if you are using m2eclipse.

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:

http://docs.codehaus.org/display/M2ECLIPSE/Installation+Requ irements
http://docs.codehaus.org/display/M2ECLIPSE/WTP+mini+howto
http://docs.codehaus.org/display/M2ECLIPSE/Home

regards,
Eugene


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.
>>
Re: Problem using maven and wtp (resources and libraries are not handle correctly) [message #225940 is a reply to message #225933] Mon, 05 January 2009 21:46 Go to previous messageGo to next message
Jerome Blanchard is currently offline Jerome BlanchardFriend
Messages: 5
Registered: July 2009
Junior Member
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.
Re: Problem using maven and wtp (resources and libraries are not handle correctly) [message #225955 is a reply to message #225940] Mon, 05 January 2009 21:59 Go to previous message
Eugene Kuleshov is currently offline Eugene KuleshovFriend
Messages: 504
Registered: July 2009
Senior Member
Jerome Blanchard wrote:
> 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

regards,
Eugene
Previous Topic:Dynamic Web Module cannot be uninstalled
Next Topic:jsdt code formatter question
Goto Forum:
  


Current Time: Tue Mar 19 10:37:26 GMT 2024

Powered by FUDForum. Page generated in 0.03382 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top