私はMavenプロジェクトを持っており、Web、Persistence、Common、Otherの4つのコンポーネントがあります。
私のPOMファイルからの関連するもの:
親POM:
<groupId>com.test</groupId>
<artifactId>test</artifactId>
<packaging>pom</packaging>
<version>0.0.1-SNAPSHOT</version>
<modules>
<module>components/TestWeb</module>
<module>components/TestOther</module>
<module>components/TestPersistence</module>
<module>components/TestCommon</module>
</modules>
<build>
<defaultGoal>package</defaultGoal>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1</version>
<configuration>
<dependentWarExcludes>
**/hibernate.cfg.xml,**/sql-map-config.xml,**/web.xml,WEB-INF/classes/META-INF/**
</dependentWarExcludes>
</configuration>
</plugin>
</plugins>
</build>
一般的なpom:
<modelVersion>4.0.0</modelVersion>
<artifactId>test-common</artifactId>
<packaging>jar</packaging>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>com.test</groupId>
<artifactId>test</artifactId>
<relativePath>../../pom.xml</relativePath>
<version>0.0.1-SNAPSHOT</version>
</parent>
永続性pom:
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>test-persistence</artifactId>
<packaging>jar</packaging>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>com.test</groupId>
<artifactId>test</artifactId>
<relativePath>../../pom.xml</relativePath>
<version>0.0.1-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>com.test</groupId>
<artifactId>test-common</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
ウェブpom:
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>test-web</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>TestWeb</name>
<parent>
<groupId>com.test</groupId>
<artifactId>test</artifactId>
<relativePath>../../pom.xml</relativePath>
<version>0.0.1-SNAPSHOT</version>
</parent>
<dependency>
<groupId>com.test</groupId>
<artifactId>test-common</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.test</groupId>
<artifactId>test-persistence</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.test</groupId>
<artifactId>test-other</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
コピー&ペーストで何かが壊れたのかもしれませんが、XMLは有効です。
- mvn packageを実行すると、プロジェクトのWARファイルは作成されませんが、すべてのコンポーネントパッケージが作成され、整形式になっています。
- 次に実行する
mvn war:war
と、WARファイルは空で生成されます。
どうすればこれを修正できますか?