NetBeans build files are never fixed

My current team has standardized NetBeans for our entire Java development, and we use the ANT files created in NetBeans as our official build process.

But the files are always wrong.

Different team members use different versions of NetBeans, and obviously they all generate slightly different build-impl.xml files. Thus, when launched, the NetBeans IDE will regenerate which of these files it solves is incorrect or outdated.

But then (since these files are checked in the source control, like our official build scripts), the build files are usually not synchronized with the repository. If I check the automatically generated changes from my machine, other suckers on my team will have to rewrite their own local copy of the build scripts, as a result of which NetBeans will complain that the files are outdated and need to be regenerated.

This is mainly an annoyance. Either false differences in automatically generated build scripts add a lot of noise to sift every time a developer performs a test. Or the IDE constantly complains about external build scripts. You cannot win.

But I also have a constant grunting feeling that no one has a completely correct build script, and we introduce indeterminism into the entire build process.

As far as I can tell, there are two possible solutions to the problem:

1) Standardize a specific version of NetBeans. Do not let people update until we make a decision, as a team, to do this. And don't let people fall back on older versions. If everyone on the team uses the same version of NB, these problems will (probably) disappear.

2) Do not check the "build-impl.xml" script in the source control. It is automatically generated by the IDE and therefore is an artifact of the "build.xml" and "project.xml" files. Generated files (for example, .class files) should not be checked in the original control, but must be restored during the build process. Find out which mechanism NetBeans uses to create the build-impl.xml file and runs the same mechanism on our build server. Does this mean that our build server will have to rely on NetBeans GUI? I hope no.

What do you guys think? What is the right way to solve this problem?

+6
svn build-process netbeans ant
source share
3 answers

I think you should go to number 1 so that all your teammates use the same version of NetBeans. In my work, we also develop NetBeans, but we all use the same version and update at the same time. Over the past two years I have been using NetBeans, I have experienced that various changes change with each release (less these days), from configuration to file forms, so I feel better to minimize potential problems with different versions.

It is also easier to point out the source of the error if everyone uses the same environment.

+4
source share

How about using build-imp.xml.template, which versioned and ignored build-imp.xml in terms of source control. Users can "easily" combine their "personal" build files with the version. Also the ability to distribute changes through "build-imp.xml.template" to your employees.

You can take a look at Understand MacroDef Tasks in Netbeans Build Files .

0
source share

In my opinion, the following folders should not be added to the source control:

  • build (containing .class files)
  • dist (containing embedded JAR files)
  • nbproject / private (while it contains files specific to the local computer)

We will not transfer .class files, in fact everything that is generated from the NetBeans build process to the version control repository.

All local settings must be performed in the build.xml file stored in the root directory of the project, and these settings, if they belong to the developer, should not be transferred to the repository again. Nbproject / build-impl.xml should be moved after the generator creates the NetBeans project.

regarding Tushar

0
source share

All Articles