Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Ant script to download and configure the Netbeans platform, which enables Netbeans platform applications to be built without the IDE
Netbeans Platform Download-and-Config
Copyright 2013, 2016, Andrew Bythell <>
This Ant script is used to download and configure the Netbeans platform,
allowing Netbeans platform applications to be built without the IDE.
<project name="configure-platform" default="configure" basedir=".">
<property name="version" value="8.1"/>
These don't need to modified
<path id="basedir.path"> <pathelement path="${basedir}" /> </path>
<pathconvert targetos="unix" property="basedir.unix" refid="basedir.path"/>
<property name="netbeans" value="${basedir.unix}/netbeans-${version}"/>
<property name="bootstrap.url" value=""/>
<property name="netbeans.updatecenter.url" value="${version}/uc/final/distribution/catalog.xml.gz"/>
Download the Netbeans platform and build harness
<target name="download">
<mkdir dir="${netbeans}/harness"/>
<taskdef name="autoupdate"
<autoupdate installdir="${netbeans}" updatecenter="${netbeans.updatecenter.url}">
<modules includes=".*" clusters="harness[0-9]*"/>
<modules includes=".*" clusters="platform[0-9]*"/>
Configure the Netbeans build harness to use the downloaded platform
<target name="configure" depends="download">
<mkdir dir="nbproject/private"/>
<echo file="nbproject/private/">${basedir.unix}/nbproject/private/${line.separator}</echo>
<echo file="nbproject/private/">nbplatform.default.harness.dir=${nbplatform.default.netbeans.dest.dir}/harness${line.separator}</echo>
<echo file="nbproject/private/" append="true">nbplatform.default.netbeans.dest.dir=${netbeans}${line.separator}</echo>
Remove the downloaded platform and build harness. This allows the Netbeans IDE to set the paths
to the stock values.
<target name="clean">
<delete dir="nbproject/private" />
<delete dir="${netbeans}" />

This comment has been minimized.

Copy link

commented Feb 9, 2016

Hello @abythell, there is a little mistake in your script.
Line :23
There is a whitespace between /artifact nbbuild/
Your script has been really helpful, but still struggling to complete the build.



This comment has been minimized.

Copy link
Owner Author

commented Nov 7, 2016

Noted and corrected. Fixed outdated URLs. Updated to use platform version 8.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.