Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/326.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 Maven创建程序集时出错-目标目录不能包含自身_Java_Maven_Netbeans_Maven Assembly Plugin - Fatal编程技术网

Java Maven创建程序集时出错-目标目录不能包含自身

Java Maven创建程序集时出错-目标目录不能包含自身,java,maven,netbeans,maven-assembly-plugin,Java,Maven,Netbeans,Maven Assembly Plugin,我正在尝试使用maven assembly插件将单个模块应用程序与另一个应用程序聚合。这是我收到的错误: --- maven-assembly-plugin:2.4:single (make-assembly) @ vapor-sim --- Reading assembly descriptor: src/assemble/assembly.xml Copying files to C:\Users\pdl\Projects\Vapor-Head\08_Source_Code\vaporsim

我正在尝试使用maven assembly插件将单个模块应用程序与另一个应用程序聚合。这是我收到的错误:

--- maven-assembly-plugin:2.4:single (make-assembly) @ vapor-sim ---
Reading assembly descriptor: src/assemble/assembly.xml
Copying files to C:\Users\pdl\Projects\Vapor-Head\08_Source_Code\vaporsim\target\vapor-sim
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 3.274s
Finished at: Fri Oct 16 11:40:20 CDT 2015
Final Memory: 18M/225M
------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.4:single (make-assembly) on project vapor-sim: Failed to create assembly: Error creating assembly archive runtime: The destination directory cannot include itself. -> [Help 1]
我相信我会遇到这个错误,因为目标文件夹包含vapor-sim-1.0-SNAPSHOT.jar,并且在组装过程中,该文件被复制到components目录中,以获得最终的zip文件。但我不确定

我所要比较的是一个多模块聚合程序集,我用它来处理失败的单模块聚合程序集。这是多模块和单模块目标文件夹的外观:

请注意,上面没有vapor-1.0-SNAPSHOT.jar文件,只有聚合zip文件。现在,请注意,在下图中,我们没有得到聚合zip文件,我们有vapor-sim-1.0-SNAPSHOT.jar文件

如果我们深入到vapor和vapor-sim目录,最终将分别找到vapor-1.0-SNAPSHOT.jarvapor-sim-1.0-SNAPSHOT.jar

这是我的POM文件:

<?xml version="1.0" encoding="UTF-8"?>
<!-- VaporSim\pom -->
<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>com.b3l</groupId>
    <artifactId>vapor-sim</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <name>Vapor Sim</name>

    <dependencies>
        <dependency>
            <groupId>io.bigio</groupId>
            <artifactId>bigio-runtime</artifactId>
            <type>zip</type>
            <version>1.2</version>
        </dependency>
        <dependency>
            <groupId>com.b3l</groupId>
            <artifactId>vapor-runtime</artifactId>
            <version>1.0-SNAPSHOT</version>
            <type>zip</type>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <finalName>vapor-sim</finalName>
                    <appendAssemblyId>false</appendAssemblyId>
                    <descriptors>
                        <descriptor>src/assemble/assembly.xml</descriptor>
                    </descriptors>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

</project>

4.0.0
com.b3l
蒸汽模拟
1.0-快照
罐子
蒸汽模拟
比乔
bigio运行时
拉链
1.2
com.b3l
蒸汽运行时间
1.0-快照
拉链
maven汇编插件
2.4
蒸汽模拟
假的
src/assembly/assembly.xml
组装
包裹
单一的
UTF-8
1.8
1.8
这是我的程序集文件:

<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
    <id>runtime</id>
    <formats>
        <format>dir</format>
        <format>zip</format>
        <format>tar.gz</format>
    </formats>
    <dependencySets>
        <dependencySet>
            <outputDirectory>/</outputDirectory>
            <unpack>true</unpack>
            <includes>
                <include>io.bigio:bigio-runtime:zip:1.2</include>
            </includes>
            <unpackOptions>
                <excludes>
                    <exclude>**/logback.xml</exclude>
                </excludes>
            </unpackOptions>
        </dependencySet>
        <dependencySet>
            <outputDirectory>bigio/lib</outputDirectory>
            <includes>
                <include>com.b3l:utilities</include>
                <include>com.googlecode.efficient-java-matrix-library:ejml</include>
                <include>log4j:log4j</include>
            </includes>
        </dependencySet>
        <dependencySet>
            <outputDirectory>bigio/components</outputDirectory>
            <includes>
                <include>com.b3l:vapor-sim</include>
            </includes>
        </dependencySet>
    </dependencySets>
    <fileSets>
        <fileSet>
            <outputDirectory>bigio/inputs</outputDirectory>
            <includes>
                <include>*/**</include>
            </includes>
        </fileSet>
        <fileSet>
            <directory>config</directory>
            <outputDirectory>bigio/config</outputDirectory>
            <includes>
                <include>*/**</include>
            </includes>
        </fileSet>
        <fileSet>
            <directory>scripts</directory>
            <outputDirectory>bigio</outputDirectory>
            <includes>
                <include>*/**</include>
            </includes>
        </fileSet>
        <fileSet>
            <directory>./</directory>
            <outputDirectory>bigio/outputs</outputDirectory>
            <excludes>
                <exclude>*/**</exclude>
            </excludes>
        </fileSet>
    </fileSets>
</assembly>

运行时
迪尔
拉链
tar.gz
/
真的
bigio:bigio运行时:zip:1.2
**/logback.xml
bigio/lib
com.b3l:公用事业
高效的java矩阵库:ejml
log4j:log4j
bigio/组件
com.b3l:vapor sim
bigio/输入
*/**
配置
bigio/config
*/**
剧本
比吉奥
*/**
./
bigio/输出
*/**

如有任何建议,将不胜感激

我建议您检查程序集描述符中的最后一个文件集条目是否与罪魁祸首相似?@khmarbaise-您完全正确。我是个初学者!你能给我一个答案,告诉我这个文件集出了什么问题吗?我会给你答案和要点。非常感谢。