You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by /U <um...@comcast.net> on 2007/11/30 01:03:21 UTC

Injecting resources into a project

I am using Maven 2.0.4. 

I have a project A which has resource R1 and R2:
       A/src/main/resources/
                    /R1
                    /R2

I have another project at the same level, say B.
I need a plugin which would copy R1 and R2 from A/src/main/resources
into a specified directory X of project B:

     $ cd B
     $ ls -R src/main/resources
     $ mvn insert-resources:insert-resources
     [...]
     $ ls -R src/main/resources
      src/main/resources/R1
      src/main/resources/R2
     $

Is there a plugin which would do this? 

If not, I am willing to write a plugin; I just am not sure how to 
pull R1 and R2 from A into B.

Would I just have project A package R1 and R2 into a jarfile,
put a dependency in B on A.jar and extract contents of A.jar in
my plugin?

Pl help,

/U
-- 
View this message in context: http://www.nabble.com/Injecting-resources-into-a-project-tf4900782s177.html#a14037850
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Injecting resources into a project

Posted by Erez Nahir <er...@gmail.com>.
You can use either ant task to copy (with antrun-plugin) or (and that's
prefered IMHO) use maven-dependency-plugin (
http://maven.apache.org/plugins/maven-dependency-plugin/), create dependency
from B to A and unpack it to some dir under B/target. Add B/target as
resource and you are done.


Erez.

On Nov 30, 2007 2:03 AM, /U <um...@comcast.net> wrote:

>
> I am using Maven 2.0.4.
>
> I have a project A which has resource R1 and R2:
>       A/src/main/resources/
>                    /R1
>                    /R2
>
> I have another project at the same level, say B.
> I need a plugin which would copy R1 and R2 from A/src/main/resources
> into a specified directory X of project B:
>
>     $ cd B
>     $ ls -R src/main/resources
>     $ mvn insert-resources:insert-resources
>     [...]
>     $ ls -R src/main/resources
>      src/main/resources/R1
>      src/main/resources/R2
>     $
>
> Is there a plugin which would do this?
>
> If not, I am willing to write a plugin; I just am not sure how to
> pull R1 and R2 from A into B.
>
> Would I just have project A package R1 and R2 into a jarfile,
> put a dependency in B on A.jar and extract contents of A.jar in
> my plugin?
>
> Pl help,
>
> /U
> --
> View this message in context:
> http://www.nabble.com/Injecting-resources-into-a-project-tf4900782s177.html#a14037850
> Sent from the Maven - Users mailing list archive at Nabble.com<http://nabble.com/>
> .
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>