fetching the artifact directly can cause issues when you want to use the
release plugin if the artifact you want to fetch is part of the reactor you
are fetching.

if you will always be releasing this artifact separately from the "onejar"
projects, then you can fetch it directly

if you will have different versions used by different "onejar" projects in
the same reactor, then (at least for m2) you cannot use it as a plugin
dependency [by that I mean
onejar-project/pom.xml:/project/build/plugins/plugin/dependencies/dependency
and not onejar-maven-plugin/pom.xml:/project/dependencies/dependency ] (due
to a bug in how m2 sets up the classloaders for a plugin, the first time a
plugin is loaded, that classloader is used for all throught the reactor)

To my mind it makes more sense as a project dependency with scope of either
provided (i.e. it's provided if it's needed) or runtime (i.e. it will be
available at runtime but not on the compile classpath) but only if you might
be releasing it in the same reactor as a "onejar" project that uses it.

So you need to answer for yourself, how will this get released.

In my case, I would probably just keep the version synced through the plugin
and tell people to go and jump if they want to release from the same reactor
two modules which are using different versions ;-) [that is add the dep in
onejar-maven-plugin/pom.xml:/project/dependencies/dependency]

-Stephen

On 23 February 2010 12:24, tbee <[email protected]> wrote:

>
> I'm well on my way in creating my first Maven plugin. One unexpected
> behavior, but I've coded around that. But what I require now is some what
> deviating; the plugin creates a special jar similar to onejar, containing
> all files that are required at runtime as a single deliverable.
>
> Naturally there is some bootstrap code and it is present in its own
> jar-artifact. What I require the plugin to do is explicitly fetch that
> artifact and unpack it. It's not a dependency in the pom of the plugin (it
> could be, but isn't atm) nor in the pom of the actual project; I simply
> need
> a "artifact = resolveArtifact(groupid, artifactid, version)".
>
> It is either that, or I need to attach the jar as a resource to the plugin.
> --
> View this message in context:
> http://old.nabble.com/fetching-an-artifact-directly-tp27702529p27702529.html
> Sent from the Maven Developers mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to