maven-2 - Maven 程序集插件

标签 maven-2 assemblies manifest

我正在尝试向 maven-assembly-plugin 生成的 jar 添加一个类路径。程序集 bulids,除了 list 没有类路径。下面是我的配置。任何帮助,将不胜感激。谢谢!

<plugin>
  <artifactId>maven-assembly-plugin</artifactId>
  <executions>
    <execution>
      <id>make-assembly</id>
      <phase>package</phase>
      <goals>
        <goal>assembly</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <descriptors>
      <descriptor>assembly/package.xml</descriptor>
    </descriptors>
    <archive>
      <manifest>
        <mainClass>mymain.Main</mainClass>
        <addClasspath>true</addClasspath>
      </manifest>
    </archive>
  </configuration>
</plugin>

最佳答案

我看到您正在使用自定义程序集描述符。但是插件的文档页面有关于 <archive> 的说明。元素:

At this point, only the jar assembly format supports the <archive> configuration element. By definition, directory-based assembly mojos - assembly:directory, assembly:directory-inline, and assembly:directory-single - do not produce a jar-format archive, and therefore do not support the <archive> element.

关于maven-2 - Maven 程序集插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1074603/

相关文章:

java2ws长类路径maven

.net - 程序集 "is not signed correctly."警告

android - 'target' 文件中的 'project.properties' 设置和 list 中的 'android:targetSdkVersion' 标签有什么区别?

c# - 在 SSIS 脚本任务静态构造函数中访问可配置值

android - 如何在Android上查明应用程序是否已移动到SD卡

android - 每次重建时,库中的 AppCompat-v7 都会将最低 sdk 版本更改为 7。我怎样才能永久修复它?

管理 CSS 爆炸和/或重用的 Java 库?

maven-2 - 调试Maven的 "The artifact has no valid ranges"

apache-flex - 如何使用 Maven 构建 Adob​​e Air 项目?

.net - 检测程序集是否是为 .NET Compact Framework 构建的