Jar file with fileset and exclude : Jar « Ant « Java

Home
Java
1.2D Graphics GUI
2.3D
3.Advanced Graphics
4.Ant
5.Apache Common
6.Chart
7.Class
8.Collections Data Structure
9.Data Type
10.Database SQL JDBC
11.Design Pattern
12.Development Class
13.EJB3
14.Email
15.Event
16.File Input Output
17.Game
18.Generics
19.GWT
20.Hibernate
21.I18N
22.J2EE
23.J2ME
24.JavaFX
25.JDK 6
26.JDK 7
27.JNDI LDAP
28.JPA
29.JSP
30.JSTL
31.Language Basics
32.Network Protocol
33.PDF RTF
34.Reflection
35.Regular Expressions
36.Scripting
37.Security
38.Servlets
39.Spring
40.Swing Components
41.Swing JFC
42.SWT JFace Eclipse
43.Threads
44.Tiny Application
45.Velocity
46.Web Services SOA
47.XML
Java » Ant » Jar 




Jar file with fileset and exclude
 
<?xml version="1.0"?>

<!--
 -  build.xml file for LBS logics aMorph build process (for Ant Version 1.6)
 -
 -  (cLBS logics MBT GmbH,
 -      Austria
 -      www.lbs-logics.com
 -
 - $Id: build.xml,v 1.1 2005/01/18 07:26:05 hanzz Exp $
 -->

<!--
/*
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
-->

<project name="amorph"  default="build"  basedir=".">

  <!-- PH20050118: introduced ant build script, targets to come... -->
  
  <!-- The classpath to be used to compile the project -->
  <path id="base.classpath">
    <fileset dir="lib">
      <include name="**/*.jar"/>
    </fileset>
  </path>
  
  <target name="init">
    <mkdir dir="build" />
    <mkdir dir="build/classes"/>
  </target>
  
  <target name="compile">
    <javac srcdir="src" destdir="build/classes">
      <classpath refid="base.classpath" />
    </javac>
  </target>
  
  <target name="build" description="compiles and packs the project" depends="init,compile">
    <jar destfile="build/amorph.jar"
           basedir="build/classes"  >
      <fileset dir=".">
        <exclude name="build/**/*.*"/>
        <exclude name=".classpath"/>
        <exclude name=".project"/>
        <exclude name="bin/**/*.*"/>
      </fileset>
    </jar>  
  </target>

</project>

   
  














Related examples in the same category
1.Ant task: jar
2.Jar with includes and excludes using filesets
3.Jar with includes and excludes
4.Generates java2s.jar
5.Ant jar file setting the Main-Class
6.Jar file: exclude files
7.More than one filesets for jar
8.Add attribute to jar file manifest
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.