使用Maven 3构建耳朵项目时出错

时间:2014-03-05 16:22:58

标签: java maven

我有树 的pom.xml .presentation(耳) ..business(战) ..integration(JAR)

当我尝试构建耳朵(演示文稿)时,我得到了这个错误,我不明白为什么工件演示应该是一个依赖项和一个究竟是什么依赖? :

Failed to execute goal org.apache.maven.plugins:maven-ear-plugin:2.6:generate-application-xml (default-generate-application-xml) on project presentation: Artifact[war:presentaion:presentation] is not a dependency of the project. ->Help

ear:pom.xml:

<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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>presentation</groupId>
  <artifactId>presentation</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>ear</packaging>
   <parent>
  <groupId>MyProject</groupId>
  <artifactId>MyProject</artifactId>
   <version>0.0.1</version>
  </parent>

<build>
  <plugins>

    <plugin>
      <artifactId>maven-resources-plugin</artifactId>
      <version>2.4</version>
      <configuration>
        <encoding>UTF-8</encoding>
      </configuration>
    </plugin>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
    </plugin>

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-ear-plugin</artifactId>
        <version>2.6</version>
        <configuration>
        <modules>
          <webModule>
            <groupId>presentaion</groupId>
            <artifactId>presentation</artifactId>
            <bundleFileName>presentation.war</bundleFileName>
            <contextRoot>/presentation</contextRoot>
          </webModule>
          <jarModule>
            <groupId>integration</groupId>
            <artifactId>integration</artifactId>
           <bundleFileName>integration.jar</bundleFileName>
          </jarModule>
        </modules>
        <displayName>My Project</displayName>
      </configuration>
    </plugin>
  </plugins>
  <finalName>presentation</finalName>
</build>
  <dependencies>
    <dependency>
        <groupId>business</groupId>
        <artifactId>business</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <type>war</type>
    </dependency>
    <dependency>
        <groupId>integration</groupId>
        <artifactId>integration</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <type>jar</type>
    </dependency>

  </dependencies>
</project>

1 个答案:

答案 0 :(得分:0)

在目前的.pom中,你正在建立一个耳朵,你正在给与warModule相同的耳朵。

您应该在ear-plugin

中为webmodule提供.war制品