Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/331.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 无法在项目上执行目标org.apache.maven.plugins:maven安装plugin:2.4:install(默认安装)_Java_Maven - Fatal编程技术网

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

Java 无法在项目上执行目标org.apache.maven.plugins:maven安装plugin:2.4:install(默认安装),java,maven,Java,Maven,我正在尝试从Maven run获取爆炸战争文件。 有一个父项目(MyApp)和两个其他项目,一个用于ORM(MyApp ORM),一个用于视图部分(MyApp Web),它依赖于父项目进行构建。 i、 eMyApp MyApp Orm MyApp网站 尝试在project MyApp Web上运行maven install时出现以下异常:-未能执行目标org.apache.maven.plugins:maven install plugin:2.4:install(默认安装):此项目的打包未将文

我正在尝试从Maven run获取爆炸战争文件。 有一个父项目(MyApp)和两个其他项目,一个用于ORM(MyApp ORM),一个用于视图部分(MyApp Web),它依赖于父项目进行构建。 i、 e
MyApp
MyApp Orm
MyApp网站
尝试在project MyApp Web上运行maven install时出现以下异常:-
未能执行目标org.apache.maven.plugins:maven install plugin:2.4:install(默认安装):此项目的打包未将文件分配给生成工件


我的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>
<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>
4.0.0
MyApp
MyApp
0.0.1-快照
聚甲醛
MyApp
MyApp
---不同的依赖关系--
org.apache.maven.plugins
maven战争插件
3.2.0
默认战争
没有一个
战争爆发了
包裹
爆炸了的

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>
4.0.0
MyApp
MyApp
0.0.1-快照
MyApp网站
战争
MyApp网站
---不同的依赖关系---
MyApp网站
org.apache.maven.plugins
maven编译器插件
1.7
1.7
真的
1.7
真的

3)MyApp Orm--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>
<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>
4.0.0
MyApp
MyApp
0.0.1-快照
MyApp Orm
MyApp Orm
罐子
---不同的依赖关系---
org.apache.maven.plugins
maven编译器插件
1.7
1.7
真的
1.7
真的
MyApp Orm


我是否缺少pom中的任何配置?

maven安装插件需要war文件。如果要告诉maven war插件只生成war分解目录,请在执行
默认war
时将
none
阶段设置为
package
,以生成这两个目录。请遵循此处违反的配置约定。只需在pluginManagement中的myapppom文件中定义maven-war插件一次,即可定义版本。在你的另一个pom中,你只定义了打包
war
nothing.还定义了maven编译器pugin,它的配置在你定义maven war插件的父级中…maven安装插件需要war文件。如果要告诉maven war插件只生成war分解目录,请在执行
默认war
时将
none
阶段设置为
package
,以生成这两个目录。请遵循此处违反的配置约定。只需在pluginManagement中的myapppom文件中定义maven-war插件一次,即可定义版本。在你的另一个pom中,你只定义了打包
war
nothing.还定义了maven编译器pugin,它的配置在你定义maven-war插件的父级中。。。