Maven2 + Eclipse WTP

Maven2をなかなか覚えきれずにいる自分ですが、最近少しずつですが日々のプログラミングにも使えるようになってきました。
近頃挑戦しているのが、Maven2でwebアプリのプロジェクトを作成して、Eclipse WTPのプロジェクトに変換するって方法。
たとえばS2Hibernate-JPAを使ったWebプロジェクトを作ってみようと思ったら・・・

mvn archetype:create -DgroupId=examples -DartifactId=testweb -DarchetypeArtifactId=maven-archetype-webapp

これでwebプロジェクトを作成。次に、作成されたpom.xmlに修正を加えます。

<?xml version="1.0" encoding="UTF-8"?>
<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>examples</groupId>
	<artifactId>testweb</artifactId>
	<packaging>war</packaging>
	<version>1.0-SNAPSHOT</version>
	<name>testweb Maven Webapp</name>
	<url>http://maven.apache.org</url>
	<build>
		<finalName>testweb</finalName>
		<sourceDirectory>src/main/java</sourceDirectory>
		<testSourceDirectory>src/test/java</testSourceDirectory>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<configuration>
						<source>1.5</source>
						<target>1.5</target>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
	<repositories>
		<repository>
			<id>maven.seasar.org</id>
			<name>The Seasar Foundation Maven2 Repository</name>
			<url>http://maven.seasar.org/maven2</url>
		</repository>
	</repositories>
	<dependencies>
		<dependency>
			<groupId>org.seasar.hibernate</groupId>
			<artifactId>s2hibernate-jpa</artifactId>
			<version>1.0.0-rc2</version>
			<type>jar</type>
		</dependency>
		<dependency>
			<groupId>org.apache.geronimo.specs</groupId>
			<artifactId>geronimo-j2ee_1.4_spec</artifactId>
			<version>1.0</version>
			<type>jar</type>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.geronimo.specs</groupId>
			<artifactId>geronimo-jta_1.1_spec</artifactId>
			<version>1.0</version>
			<type>jar</type>
		</dependency>
		<dependency>
			<groupId>org.apache.geronimo.specs</groupId>
			<artifactId>geronimo-annotation_1.0_spec</artifactId>
			<version>1.0</version>
			<type>jar</type>
		</dependency>
		<dependency>
			<groupId>org.apache.geronimo.specs</groupId>
			<artifactId>geronimo-ejb_3.0_spec</artifactId>
			<version>1.0</version>
			<type>jar</type>
		</dependency>
		<dependency>
			<groupId>org.apache.geronimo.specs</groupId>
			<artifactId>geronimo-interceptor_3.0_spec</artifactId>
			<version>1.0</version>
			<type>jar</type>
		</dependency>
		<dependency>
			<groupId>com.h2database</groupId>
			<artifactId>h2</artifactId>
			<version>1.0.20070304</version>
			<type>jar</type>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.3.1</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
</project>

まだまだMaven弱者なので、細かな部分を間違えてるかも・・・
とりあえず、こんな感じで修正した後に

mvn -DdownloadSources=true -Dwtpversion=1.5 eclipse:eclipse

これでWTP1.5に対応したWebプロジェクトが作れます。予めpom.xmldependencyを記述しておけば、依存ライブラリをEclipseのプロジェクトのパスに登録してくれる、というのがかなり便利ですね。今まで自分でライブラリをダウンロードして、WEB-INF/libに放り込んでいた作業が無くなるというだけでも、個人的にはかなりの進歩です。テストにだけ使いたいライブラリも、pom.xml側で定義しておけば、WTPの設定に反映してくれます。これもかなり便利。
ただ、Project FacetsのJavaバージョンが標準で1.4になってしまうので、JDK5環境とかだとエラーになってしまいます。今は手動で直しているのですが、ここも設定で定義できたりしないのだろうか?・・・
できればNetBeansのプロジェクトでも試してみたいところですが、こちらはまだ調査も出来ていない段階・・・WTP1.5はJavaEE5に対応してないので、NetBeansで使えれば言うことなしなんですけど。