0

I have the following Problem:

I have a Maven MainProject with some SubProjects. Two of this SubProjects are WebApplications. (One WebApp and one WebService)

If I build the MainProject in the command line with mvn clean package the 2 .war files are deployable in an external Apache Tomcat 6.0.

If I build the MainProject in eclipse with the m2e plugin i can also deploy the .war files into an external Tomcat.

BUT if i want to deploy the WebProjects in an Apache Tomcat in Eclipse, it doesn't boot. The Problem is, that the file structure of the eclipse build for the internal Tomcat is different to the Maven one.

In the Maven build (console / m2e) the path is correctly from e.g. Project/src/main/java/com/... to WEB-INF/com...

The eclipse build for the internal Tomcat creates the structure like WEB-INF/main/java/com/...

So many of the .xml files which are mandatory for the Tomcat boot are not found bacause of the wrong path.

How can i tell eclipse that it should do the similar build like m2e or maven on command line so that i can use an internal tomcat in eclipse?

I am using

Eclipse Juno 4.2 or Helios 3.6

m2e - Maven Integration for Eclipse / 1.1.0.20120530-0009 / org.eclipse.m2e.feature.feature.group Maven Integration for WTP / 0.15.2.20120306-2040 / org.maven.ide.eclipse.wtp.feature.feature.group

1 Answers1

0

I fixed the problem.

The problem was the deployment assembly options in the eclipse projects. Eclipse default option is to deploy /src to / folder. Because of the maven structure /src/main/java/com the deployed folder also looks like /main/java/com. I only had to change the source folder from /src to /src/main/java (the destination still remains /). If there are other necessary files i had to add them the same way, e.g. /src/main/resources. The /src/main/webapp folder was already set correctly by eclipse to /WEB-INF