我处于maven使用的起始级别。我希望我能清楚地解释我的问题,我想创建一个包含war文件的ear文件。我计划从一开始就用来创建一个war文件。另外我想在我的项目的pom.xml中执行它,并且只有一个pom.xml,这是问题所在;
(顺便说一句,我建立这个pom的命令是“mvn clean package”)
“缺少1个必需的工件。
for artifact:
com.denem.denem:com.denem.de2:ear:v0.1"
它试图找到这个war文件,但我想创建它而不是找到它。这是我的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>
我想我做了很多错事。但如果你能帮助我,我会很高兴。无论如何,谢谢你。
答案 0 :(得分:2)
您需要创建一个模块化项目。 创建:
在后者中,您需要配置耳塞,放置您需要的所有模块。