Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8915179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:55:02+00:00 2026-06-15T04:55:02+00:00

How can i include .properties, .xml and other resource files while compiling the source

  • 0

How can i include .properties, .xml and other resource files while compiling the source code of a project using Ant? Here is my build file:

<?xml version="1.0"?>
<project name="NmzAzzist" basedir="." default="main">
    <property name="src.dir" value="Source/Myproj" />
    <property name="build.dir" value="ReleaseBuild/classes" />
    <property name="jar.dir" value="ReleaseBuild" />

    <path id="master-classpath">
        <fileset dir="lib">
            <include name="*.jar" />
        </fileset>
    </path>

    <target name="clean" description="Clean output directories">
        <delete dir="${build.dir}" />
    </target>

    <target name="build" description="Compile source tree java files">
        <echo>Compiling the source code</echo>
        <mkdir dir="${build.dir}" />
        <javac destdir="${build.dir}" source="1.5" target="1.5" includeantruntime="false">
            <compilerarg value="-Xlint:unchecked" />
            <src path="${src.dir}" />
            <classpath refid="master-classpath" />

        </javac>
    </target>

    <target name="jar" depends="build">
        <mkdir dir="${jar.dir}" />
        <echo>building jar!</echo>

        <jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${build.dir}">
            <manifest>
                <attribute name="Main-Class" value="com.ushustech.nmsazzist.NMSAzzistApp" />
            </manifest>
        </jar>
    </target>

    <target name="run" depends="jar">
        <java jar="${jar.dir}/${ant.project.name}.jar" fork="true" />
    </target>

    <target name="main" depends="clean,run" />

</project>

Right now my build is only compiling the Java files and producing classes. But I have some property and XML files in various folders (including the source folders), that I would like included in the output directory, that are not getting placed there now. I appreciate any suggestions in accomplishing this task.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T04:55:03+00:00Added an answer on June 15, 2026 at 4:55 am

    Copy those resources file before running jar task.

    <copy todir="${build.dir}">
        <fileset dir="${src.dir}">
           <exclude name="**/*.java"/>
        </fileset>
    </copy>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Maven2 to build a WAR project. Some properties files are dependent
These 4 files (build.xml, local.properties, projects.properties, proguard.cfg) are auto-generated when running: android update project
I am using OpenJPA's build time enhancement using ANT. Here is the project structure
Here is what I have- How I can include multiple keys and their values
I'm using a variant on code seen in How to make XMLDOMDocument include the
I want to include a jar file ( ant-contrib.jar ) in my ant build.xml
I have a spring project and using ANT to compile/deploy my war to Tomcat.
We are using XML to define a schema for controlling the contents which can
I'm using sonar to check my c# project. I would like to measure code
I wonder how a can include an pre-compiled binary in an iPhone application. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.