tags:

views:

45

answers:

3

I am using an OSGi framework to do my development, and my develop machine's jar lib path is different from my production machine's.

How can a write my build.xml so that it can make my development easy yet I can ship the software to the production without too much headache? (note: the production people do not know ant and etc very much)

Thanks

+1  A: 

Create an ant property which contains the jar lib path, and let it default to the value in production. Refer to it in your build.xml in appropriate locations.

Developers can then override the property as needed in their personal ant launch configuration.

Thorbjørn Ravn Andersen
A: 

Use ivy to download your project's jar dependencies and manage your project's classpath.

For example:

<target name="init" description="Initialize the project">
    <ivy:resolve/>
    <ivy:cachepath pathid="compile.path" conf="compile"/>
    <ivy:cachepath pathid="runtime.path" conf="runtime"/>
    <ivy:cachepath pathid="test.path" conf="test"/>
</target>

This coupled with a Maven repository manager (to hold dependencies not available from the internet) would make your build portable across your organisation.

Mark O'Connor
+1  A: 

Look into Maven--seriously. It's overall design seems to be as though they were trying to answer your question.

Also it's probably smart enough to suck in your existing build and spit out a maven build that's better.

Not actually a huge maven user myself so sorry if I'm wrong, but this is what it seems like from what I have used...

Bill K