Building a NetBeans Platform Application from the Command Line (Part 2)

Building an Ant-based NetBeans Platform application from the command line on a build server is a typically a little different from building it on developer PC. In an earlier post I explored which ant targets are useful when building your application from the command line. In this post I explore what is different on a build server.

The nbproject/private folder in suite and module projects contain files that are specific to a particular developer’s PC. As such, this folder should typically not be checked into a source repository. And hence when a build server checks out the source code, that folder will not exist either.

That may seem unimportant. However, one of the properties that is specified in this way is the platform folder location. Without this property, the ant scripts will not know where to find the platform or even the build harness itself. There is luckily an easy way to specify these properties by adding some command line parameters to the ant call to build the suite:

[text]ant -Dnbplatform.default.netbeans.dest.dir=”C:Program FilesNetBeans 7.1″
-Dnbplatform.default.harness.dir=”C:Program FilesNetBeans 7.1harness”
-f build.xml build[/text]

Note that this is all one command – the multiple lines above are just for the sake of readability.

Read my series of articles On the NetBeans Platform Build System for more information regarding the build harness.

Instructional designer, educational technologist and occasional lecturer who loves travel and photography

2 thoughts on “Building a NetBeans Platform Application from the Command Line (Part 2)”

  1. Oddly enough, the build.xml file is no longer created or used for java projects. To see this, clone an build a new 7.2 netbeans. Now create a new Java project. No build.xml!!

    Do you know where it went, or how to add/override ant targets in 7.2?
    Thanks!

    Reply
    • I normally just use the latest development build from the NetBeans site. That way I don’t have to clone and build it. 🙂

      With the development build of 2012-03-25, I created a standard Java Application, and it does have a build.xml file. Exactly what type of project did you create? All of the Java projects should use Ant (and hence have a build.xml file when created), besides the ones in the Maven category (those will use Maven and have a pom.xml created instead).

      Reply

Leave a Reply to Hermien Pellissier Cancel reply