title: Ant task to build a MANIFEST.MF only
body: <p>I am using IntelliJ to do JavaEE applications development. Artefacts include ****.gar (Coherence application), about 5 of *****.ear(EJB applications and web applications).</p>
  
  <p>In my understanding, ant was used to build application jar, war,ear etc. But I am not plan to use ant to build or rebuild my applications as IntelliJ will do it by their own way.</p>
  
  <p>What Im trying now? I am trying to use ant to create a MANIFEST.MF file and put it into my application src/META-INF/ when I build or rebuild my JavaEE artifacts. As IntelliJ provide a way to execute some Pre-processing or Post-processing ant task to accompany with IntelliJ build process.</p>
  
  <p>I tried to find some example ant build code such as: build.xml over Internet. Unfortunately, they are all talking about create a jar/ear/war or some thing else that include a MANIFEST.MF as well. </p>
  
  <p>My question is: Is there way to create a single MANIFEST.MF only by ant, if it is, please share that build.xml!</p>
  
  <p>Lots thanks!</p>
  
  <p><strong>After get advice from friend @Santosh who commented my thread. I got it works fine now.</strong></p>
  
  <p>XML file example as:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;project name="OzsscJPACoherence" basedir="."&gt;
  
    &lt;property name="projectName" value="OzsscJPACoherence" /&gt;
    &lt;property name="libsSrc" value="libs"/&gt;
    &lt;property name="srcDir" value="../../src"/&gt;
    &lt;property name="artDir" value="../../../out/artifacts"/&gt;
    &lt;property name="distDir" value="${artDir}/OzsscJPACoherence_jar"/&gt;
    &lt;property name="build" value="build"/&gt;
    &lt;property name="classes" value="build/classes"/&gt;
    &lt;property name="jar" value="build/jar"/&gt;
    &lt;property name="libs" value="build/libs"/&gt;
    &lt;property name="version" value="2.5"/&gt;
  
    &lt;tstamp&gt;
      &lt;format property="TODAY" pattern="yyMMdd-HHmmss"  locale="en,AU" /&gt;
    &lt;/tstamp&gt;
  
    &lt;path id="classpath"&gt;
      &lt;fileset dir="${libsSrc}" includes="*.jar"/&gt;
    &lt;/path&gt;
  
    &lt;target name="jpacoh"&gt;
      &lt;mkdir dir="${distDir}/META-INF" /&gt;
      &lt;manifest file="${distDir}/META-INF/MANIFEST.MF"&gt;
          &lt;attribute name="Manifest-Version" value="1.0"/&gt;
          &lt;attribute name="Extension-List" value="coherence active-cache"/&gt;
          &lt;attribute name="coherence-Extension-Name" value="coherence"/&gt;
          &lt;attribute name="active-cache-Extension-Name" value="active-cache"/&gt;
          &lt;attribute name="Built-By" value="${user.name}"/&gt;
          &lt;attribute name="Specification-Title" value="${projectName}"/&gt;
          &lt;attribute name="Specification-Version" value="${version}"/&gt;
          &lt;attribute name="Specification-Vendor" value="StorageWay Australia"/&gt;
          &lt;attribute name="Implementation-Title" value="${projectName}"/&gt;
          &lt;attribute name="Implementation-Version" value="${version} ${TODAY}"/&gt;
          &lt;attribute name="Implementation-Vendor" value="StorageWay Australia"/&gt;
  
      &lt;/manifest&gt;
      &lt;jar manifest="${distDir}/META-INF/MANIFEST.MF" jarfile="${distDir}/OzsscJPACoherence.jar"/&gt;
    &lt;/target&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>And add ant task to related module as pre-processing task, rebuild artifact. MANIFEST.MF was created properly.</p>
  
  <p>Hope this thread will help any one else in the same situation.</p>
  
  <p>Thanks you guys help!</p>