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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:11:28+00:00 2026-05-26T09:11:28+00:00

I have couple of Netbeans projects with dependencies among them. By default, netbeans creates

  • 0

I have couple of Netbeans projects with dependencies among them. By default, netbeans creates build and dist folders under Project root folder when you build. I was able to change it to a common folder outside projects using relative paths. All I had to do was change build.dir and dist.dir properties in nbproject/project.properties file. When I build under the IDE, everything is building fine under common folder specified in the project file.

We have promotion build process that expects to generate all the generated class files (the jar files etc) under a specific build folder. This folder changes based on how a user invoked configure script for the whole system.

Lets say this directory is available in shell environment variable BUILD_ROOT.
What I am wondering is if there is a way to override build.dir and dist.dir that project.properties is specifying on ant command line when the build is invoked. That way I can reuse the same build system and generate the binaries where I want without changing project.properties file.

Currently we are maintaining separate ant build scripts for promotion vs IDE builds.

I appreciate any pointers.

Thanks
Video guy

  • 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-05-26T09:11:29+00:00Added an answer on May 26, 2026 at 9:11 am

    I figured out how. Ant lets you define properties on command line with -Dpropname=value. Once a property is assigned a value, Ant will ignore any assignment for that variable that it comes across in the xml/.properties files.

    1) First I edited nbproject/project.properties file and added a variable for toplevel build dir. Then I changed build.dir and dist.dir to use this variable.


    buildroot.dir=../../out
    build.dir=${buildroot.dir}/myprojname

    dist.dir=${buildroot.dir}/dist

    2) Then I made sure it works under Netbeans. When you go into Netbeans property panel for project, it showed the directory value right.

    3) Added a target in a Makefile to invoke this project like below.

    ant -f build.xml -Dbuildroot.dir=$(BUILD_ROOT)/java/out

    That was able to build my target on Linux build server in the master build directory. Basically the source folders are clean without any build related remnants.

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

Sidebar

Related Questions

I have a simple POJO library (build using NetBeans 7.1) and couple of projects
I have couple of bat files which run further files to build the project.
I have designed this gui in netBeans which has a canvas , a couple
I have couple of input fields with the class link. All of them should
I have couple of lib files and I want to use in my project.
I have couple .c files in my java project. How to achieve in Eclipse
I have couple of websites on php. I want to mobile enable them so
I have couple of questions that about mixing code: a complete project based on
I have couple questions regarding some C++ rules. Why am I able to call
I have couple resource DLLs that I currently load when application starts using following

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.