java - 使用 maven-shade-plugin 时如何将 DefaultImplementationEntries 添加到 MANIFEST?
问题描述
发现这个关于如何向 manifest.mf 添加版本的问题:如何使用 Maven 向 jar 清单添加一个 Implementation-Version 值?,但是在使用 shade 插件时如何添加它们?
我在我的 pom.xml maven-shade-plugin 中尝试了什么:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<finalName>ispf-win</finalName>
<shadedArtifactAttached>shade</shadedArtifactAttached>
<outputDirectory>${project.build.directory}/ispf-win</outputDirectory>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>desktop.win.main.Main</mainClass>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
但是我可能会出错:
Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade (default) on project desktop.win:
Unable to parse configuration of mojo org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade for parameter addDefaultI
mplementationEntries: Cannot find 'addDefaultImplementationEntries' in class java.util.jar.Manifest
解决方案
我认为您可能更应该使用<manifestEntries>
See eg THIS
推荐阅读
- r - 隐藏闪亮数据表中的列,但保持可搜索
- javascript - 匹配的字符串不会在 Javascript 中触发条件
- python - Python将变量传递到有效负载400错误
- python - 带有颜色编码的动画散点图会失去颜色(Python / Plotly)
- hacklang - 如何在 Hacklang 中将元组转换为 vec 或 varray?
- mobile - 我的引导网站的移动版本不工作
- blazor - 如何在 Blazor 应用程序中实现多选下拉列表?
- bash - 如何在for循环中跳过ls的第一个元素
- mongodb - 如何在数组 Mongoose 的对象中填充 2 个 id
- c++ - 带有自定义散列函数和比较谓词的 unordered_map 会产生编译错误