无法执行目标org.apache.maven.plugins:maven-install-plugin:2.4:在项目上安装(默认安装)

时间:2017-10-11 15:02:54

标签: java maven

我正试图从Maven运行中获取爆炸的war文件。 有一个父项目(MyApp)和另外两个项目一个用于ORM(MyApp-Orm),一个用于视图部分(MyApp-Web),它依赖于用于构建的父项目。 即是MyApp    
MyApp-Orm    
MyApp-Web
当尝试运行maven安装时遇到异常: - Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install (default-install) on project MyApp-Web: The packaging for this project did not assign a file to the build artifact

我的Pom.xml是: -
1)MyApp - pom.xml

<modelVersion>4.0.0</modelVersion>
  <groupId>MyApp</groupId>
  <artifactId>MyApp</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>pom</packaging>
  <name>MyApp</name>
  <description>MyApp</description>
  --- different dependencies---  
  <build>
<pluginManagement>
    <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
               <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>default-war</id>
                        <phase>none</phase>
                    </execution>
                    <execution>
                        <id>war-exploded</id>
                        <phase>package</phase>
                        <goals>
                            <goal>exploded</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
    </plugins>
</pluginManagement>
</build>


2)MyApp-Web-pom.xml

<modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>MyApp</groupId>
    <artifactId>MyApp</artifactId>
    <version>0.0.1-SNAPSHOT</version>
  </parent>
  <artifactId>MyApp-Web</artifactId>
  <packaging>war</packaging>
  <name>MyApp Web</name> 

  --- different dependencies---
    <build>
        <finalName>MyApp Web</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <fork>true</fork>
                    <compilerVersion>1.7</compilerVersion>
                    <verbose>true</verbose>
                </configuration>
            </plugin>
        </plugins>
  </build>


3)MyApp-Orm - pom.xml

<modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>MyApp</groupId>
    <artifactId>MyApp</artifactId>
    <version>0.0.1-SNAPSHOT</version>
  </parent>
  <artifactId>MyApp-Orm</artifactId>
  <name>MyApp Orm</name>
  <packaging>jar</packaging>

  --- different dependencies---

  <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <fork>true</fork>
                    <compilerVersion>1.7</compilerVersion>
                    <verbose>true</verbose>
                </configuration>
            </plugin>
        </plugins>

        <finalName>MyApp Orm</finalName>
    </build>

我错过了pom中的任何配置吗?

0 个答案:

没有答案