Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can do that with the <a href="http://maven.apache.org/plugins/maven-jar-plugin/">Maven JAR Plugin</a> during the creation of the JAR file. Add the following to your <code>pom.xml</code>:</p> <pre><code>&lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt; &lt;configuration&gt; &lt;archive&gt; &lt;addMavenDescriptor&gt;false&lt;/addMavenDescriptor&gt; &lt;manifestEntries&gt; &lt;Trusted-Library&gt;true&lt;/Trusted-Library&gt; &lt;/manifestEntries&gt; &lt;/archive&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-jarsigner-plugin&lt;/artifactId&gt; &lt;version&gt;1.2&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;sign&lt;/id&gt; &lt;goals&gt; &lt;goal&gt;sign&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;configuration&gt; &lt;keystore&gt;/path/to/testkeystore&lt;/keystore&gt; &lt;alias&gt;myalias&lt;/alias&gt; &lt;storepass&gt;test123&lt;/storepass&gt; &lt;/configuration&gt; &lt;/plugin&gt; </code></pre> <p>The main attributes as specified in the <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html#Main_Attributes">JAR File Specification</a> are available as dedicated elements, e.g.:</p> <pre><code>&lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt; &lt;configuration&gt; &lt;archive&gt; &lt;addMavenDescriptor&gt;false&lt;/addMavenDescriptor&gt; &lt;manifest&gt; &lt;addDefaultSpecificationEntries&gt;true&lt;/addDefaultSpecificationEntries&gt; &lt;addDefaultImplementationEntries&gt;true&lt;/addDefaultImplementationEntries&gt; &lt;/manifest&gt; &lt;manifestEntries&gt; &lt;Trusted-Library&gt;true&lt;/Trusted-Library&gt; &lt;/manifestEntries&gt; &lt;/archive&gt; &lt;/configuration&gt; &lt;/plugin&gt; </code></pre> <p>See the <a href="http://maven.apache.org/shared/maven-archiver/index.html">Maven Archiver Reference</a> for further information.</p> <p>To modify the manifest inside an existing jar file create a text file, e.g. <code>mymanifest.mf</code> which contains the required properties:</p> <pre><code>Trusted-Library: true </code></pre> <p>You can add the attributes of this file to an existing jar by executing the following command:</p> <pre><code>jar -cfm file-to-be-modified.jar mymanifest.mf </code></pre> <p>This will modify the <code>manifest.mf</code> inside the given jar.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload