Hi Craig!

Here is a short example which copies dependencies to a certain path. You
need to modify it for your purpose.

It works, as soon as the dependency is located in the local repository.
                <j:forEach var="a" items="${pom.getArtifacts()}">
                        <ant:copy file='${a.getPath()}'
todir='${maven.dist.bin.assembly.dir}/lib' />           
                </j:forEach>

Best regards from (today grey) Black Forrest,
        Mattin

-----Original Message-----
From: Craig S. Cottingham [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 09, 2005 4:24 PM
To: Maven Users List
Subject: How to reference a dependency by filename?


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

I have two projects (A and B) that use Hibernate, so they contain 
*.hbm.xml files for their persisted classes. Up to now, they've been 
mutually exclusive, but I'm trying to add a dependency on a class in A 
to a class in B. (The class in B is to have a collection of the class 
in A.)

Adding a dependency in project.xml is straightforward. However, we also 
generate our database schema using Hibernate's schema export tool, and 
it needs to know the path to the *.hbm.xml *files*. I haven't seen any 
way to tell it to look in the classpath.

So, I figure I can unjar the *.hbm.xml files from the jarfile for A 
into an appropriate place in B's maven.build.dir and reference them 
from there. Now, the stumbling block is telling the unjar task where to 
find A's jarfile in the local repository.

maven.repo.local gives me the path to the local repository. I don't 
mind hardcoding the groupId and artifactId, but I don't want to 
hardcode the version.

Is there some way to do something in maven.xml akin to "find the 
dependency with groupId == 'mycompany' and artifactId == 'A', and 
return version"? Alternatively, can someone suggest a better way to 
accomplish what I'm trying to accomplish?

- --
Craig S. Cottingham
[EMAIL PROTECTED]
OpenPGP key available from:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7977F79C
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFCLxT3EJLQ3Hl395wRAi6LAJ4yFeTYfVUwhhFfWYTp7MyOb6jzcwCdGEIK
1upCH5Jv7k3RfIDkvGY+2VM=
=wC/j
-----END PGP SIGNATURE-----


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


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

Reply via email to