You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Bala Paranj <bp...@yahoo.com> on 2006/07/14 22:24:49 UTC

common jar

I have a package consisting of model classes that is shared between the client and server
projects. I want to create a common.jar file that is shared by both the client and server ant
scripts. 

How can I compile the com.xyz.model package only and exclude the compilation of other packages? I
want to compile the other packages of the client project and specify the common jar as the
dependency. How can do this? TIA.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: common jar

Posted by Andrew Goktepe <an...@gmail.com>.
You could force <javac> to compile only that package using the 'includes'
attribute. However, depending on how your project is set up, it's probably
better to make the separation when you create the jar files. Use
'includes'/'excludes' with the <jar> task to get the right classes into the
right jars.
http://ant.apache.org/manual/CoreTasks/jar.html

If the source for com.xyz.model is in a separate location from the client
and server code and doesn't import anything from either of those, then you
could just have separate <javac> and <jar> calls that create the common jar.
Then put that jar in the build classpath for the client and server projects:
http://ant.apache.org/manual/using.html#references

-Andrew


On 7/14/06, Bala Paranj <bp...@yahoo.com> wrote:
>
> I have a package consisting of model classes that is shared between the
> client and server
> projects. I want to create a common.jar file that is shared by both the
> client and server ant
> scripts.
>
> How can I compile the com.xyz.model package only and exclude the
> compilation of other packages? I
> want to compile the other packages of the client project and specify the
> common jar as the
> dependency. How can do this? TIA.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>