Maven: How do I mark a jar as sealed?

依然范特西╮ 提交于 2021-02-19 02:52:25

问题


This sounds so simple, so why an I struggling?

Is there a POM entry I can use to seal all the packages?

Or do I provide a manifest with value 'Sealed: true'?

Thanks Jeff Porter


回答1:


> Or do I provide a manifest with value 'Sealed: true'?

As explained in "Manifest Customization":

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.6</version>
        <configuration>
          <archive>
            <manifestEntries>
              <Sealed>true</Sealed>
            </manifestEntries>
          </archive>
        </configuration>
        ...
      </plugin>
    </plugins>
  </build>
  ...
</project>


来源:https://stackoverflow.com/questions/13527235/maven-how-do-i-mark-a-jar-as-sealed

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