wood burning stoves 2.0*
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse problem regarding M2Eclipse/integrated web server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse problem regarding M2Eclipse/integrated web server" Watch "Eclipse problem regarding M2Eclipse/integrated web server" New topic
Author

Eclipse problem regarding M2Eclipse/integrated web server

Chris Rodgers
Greenhorn

Joined: Mar 31, 2009
Posts: 2
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

Joined: Mar 31, 2009
Posts: 2
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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Eclipse problem regarding M2Eclipse/integrated web server
 
Similar Threads
maven in eclipse
m2eclipse problems in Eclipse
Maven 2, Eclipse and J2EE
Trouble with running Maven Tomcat plugin through Eclipse
Cannot find parent error while "mvn compile"