This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eclipse problem regarding M2Eclipse/integrated web server

 
Chris Rodgers
Greenhorn
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!

Regards,
Chris
 
Chris Rodgers
Greenhorn
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic