Maven 程序集:读取程序集时出错:带有 ID 的描述符

问题描述

我尝试在项目上导入 Maven 程序集依赖项,例如本页上的描述:http://maven.apache.org/plugins/maven-assembly-plugin/examples/sharing-descriptors.html

因此,在项目 A 上,我创建了一个名为 abc-resources 的程序集,它是一个包含一些 txt 文件的 jar 文件。 我的目标是将这个 jar 导入另一个项目(就像任何其他 Maven 依赖项一样)。

因此,在我的新项目中,我使用以下代码创建了一个 pom.xml :

<build>
       ...
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.1.0</version>
                <dependencies>
                    <dependency>
                        <groupId>mycompany.group.id</groupId>
                        <artifactId>myartifactid</artifactId>
                        <version>LATEST</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <!-- This is where we use our shared assembly descriptor -->
                            <descriptorRefs>
                                <descriptorRef>abc-resources</descriptorRef>
                            </descriptorRefs>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

但我总是收到一个错误

未能在项目 myNewProject 上执行目标 org.apache.maven.plugins:maven-assembly-plugin:3.1.0:single (make-assembly): Error reading assembly: Descriptor with ID 'abc-resources' not found - > [帮助1] 我试过 src/main/assembly/abc-resources,src/main/assembly/abc-resources.xml,... (abc-resources.xml 是用于在项目 A 上创建程序集的文件名(在路径 src/main/assembly 中)。 你知道怎么回事吗?

提前致谢

蒂格鲁

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)