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.JDK 6
25.JNDI LDAP
26.JPA
27.JSP
28.JSTL
29.Language Basics
30.Network Protocol
31.PDF RTF
32.Reflection
33.Regular Expressions
34.Scripting
35.Security
36.Servlets
37.Spring
38.Swing Components
39.Swing JFC
40.SWT JFace Eclipse
41.Threads
42.Tiny Application
43.Velocity
44.Web Services SOA
45.XML
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
SCJP
Java » Ant » JarScreenshots 
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
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.