How to manipulate Manifest file with maven

岁酱吖の 提交于 2019-12-02 00:59:51

If you take a deeper look into maven-ear-plugin configuration you will find the archive configuration part which is exactly intended for such purposes.

This can be added to the configuration of the maven-ear-plugin:

<archive>
  <addMavenDescriptor/>
  <compress/>
  <forced/>
  <index/>
  <manifest>
    <addClasspath/>
    <addDefaultImplementationEntries/>
    <addDefaultSpecificationEntries/>
    <addExtensions/>
    <classpathLayoutType/>
    <classpathMavenRepositoryLayout/>
    <classpathPrefix/>
    <customClasspathLayout/>
    <mainClass/>
    <packageName/>
  </manifest>
  <manifestEntries>
    <key>value</key>
  </manifestEntries>
  <manifestFile/>
  <manifestSections>
    <manifestSection>
      <name/>
      <manifestEntries>
        <key>value</key>
      </manifestEntries>
    <manifestSection/>
  </manifestSections>
  <pomPropertiesFile/>
</archive>

Which gives you any opportunity you need.

I think can you look at the maven-shade-plugin and use the ManifestResourceTransformer to change the manifest for the jar.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!