tags:

views:

12

answers:

0

I'm trying to setup the following:

  1. a couple of Netbeans (6.9) projects (Java and Java EE) buildable on my own computer and on our daily build machine
  2. build files (classes and jars/wars/ears) should be outside the project directories to avoid Clearcase view-private files
  3. my machine is a Windows machine, build machine is Linux. On the build server the build is done by calling ANT from a shell script.

The best solution I could come up with meant the introduction of an environment variable, that points to the directory where build files are produced (let's call it BUILD_ROOT). I edited the project.properties files, and changed these lines:

build.dir=${env.BUILD_ROOT}/javaeabuild/${application.title}/build
dist.dir=${env.BUILD_ROOT}/javaeabuild/${application.title}/dist

So far so good. But then disaster: when trying to compile a project that depends on another project, javac complains that it cannot find the classes that are defined in the other project.

These are the variants of project.properties that I've tried to reference the other project:

project.JMSClient=../JMSClient
reference.JMSClient.jar=${project.JMSClient}/${env.BUILD_ROOT}/javaeabuild/JMSClient/dist/JMSClient.jar

This is what Netbeans produces by itself. The code compiles in Netbeans, but using regular Ant the path is not correct.

project.JMSClient=../JMSClient
reference.JMSClient.jar=${env.BUILD_ROOT}/javaeabuild/JMSClient/dist/JMSClient.jar

This would supposedly produce the correct build path, but Netbeans complains about the missing JMSClient project.

javac.classpath=\
    ${file.reference.fscontext.jar}:\
    ${file.reference.imq.jar}:\
    ${file.reference.jms.jar}:\
    ${reference.JMSClient.jar}:\
    ${reference.JMSClient.jar.dist}
...
project.JMSClient=../JMSClient
reference.JMSClient.jar=${project.JMSClient}/${env.BUILD_ROOT}/javaeabuild/JMSClient/dist/JMSClient.jar
reference.JMSClient.jar.dist=${env.BUILD_ROOT}/javaeabuild/JMSClient/dist/JMSClient.jar

Trying to keep both parties happy: combine the two reference methods? Nope, doesn't work.

Now I'm out of ideas.

I will revert to using in-project builds, if this problem is not solved.

But I would be a bit disappointed.

Question 2: would switching to Maven solve this problem?