Maven error creating assembly - The destination di

2019-07-04 12:07发布

I am trying to use maven-assembly-plugin to aggregate a single module application with another application. This is the error I am receiving:

--- 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]

I believe I'm getting this error because the target folder contains the vapor-sim-1.0-SNAPSHOT.jar and during the assembly process this file is copied into the components directory for the eventual zip. But I'm not sure.

All I have to compare is a multi-module aggregate assembly that I got to work with the single-module aggregate assembly that is failing. This is what the multi-module and single-module target folders respectively look like:

enter image description here

Notice above there is no vapor-1.0-SNAPSHOT.jar file, only the aggregate zip files. Now, notice in the below image, we didn't get an aggregate zip file and we do have the vapor-sim-1.0-SNAPSHOT.jar file.

enter image description here

If we drill down into vapor and vapor-sim directories we should eventually find the vapor-1.0-SNAPSHOT.jar and the vapor-sim-1.0-SNAPSHOT.jar respectively.

This is my POM file:

<?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>

This is my assembly file:

<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>

Any suggestions would be greatly appreciated.

0条回答
登录 后发表回答