Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] running webapp on eclipse using tomcat

Hi Fred,

The jquery scripts are copied via "maven-antrun-plugin", not war-plugin, since the war packaging is overwriting the scripts (we've tried different ways, but this is the best solution we can come up with). 

So how can I know or check that m2e-wtp is copying all the web-source correctly for deployment? Should I set up the ant-plugin to copy jquery directory to target/m2e-wtp/web-sources as jquery-dev so it will be deployed?
Thanks,

David
  • From: Fred Bricon <fbricon@xxxxxxxxx>
  • Date: Sat, 16 Jun 2012 09:49:02 +0200
  • Delivered-to: m2e-users@xxxxxxxxxxx
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=yhZJA+IYbxAu3BzLQZlLlx6vfoPGEme9W8IrEMNLb5w=; b=yC1WgNi+sPvzaiZqenpD7fDLjULjWekCy2X4aWg7Y1AVyLDrGS3FLCD5d6x1FMJdVl 424NkgciHBHB1BbOMJ01eVkElSH7S7zOAcHmk/muSoqWeipGuK42cmftLMy3rVjP++K4 B+ce6SNk5LHtVnHwO1a+Fn5/lxp/vsP20wd4qTMA/JNsN7eybYS9NuJMk85WmN2vClmo AgMx46Gx1hByZ6GxFITR1Tl2A+1cJe83edTvYqDZW9mQM+TNuSfdC1FQzBP15PucpANK bjmURQ24sZaD+UeoN0wwvhHlzxYD1dlwpPBjM+p/kaWrnJxe8rnMXXA9lWIdIi+O/Mty VaJQ==
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 : http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.htmlÂ

SeeÂhttp://wiki.eclipse.org/M2E-WTP_FAQ#What_is_this_web_resources_folder.3FÂ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 :Âhttp://wiki.eclipse.org/M2E_plugin_execution_not_covered#execute_plugin_goal

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Âhttps://community.jboss.org/en/tools/blog/2011/09/19/adding-some-grease-to-jboss-tools-33-m3ÂandÂhttp://docs.jboss.org/tools/whatsnew/maven/maven-news-3.3.0.M3.html#itemname1)


HIH

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!

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

David,

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 Âhttps://issues.sonatype.org/browse/MECLIPSEWTP ?

Regards,

Fred Bricon

_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users






Back to the top