2
我處於maven使用的入門級別。我希望我能清楚地解釋我的問題,我想創建一個包含war文件的ear文件。而且我打算從一開始就用它來創建一個戰爭文件。另外我想在我的項目中的pom.xml中做到這一點,並且只有一個pom.xml,這是問題;使用maven-ear-plugin創建war文件並將其定義在一個pom.xml中
- 我可以創建ear文件,並且其中包含我在一個pom.xml文件中同時創建的這個war文件嗎?
- 當我嘗試在webmodule標記中創建war文件時,這裏是我遇到的問題「Artifact [war:denem.denem:denem]不是項目的依賴項。」我明白這就是爲什麼我添加依賴本文件中的相同的pom.xml但這次我遇到的問題
(順便說一下我的命令來建立這個POM是「MVN清潔套裝」)
「1個神器需要缺少
的神器:。
com.denem.denem:com.denem.de2:ear:v0.1"
它試圖找到這場戰爭文件,但我想創建它無法找到它在這裏,在我的pom.xml文件中的代碼;
<parent>
<groupId>denem.denem</groupId>
<artifactId>com.denem.denem</artifactId>
<version>v0.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>denem.denem</groupId>
<artifactId>com.denem.de2</artifactId>
<version>v0.1</version>
<packaging>ear</packaging>
<properties>
<cxf.version>2.2.5</cxf.version>
</properties>
<dependencies>
<dependency>
<groupId>denem.denem</groupId>
<artifactId>denem</artifactId>
<version>v0.1</version>
<type>war</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.5</version>
<configuration>
<finalName>edu</finalName>
<defaultLibBundleDir>lib</defaultLibBundleDir>
<modules>
<webModule>
<groupId>denem.denem</groupId>
<artifactId>denem</artifactId>
<contextRoot>/WebContent</contextRoot>
</webModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
我想我做的很多事情是錯誤的。但如果你能幫助我,我會很高興。不管怎樣,謝謝你。