maven-semembly-plugin d dy dy not of target/class farget/class伪像在生成的jarfat中,但meta-inf/sustest.mf似乎是正确的

发布于 2025-02-13 15:25:48 字数 1155 浏览 0 评论 0原文

Maven-Asembly-Plugin在生成的FATJAR中没有添加目标/类工件,但是Meta-Inf/subest.mf似乎是正确的。我正在使用3.4.0插件版本。

请参阅下面从pom.xml提取的相关构建段:

<plugin>
  <artifactId>maven-assembly-plugin</artifactId>
  <version>3.4.0</version>
  <configuration>
    <archive>
      <manifest>
        <addClasspath>true</addClasspath>
        <mainClass>my_package.Main</mainClass>
      </manifest>
    </archive>
    <descriptorRefs>
      <descriptorRef>jar-with-dependencies</descriptorRef>
    </descriptorRefs>
  </configuration>
</plugin>

下面的此命令并未显示

jar -tvf target/my-fat-jar.jar | grep Main.class

我的主要类别和其他项目工件的任何内容,并未通过maven-sepembly-plugin

编辑:< /strong>我用其他版本的插件(3.2.0,2.2,...)对其进行了测试,并且它不起作用。但是,如果我将版本从3.4.0更改为2.2-beta-5 fatjar的生成正确。版本2.2-Beta-5来自2009年12月6日,即非常旧。我想使用较新的版本。有什么想法吗?

The maven-assembly-plugin doesn't add target/class artifacts in generated fatjar but META-INF/MANIFEST.MF seems to be correct. I'm using the 3.4.0 plugin version.

See below the relevant build segment extracted from pom.xml:

<plugin>
  <artifactId>maven-assembly-plugin</artifactId>
  <version>3.4.0</version>
  <configuration>
    <archive>
      <manifest>
        <addClasspath>true</addClasspath>
        <mainClass>my_package.Main</mainClass>
      </manifest>
    </archive>
    <descriptorRefs>
      <descriptorRef>jar-with-dependencies</descriptorRef>
    </descriptorRefs>
  </configuration>
</plugin>

this command below does not show anything

jar -tvf target/my-fat-jar.jar | grep Main.class

My main class and other project artifacts are not added in fatjar by maven-assembly-plugin

Edit: I tested it with other versions of the plugin (3.2.0, 2.2, ...) and it didn't work. However if I change the version from 3.4.0 to 2.2-beta-5 the fatjar is generated correctly. Version 2.2-beta-5 is from 12/06/2009, ie very old. I would like to use a newer version. Any idea ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文