Ich benutze Eclipse 3.5, Maven 2, m2eclipse und Tomcat 6. So erstelle ich Maven-Projekt für archetype webapp. Dies ist pom.xml:Mit Eclipse und Maven erstelltes Projekt an Tomcat
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.itransition</groupId>
<artifactId>hello</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>hello Maven Webapp</name>
<url>http://maven.apache.org</url>
<!-- tools.jar dependency -->
<profiles>
<profile>
<id>default-tools.jar</id>
<activation>
<property>
<name>java.vendor</name>
<value>Sun Microsystems Inc.</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.5.0</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.1.8.1</version>
</dependency>
</dependencies>
<build>
<finalName>hello</finalName>
</build>
</project>
So dann will ich Tomcat meine Web-Anwendung implementieren. Was ich tun muss? Maven installieren helfen nicht. Aber wenn ich durch Maven install Krieg erschaffe, kann ich es in Eclipse importieren und es in Tomcat über "Hinzufügen und Entfernen ..." im Server-Popup bereitstellen.
BTW, was zum Teufel ist das Standard-tools.jar Profil ?! –