You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ruel Loehr <ru...@jboss.com> on 2005/11/10 16:36:41 UTC

plugin development - extending simple plugin like jar

I identified a need in our particular build such that many times when we
build a jar, we need to include classes from another project.

For example, in a multiproj build I have 2 submodules:

Module1
Module2

I build module1 and jar it up, then I build module2 and jar it up,
however, the caveat is that I want to include a few classes from the
module1 /target/classes to the jar created in module2.

I took a look at the source for the jar plugin and can see that the
functionality doesn't exist.  No prob.   I wrote my own plugin which
extends the jar plugin (the plugin dev guide is pretty awesome, I was up
and running with the sample in 10 mins).

My question though,

How can I instruct maven to use my custom jar plugin rather than the
default jar plugin?  

Ruel Loehr
JBoss QA
 
-----------------------------
512-626-2782
Yahoo: ruelloehr
Skype: ruelloehr
AOL: dokoruel

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: plugin development - extending simple plugin like jar

Posted by Brett Porter <br...@gmail.com>.
To use a custom plugin, you need to use a custom packaging element.
Take a look at the lifecycle guide on the web site (there was a thread
on this list very recently about it too).

However, I'm curious what your use case is for duplicating classes
across multiple jars. Why is this required? It may hinder the ability
to use the multiproject effectively later on.

Cheers,
Brett

On 11/11/05, Ruel Loehr <ru...@jboss.com> wrote:
> I identified a need in our particular build such that many times when we
> build a jar, we need to include classes from another project.
>
> For example, in a multiproj build I have 2 submodules:
>
> Module1
> Module2
>
> I build module1 and jar it up, then I build module2 and jar it up,
> however, the caveat is that I want to include a few classes from the
> module1 /target/classes to the jar created in module2.
>
> I took a look at the source for the jar plugin and can see that the
> functionality doesn't exist.  No prob.   I wrote my own plugin which
> extends the jar plugin (the plugin dev guide is pretty awesome, I was up
> and running with the sample in 10 mins).
>
> My question though,
>
> How can I instruct maven to use my custom jar plugin rather than the
> default jar plugin?
>
> Ruel Loehr
> JBoss QA
>
> -----------------------------
> 512-626-2782
> Yahoo: ruelloehr
> Skype: ruelloehr
> AOL: dokoruel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org