Automated builds with Netbeans Platform 8.0.2
I've been converting UGS to run on the Netbeans Platform over the past week, and in general its been great. The features and documentation I used while migrating UGS away from Swing were very well done. So aside from a couple hiccups, the Netbeans Platform has been great. Until a few days ago when I decided it was time to integrate my new changes with my Jenkins CI server.
It turns out that you can't build a Netbeans Platform application without connecting to the Netbeans IDE first. This has to do with the extra modules, platform components and build harness. Searching the subject online provides a lot of documentation, everything I've found is either out dated, contradictory, or I could only get it working with a new project and not my existing one.
The final solution was so simple, and minimally invasive that I wanted to create this blog post.
There are 4 interesting files for a Netbeans Platform build:
It turns out that you can't build a Netbeans Platform application without connecting to the Netbeans IDE first. This has to do with the extra modules, platform components and build harness. Searching the subject online provides a lot of documentation, everything I've found is either out dated, contradictory, or I could only get it working with a new project and not my existing one.
The final solution was so simple, and minimally invasive that I wanted to create this blog post.
There are 4 interesting files for a Netbeans Platform build:
build.xml - Some documentation suggests adding a download-netbeans-rcp target here. That isn't needed. If you have a custom target you can put it here, otherwise there is no need to modify this file.The Netbeans Platform has facilities built into its build script to download all required files. platform.properties is where you need to specify what it should download.
nbproject/build-impl.xml - This is loaded by build.xml, don't modify this file.
nbproject/project.properties - This file seems to identify your modules and the applications name, no need to modify this file either.
nbproject/platform.properties - Modify this file!
# These are used later in the build script
nbplatform.active.dir=${suite.dir}/latestStableBuild
suite.dir=${basedir}
harness.dir=${nbplatform.active.dir}/harness
# Provide some URLs
bootstrap.url=http://deadlock.netbeans.org/hudson/job/nbms-and-javadoc/lastStableBuild/artifact/nbbuild/netbeans/harness/tasks.jar
autoupdate.catalog.url=http://dlc-cdn.sun.com/netbeans/updates/8.0.2/uc/final/distribution/catalog.xml.gz
Thats it! It probably took me 5+ hours to find that. Now I can run "ant build-zip" on my Jenkins server and get a zip archive in return.
good post
ReplyDeleteIs it possible to incorporate a maven build of a netbeans platform application with jenkins?
ReplyDeleteYes you can build a netbeans platform application from the command line with Maven as well. I believe "mvn package" will create a universal zip file that you could deploy. The installers can be built with "mvn package -P deployment"
ReplyDelete