Maven jar Plugin: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 34: Line 34:


<pre>
<pre>
</pre>
In general, to use arbitrary manifest entries, use the following syntax:
<pre>
...
<manifest>
  <manifestEntries>
      ...
      <key>value</key>
      ...
  </manifestEntries>
</manifest>
</pre>
</pre>

Revision as of 21:50, 9 May 2016

External

Internal

Overview

Declaring a Main Class in JAR

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        ...
        <configuration>
          <archive>
            <manifest>
              <addClasspath>true</addClasspath>
              <mainClass>fully.qualified.MainClass</mainClass>
            </manifest>
          </archive>
        </configuration>
        ...
      </plugin>


Other Manifest Customization

Adding arbitrary manifest entries:


In general, to use arbitrary manifest entries, use the following syntax:

...
<manifest>
   <manifestEntries>
      ...
      <key>value</key>
      ...
   </manifestEntries>
</manifest>