无法在maven中构建多个程序集。找不到装配描述符

时间:2016-04-06 14:50:47

标签: maven

我在使用程序集插件时尝试从maven项目生成两个或更多jar时遇到了一些麻烦。

我有以下maven pom.xml文件(见下文)。

但是,当我运行mvn clean compile assembly:single时,

我收到以下错误: Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:single (default-cli) on project hyuga: Error reading assemblies: No assembly descriptors found. -> [Help 1]

我错过了什么?

<plugin>
    <artifactId>maven-assembly-plugin</artifactId>
    <executions>
        <execution>
            <id>dg2cep</id>
            <configuration>
                <archive>
                    <manifest>
                        <mainClass>br.pucrio.inf.lac.konoha.hyuga.core.Bootstrap</mainClass>
                    </manifest>
                </archive>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
                <finalName>dg2cep</finalName>
            </configuration>
            <phase>package</phase> <!-- bind to the packaging phase -->
            <goals>
                <goal>single</goal>
            </goals>
        </execution>
        <execution>
            <id>playback</id>
            <configuration>
                <archive>
                    <manifest>
                        <mainClass>br.pucrio.inf.lac.konoha.hyuga.others.csv.CSVPlayback</mainClass>
                    </manifest>
                </archive>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
                <finalName>playback</finalName>
            </configuration>
            <phase>package</phase> <!-- bind to the packaging phase -->
            <goals>
                <goal>single</goal>
            </goals>
        </execution>
    </executions>
</plugin>

1 个答案:

答案 0 :(得分:1)

啊..你这样执行它:mvn ... assembly:single?如果是这样,请不要这样做..在生命周期中使用它,如mvn clean package ....