Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] war artifacts, glassfish, m2e - a neverending painful story

Are you using m2e-wtp? It's required if you expect your project to be configured and deployed to any WTP server.
It's actually server agnostic, only tells WTP what to deploy stuff to a server (the deployment assembly). The general rule with m2e/m2e-wtp is : pom.xml config controls the eclipse settings
You should never manually change the deployment assembly page (which is a front-end for .settings/org.eclipse.wst.common.component) as its settings are controlled by the maven-war-plugin configuration. basically what's deployed is :
- src/main/webapp : your primary web resources
- target/m2e-wtp/web-resources : generated stuff / secondary web resources. See http://wiki.eclipse.org/M2E-WTP_FAQ#What_is_this_web_resources_folder.3F

Similarly, the maven-compiler-plugin configuration controls the java settings in eclipse (it's an m2e core feature). So you need to make sure it explicitely declares java 1.6 (as it defaults to 1.5) in order to get your eclipse compiler set accordingly.

The deployment part is the server adapter's responsibility (read: oracle's plugin for glassfish, jboss tools for jboss as ...). In theory, deploying a war to glassfish should be exactly the same as what's shown on the screencast in http://www.eclipse.org/m2e-wtp/ for tomcat.
Any deviation / unexpected behaviour from that can be a feature/bug in the server adapter (like https://forums.oracle.com/forums/thread.jspa?messageID=10608918) OR m2e-wtp, so you'd need to provide a sample project with exact steps to reproduce the problem, so we can investigate what's causing the issue.

HIH

Fred Bricon


On Thu, Jan 3, 2013 at 9:38 AM, Kristian Rink <kawazu428@xxxxxxxxx> wrote:
Folks;

once in a while, I come back with the same issue, and over and over again, it
is utterly painful. :( So, this time: Had to re-install Eclipse 4.2 on a new
machine. Kept my workspace folder in place, installed all the plugins I used
to have before (Oracle Glassfish tools, JBoss tools, Spring IDE and a few
others). Saw that the workspace configuration, application servers configured in
there, ..., were still in place. Maven building my war artifacts also works.

However, again, deploying a war artifact to a local Glassfish from within the
IDE is dearly broken. Building the war artifact via maven and deploying it
using the Glassfish administration console just works. However, in Eclipse at
first I had to figure out that, despite I kept my workspace untouched,
"something" messed up my "Deployment Assembly" configuration, again including
source files but omitting the maven dependencies which have to go to WEB-
INF/lib - I am almost used to manually setting this right, even though I have
no idea why this setting is being reset after re-installing the IDE -
shouldn't this be something to live inside the workspace / project
configuration? Same way, other settings (such as Java 1.6 compiler compliance)
seem to have "disappeared" from the project configuration. Maybe some other
settings, too - so far I see peculiar errors I have never seen before whenever
trying to deploy the artifact to the local Glassfish server, but as well, using
the tooling in Eclipse, I don't see any way to figure out _what_ actually does
get deployed, _where_ these files live and _how_ the IDE determines what should
be deployed and what shouldn't. The glassfish-web.xml sometimes seems to be
evaluated (though not all the time). Changes in the pom.xml also seem to be
honoured just sometimes, sometimes requiring "just" a redeploy of the app to
produce a different error, sometimes require a restart of the application
server to change anything.

At the moment, I am running out of ideas. So to ask: Is there _anything_,
documentation or a tutorial, a set of FAQs, ... to figure out how on earth to
get such a setup (maven, glassfish, Eclipse) to _reliably_ work even after an
IDE re-installation without spending hours and hours trying to track down
project configuration errors?

Any input on this greatly appreciated. :)
Thanks in advance,
Kristian
_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users



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

Back to the top