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 8071695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:46:16+00:00 2026-06-05T13:46:16+00:00

When I compile my project in Netbeans, I want to automatically generate a file

  • 0

When I compile my project in Netbeans, I want to automatically generate a file that includes a build number that automatically increments and date, so I added the following to my projects build.xml file.

<target name="-pre-jar" >
    <propertyfile file="${src.dir}\buildstring.txt" >
        <entry key="devbuild" value="1" type="int" operation="+"/>
        <entry key="devbuildtime" type="date" value="now" pattern="yyyy MM dd hh_mm" />
    </propertyfile>
</target>

When the Ant task executes, Ant automatically adds a date stamp as the first line of the file

#Tue, 12 Jun 2012 16:09:24 -0500
devbuild=8
devbuildtime=2012 06 12 04_09

Is there any way to stop Ant from automatically adding the first line with the date comment?

  • 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-05T13:46:17+00:00Added an answer on June 5, 2026 at 1:46 pm

    The PropertyFile Ant task is implemented using a java.util.Properties object. The Properties.store() method is documented with the following note:

    Next, a comment line is always written, consisting of an ASCII # character, the current date and time (as if produced by the toString method of Date for the current time), and a line separator as generated by the Writer.

    Therefore, the date comment cannot be disabled using the PropertyFile task. Removing the date comment would require a different solution, such as post-processing the properties file or writing the properties file using a different technique (for example, using an Ant script or custom Ant task).

    See: Remove comments in properties file java

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to build and run my project in Netbeans. I generated a simple
I have a NetBeans project that I'm trying to compile manually from command-line ant
When I compile my project without any files opened the build succeeds as expected.
While trying to compile my project, that uses some third party headers, with mingw
I'm trying to compile a project that uses both libjpeg and libpng. I know
I have a problem now : When I want to compile my project in
I have a NetBeans project that relies on one specific Java class in another
I try to compile a ( LWJGL ) Java project using NetBeans . I
Has anyone successfully created a NetBeans project that combines Clojure and Java source? I
In a NetBeans Mobility Project I have attached a zip file to the Resources

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.