Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>One time, I modified my Ant build script to create a MANIFEST.MF file with the version number, amongst other information.</p> <p>Here's the most recent MANIFEST.MF file,</p> <pre><code>Manifest-Version: 1.0 Ant-Version: Apache Ant 1.6.5 Created-By: 19.0-b09 (Sun Microsystems Inc.) Main-Class: gov.bop.svnreport.SVNReportMain Built-By: Gilbert G. Le Blanc Built-On: 20111109-1437 Version: 1.1.1 Specification-Title: Subversion Commit Report Specification-Version: 1.1.1 Specification-Vendor: Federal Bureau of Prisons Class-Path: svnkit.jar </code></pre> <p>Here's the JAR target from the Ant script.</p> <pre><code>&lt;target name="jar" depends="compile"&gt; &lt;mkdir dir = "${jar}"/&gt; &lt;echo&gt;Jar directory - "${jar}"&lt;/echo&gt; &lt;manifest file="META-INF/MANIFEST.MF"&gt; &lt;attribute name="Main-Class" value="gov.bop.svnreport.SVNReportMain"/&gt; &lt;attribute name="Class-Path" value="svnkit.jar"/&gt; &lt;!-- This line puts your username into the manifest. Maybe you don't want to do that. --&gt; &lt;attribute name="Built-By" value="Gilbert G. Le Blanc"/&gt; &lt;attribute name="Built-On" value="${DSTAMP}-${TSTAMP}"/&gt; &lt;!-- This property was set by the svn-info task --&gt; &lt;!-- &lt;attribute name="Revision" value="${svnrevision}"/&gt; --&gt; &lt;!-- This property comes from the build.properties file --&gt; &lt;attribute name="Version" value="${app.version}"/&gt; &lt;attribute name="Specification-Title" value="Subversion Commit Report"/&gt; &lt;attribute name="Specification-Version" value="${app.version}"/&gt; &lt;attribute name="Specification-Vendor" value="Federal Bureau of Prisons"/&gt; &lt;/manifest&gt; &lt;jar jarfile="${jar}/${ant.project.name}.jar" manifest="META-INF/MANIFEST.MF"&gt; &lt;fileset dir="${build}/"&gt; &lt;patternset refid="all-classes"/&gt; &lt;/fileset&gt; &lt;fileset dir="." includes="${bin.includes}/"/&gt; &lt;/jar&gt; &lt;copy file="${jar}/${ant.project.name}.jar" todir="${deploy}" /&gt; &lt;copy file="${svnkit}" todir="${deploy}" /&gt; &lt;/target&gt; </code></pre> <p>I tried to get the Subversion version number into the MANIFEST.MF file, but I couldn't get that to work.</p> <p>A problem with this method is that it only works when you execute the Java application from the JAR file. If you try and pull these manifest properties from an IDE like Eclipse, <code>null</code> values are returned.</p>
    singulars
    1. This table or related slice is empty.
    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. 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