首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在使用maven-shade-plugin时添加DefaultImplementationEntries到清单?

如何在使用maven-shade-plugin时添加DefaultImplementationEntries到清单?
EN

Stack Overflow用户
提问于 2021-07-04 23:41:18
回答 1查看 56关注 0票数 1

找到这个关于如何添加版本到manifest.mf:How do I add an Implementation-Version value to a jar manifest using Maven?的问题,但是在使用shade插件时如何添加它们?

我在我的pom.xml maven-shade-plugin中尝试了:

代码语言:javascript
复制
<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>

然而,我可以看到一个错误:

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-07-04 23:59:09

我认为你也许应该使用<manifestEntries>参见例如THIS

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68246377

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档