You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by maven-user <ma...@jpmorgan.com> on 2010/06/03 18:00:25 UTC

Copying jar in multi module project with assembly

Hi,

I have multi module project structure as shown below . In mod2 target
directory I have created executable jar, say abc.jar . Now I want to include
this jar in the archive of mod1.1  that I'm creating using assembly.xml. My
question is how can I refer to this abc.jar which is a runtime artifact of
mod2..?

myproject
|__mod1
|          |_mod1.1
|_mod2

Thanks.

-- 
View this message in context: http://old.nabble.com/Copying-jar-in-multi-module-project-with-assembly-tp28769514p28769514.html
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: Copying jar in multi module project with assembly

Posted by Ron Wheeler <rw...@artifact-software.com>.
If you want it in, it is a dependency.

Being a dependency does not have any religious significance, it just 
means that you think that mod1 will not run without that abc.jar being 
there.
Maven makes no value judgments about why you want it included.
If you say you need it Maven will include it.

Ron


On 04/06/2010 11:18 AM, maven-user wrote:
> Thanks Ron,
>
> But the abc.jar I want to refer to is created in mod2 using assembly plug-in
> as an executable jar
>
> mod2/target/abc.jar
>
> It is not a direct dependency of mod1 . When I use dependency-with-war or
> dependencyset in my assembly for mod1.1, it is able to refer all other jar
> in Mod2 except  abc.jar ... My issue is  when creating a distribution in
> Mod1.1 , I want to include the abc.jar (created in mod2 target).
>
> Thanks
>
>
>
> ronatartifact wrote:
>    
>> On 03/06/2010 12:00 PM, maven-user wrote:
>>      
>>> Hi,
>>>
>>> I have multi module project structure as shown below . In mod2 target
>>> directory I have created executable jar, say abc.jar . Now I want to
>>> include
>>> this jar in the archive of mod1.1  that I'm creating using assembly.xml.
>>> My
>>> question is how can I refer to this abc.jar which is a runtime artifact
>>> of
>>> mod2..?
>>>
>>> myproject
>>> |__mod1
>>> |          |_mod1.1
>>> |_mod2
>>>
>>> Thanks.
>>>
>>>
>>>        
>> It is a dependency of mod1 and if your use jar-with-dependency it will
>> be picked up. Google maven jar with dependency.
>>
>> Ron
>>
>> ---------------------------------------------------------------------
>> 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


Re: Copying jar in multi module project with assembly

Posted by Anders Hammar <an...@hammar.net>.
m-assembly-p attaches it by default (
http://maven.apache.org/plugins/maven-assembly-plugin/single-mojo.html#attach),
for the single goal. At least if you bind it to the package phase.

/Anders
On Fri, Jun 4, 2010 at 18:24, Wayne Fay <wa...@gmail.com> wrote:

> > But the abc.jar I want to refer to is created in mod2 using assembly
> plug-in
> > as an executable jar
> >
> > mod2/target/abc.jar
>
> I don't recall if the assembly plugin automatically (or can be
> configured to) adds its output to the project as a secondary artifact
> or if you have to use build-helper to do it, but either way, you need
> to simply install that artifact from mod2 and then depend on it in
> mod1.
>
> You may not think of it as a dependency, but if you need it inside
> mod1 for mod1 to work properly, then Maven calls it a dependency.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Copying jar in multi module project with assembly

Posted by Wayne Fay <wa...@gmail.com>.
> But the abc.jar I want to refer to is created in mod2 using assembly plug-in
> as an executable jar
>
> mod2/target/abc.jar

I don't recall if the assembly plugin automatically (or can be
configured to) adds its output to the project as a secondary artifact
or if you have to use build-helper to do it, but either way, you need
to simply install that artifact from mod2 and then depend on it in
mod1.

You may not think of it as a dependency, but if you need it inside
mod1 for mod1 to work properly, then Maven calls it a dependency.

Wayne

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


Re: Copying jar in multi module project with assembly

Posted by maven-user <ma...@jpmorgan.com>.
Thanks Ron, 

But the abc.jar I want to refer to is created in mod2 using assembly plug-in
as an executable jar 

mod2/target/abc.jar 

It is not a direct dependency of mod1 . When I use dependency-with-war or
dependencyset in my assembly for mod1.1, it is able to refer all other jar
in Mod2 except  abc.jar ... My issue is  when creating a distribution in
Mod1.1 , I want to include the abc.jar (created in mod2 target).

Thanks

   

ronatartifact wrote:
> 
> On 03/06/2010 12:00 PM, maven-user wrote:
>> Hi,
>>
>> I have multi module project structure as shown below . In mod2 target
>> directory I have created executable jar, say abc.jar . Now I want to
>> include
>> this jar in the archive of mod1.1  that I'm creating using assembly.xml.
>> My
>> question is how can I refer to this abc.jar which is a runtime artifact
>> of
>> mod2..?
>>
>> myproject
>> |__mod1
>> |          |_mod1.1
>> |_mod2
>>
>> Thanks.
>>
>>    
> It is a dependency of mod1 and if your use jar-with-dependency it will 
> be picked up. Google maven jar with dependency.
> 
> Ron
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Copying-jar-in-multi-module-project-with-assembly-tp28769514p28781379.html
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: Copying jar in multi module project with assembly

Posted by Ron Wheeler <rw...@artifact-software.com>.
On 03/06/2010 12:00 PM, maven-user wrote:
> Hi,
>
> I have multi module project structure as shown below . In mod2 target
> directory I have created executable jar, say abc.jar . Now I want to include
> this jar in the archive of mod1.1  that I'm creating using assembly.xml. My
> question is how can I refer to this abc.jar which is a runtime artifact of
> mod2..?
>
> myproject
> |__mod1
> |          |_mod1.1
> |_mod2
>
> Thanks.
>
>    
It is a dependency of mod1 and if your use jar-with-dependency it will 
be picked up. Google maven jar with dependency.

Ron

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