• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Eclipse problem regarding M2Eclipse/integrated web server  RSS feed

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

We're having trouble with deploying our web app to Tomcat v6.0 from within Eclipse, as follows:

We've split our web app into PD and UI projects, with the UI fetching the PD jar from the local Maven repository as defined in its POM file. We're following the standard Maven directory structure as we have with previous projects (as defined here: http://cvs.peopleware.be/training/maven/maven2/standardDirLayout.html).

* when I run "mvn clean install" on the PD project from the command line or via M2Eclipse I see that the resource file "src\test\resources\META-INF\persistence.xml" has been copied to target\test-classes\META-INF as expected, and the PD.jar file under the target directory has excluded the file, again as expected.

* When I examine my local Maven repository, the PD.jar file stored there looks identical to that under the target directory, again as expected.

* When I run "mvn clean install" on the UI project and examine the UI.war file under the target directory, I again see the expected version of the PD.jar.

However, the problem comes when I go to publish this project to my integrated Tomcat server. The observable symptoms on server start-up were obscure, but were eventually traced back to the fact that the PD.jar that gets published to the server is different to that contained in the UI.war file, as it contains the expected PD content *plus* the files and folders stored under PD\src\test\resources, which by Maven convention are normally excluded. Why?? I would expect that right-clicking on my server in Eclipse and selecting "publish" should delegate the build process to M2Eclipse and explode the resulting WAR file into its deployment directory, but the WAR file generated via the mvn CLI command or M2Eclipse is correct whereas the content deployed to the server via "publish" or "start server" is not. Are there configurations settings somewhere that we've broken wrt how the server publishing process operates that I can correct maybe?

Any advice appreciated!

Chris Rodgers
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem solved thanks to our friendly Solutions Architect, as follows:

* Right-click on the UI project in Eclipse
* Select Maven -> Disable Workspace Resolution

Hadn't been aware of this feature before, but it seems that M2Eclipse had figured out that the PD module was a local project and so was publishing that instead of fetching the PD.jar from the Maven repository. Mystery solved!
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!