Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] m2e-users Digest, Vol 40, Issue 4

How do you copy your scripts during war packaging?

The proper/supported way to get custom web resources deployed in wtp is to define these web resources in the maven-war-plugin configuration : 

See to understand how m2e-wtp deals with maven-war-plugin's web resources.

So, if your not using maven-war-plugin webResources, then the plugin responsible for the copying the files needs to copy them to target/m2e-wtp/web-resources/
Be aware that, that kind of plugin is generally not supported OOTB by m2e, you'll most likely need to setup a lifecycle mapping execution :

There are 3 ways to activate profiles in m2e :
- make the profile auto activated, via their <activation> definition
- set the activated profile in the project properties : right-click on project > properties > maven > active maven profiles (this will override any automatically enabled profiles)
- using the profile management UI from JBoss Tools (See and


Fred Bricon

On Sat, Jun 16, 2012 at 9:18 AM, wzhao6898@xxxxxxxxx <wzhao6898@xxxxxxxxx> wrote:
Hi Fred,

Thanks for your response. I've been working on another project and haven't had a chance to look into this until now. 

OK, I'm able to get my maven webapp module to run on server, sort of, using m2e-wtp, without moving the WEB-INF/conf directory back. 

However, we have a folder under _javascript_s in webapp called jquery, where we store customized jquery _javascript_ codes. In our pom.xml file, we have a development profile to copy _javascript_s/jquery to _javascript_s/jquery-dev during war packaging. m2e-wftp failed to also copy and rename directory, only _javascript_/jquery folder got copied, so none of the jquery _javascript_ functionalities is working. 

How does m2e-wtp handle profiles or how should I set up in my pom.xml for it to profiles? You mentioned it reads the pom.xml, and configure the project, can you point me to some documentations on this. I'd like to understand how m2e-wtp deploys the web application. 
Thanks very much!

Date: Mon, 7 May 2012 10:24:54 +0200
From: Fred Bricon <fbricon@xxxxxxxxx>
To: Maven Integration for Eclipse users mailing list
Subject: Re: [m2e-users] running webapp on eclipse using tomcat
Content-Type: text/plain; charset="utf-8"


m2e-wtp reads your pom.xml to configure the project to be deployed via Run
As > Run on Server, it makes no assumptions about the original webapp
directory setup.
When moving your resources from src/main/webapp/WEB-INF/conf back to
src/main/resource/, they will end up behing deployed to WEB-INF/classes
instead of WEB-INF/conf. So if a CLI-built war works fine but fails when
deployed via WTP, I'm interested in seeing your pom.xml.
Could you make a sample project that reproduce this error and open a ticket
at ?


Fred Bricon

m2e-users mailing list

"Have you tried turning it off and on again" - The IT Crowd

Back to the top