-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I seem to be having difficulty getting the <sourceModifications> tag to work correctly. A few days ago I asked how to best compile multiple jars from a single CVS source repository and was told that it is not unusual to have multiple project.xml files. So, following that path, here is my situation:

I have a single CVS project with several Java utility packages. These include things like com.mycompany.util.*, com.mycompany.dao.*, com.mycompany.xml.*, etc. There are about a dozen different packages. The existing Ant script we have been using for several years ends up compiling things and throwing them into separate jar files: mycompany-util.jar, mycompany-xml.jar, etc.

In breaking this down from a single Ant file to multiple Maven project files, I thought I could use the <sourceModifications> tag to exclude code from compilation and jaring, but either this does not seem to work or I am not doing it correctly. For example, my project-util.xml file has a build section that includes:

<sourceDirectory>src/java</sourceDirectory>
<sourceModifications>
<!-- If the class can NOT be loaded, the includes and excludes are applied.
Obviously, this class can't be loaded. -->
<classname>force.modifications.to.occur</classname>
<!-- Block everything, initially -->
<excludes>
<exclude>**/*</exclude>
</excludes>
<!-- Allow through only the util classes -->
<includes>
<include>com/mycompany/util/*.java</include>
</includes>
</sourceModifications>


I then launch Maven with "maven -p project-util.xml java:jar". Unfortunately, it seems this section of the project file is entirely ignored. It still insists on compiling and packaging *everything* in the src/java folder (and ends up failing because some of the classes outside of the com.mycompany.util.* package require build dependencies like ant.jar and j2ee.jar that are not specified in util's project.xml).

Does anyone have any good examples of the sourceModifications section? I looked through the source code archives of a few of the Jakarta projects, but nobody seems to be using this particular element. Am I using it correctly? Is it broken?
-Brian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)


iD8DBQFASMz60dKNWt3rpSURAgIOAKDLV9tC7fbyRpdk0rgBjvIJyG8WLgCaAzQq
wtB/Ty4lKgDj27VPgxx/X3U=
=8nbc
-----END PGP SIGNATURE-----


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to