-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Chris Berry wrote:
<snip/>
|>One thing we're considering adding to m2 in the very near term is the
|>concept of dependencies that are tied directly to a plugin definition.
|
|
| Don't we already have this?? I have dependencies defined for my plugin
| and they are all there when I call my Ant tasks (using an extended
| version of AbstractAntMojo). I have verified this.
|
What I'm talking about is per-project dependencies for a given plugin.
For example, the xdoclet plugin may only specify the dependencies it
needs to run the engine. If you, as the plugin user, want to have
xdoclet generate an EJB deployment descriptor, you might include the
xdoclet-ejb dependency in your definition of the xdoclet plugin - within
your project. This would allow people to resolve only the xdoclet
artifacts that they really need, rather than the sum total of modules
that xdoclet provides...a collection which would quickly fall out of
date as third parties might write new modules.
NOTE: This is not a question of extending one plugin with another, in
order to redefine the dependencies. This is customizing a list of
optional *additional* dependencies for a given plugin for your project
to use.
<snip/>
| Unfortunately, this doesn't really work in my case. Say I have an Ant
| build file named "axis.xml" and I bundle this into my Plugin JAR. I
| cannot access this as a File. Yes, it has a path in the URL sense (i.e
| jar:/...) But Ant wants a regular old file that I can get an absolute
| path to. (BTW: Ant is just an example. The same could hold true for
| many other situations)
It's a bit clunky, but if you're trying to do this from a java-based
mojo (i.e. not from an ant script or the antrun plugin's configuration),
you can try the following:
// note: there are better ways to do this next line...but this generally
// works.
ClassLoader cl = getClass().getClassLoader();
URL resource = cl.getResource("/path/to/resource/in/classpath");
File concreteFile = new File( resource.getPath() );
|
| Is there any way to bundle files (such as axis.xml) into the
| repository -- such that I could access it directly as,say,
| ${localRepository}/blah/plugins/axis-plugin/1.0-SNAPSHOT/axis.xml
It is possible to do that sort of thing, but it means making the
axis.xml some sort of first-class artifact to be "built" and deployed.
It's a bit of a hack...
|
| Of course, I could unjar the Plugin into /target -- but that seems
| like a hack...
I think you'll find the trick above will be a simpler solution, actually...
Cheers,
- -john
|
| Thanks for all your help & insight,
| Cheers,
| -- Chris
|
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
|
|
|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
iD8DBQFDDQ0MK3h2CZwO/4URAhAFAJ9zaRW2n1XJeXxJieaqdBe/i9V+7wCZAcHu
AKQpiSNvGNIcUoE7a/Phvbo=
=kNot
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]