You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Cecchi Sandrone <ce...@gmail.com> on 2010/01/12 22:24:53 UTC

Assembly as dependency of the same project

Hi all,
I have the following issue...

The pom of my project is the following:

artifactId: it.mega
groupId: streamer
version: 1.0.1

1) First of all I generate an Apache CXF web service client into folder
target/generated
2) Then I create an assembly (jar) containing the .class files
3) Next the assembly is installed into the local repo with the same
identifier of the project but classifier "web-service-client" (e.g.
/.m2/it/mega/streamer/1.0.1/Streamer-1.0.1-web-service-client.jar)
4) Now, I want to import this jar in the same project as a dependency,
because I prefer a single jar instead of hundreds of classes in packages. I
tried inserting the following snippet in pom:

<artifactId>it.mega</artifactId>
<groupId>streamer</groupId>
<version>1.0.1</version>
<classifier>web-service-client</classifier>

and It doesn't work in the same project (circular dependency error) while it
works correctly in other projects. How can I solve this problem with a
correct approach?

Thank you in advance for any answer!
-- 
View this message in context: http://old.nabble.com/Assembly-as-dependency-of-the-same-project-tp27134967p27134967.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: Assembly as dependency of the same project

Posted by Cecchi Sandrone <ce...@gmail.com>.
Ok I understand your answers. For this kind of problem you recommend a module
or a subproject (parent-child)? Maybe I don't have clear the difference
between the two...


Dana Lacoste wrote:
> 
> I understand your desire for "not wanting things too complex" but, in
> maven, it's important to follow one simple rule:
> 
> Every pom.xml (maven project) _should_ produce exactly one file as a
> resulting artifact
> 
> If you need two files (a  .jar and a .war) then you need two pom.xml
> (maven projects) and it's actually very very easy to split things up that
> way.  Yes, it does take some adjusting to use this model, and yes it can
> be quite difficult sometimes to follow "hey, why is it doing that here?"
> but in the end, if you follow the maven model, you might find it makes
> more sense to do it "the maven way".  (and if you don't like splitting it
> up, I would DEFINITELY recommend using Ivy or something: maven works
> wonders when it's used "the maven way" and causes no end of headache when
> you try to twist it do something else....)
> 
> Dana Lacoste
> 
> -----Original Message-----
> From: Cecchi Sandrone [mailto:cecchisandrone@gmail.com] 
> Sent: Tuesday, January 12, 2010 1:34 PM
> To: users@maven.apache.org
> Subject: Re: Assembly as dependency of the same project
> 
> 
> Just to maintain the things not too complex. Furthermore, the same
> behavior I
> described is needed for XmlBeans class generation. 
> I have a set of classes generated from XSDs and I want to package them
> into
> a jar and put it as a dependency of the project.
> 
> ---------------------------------------------------------------------
> 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/Assembly-as-dependency-of-the-same-project-tp27134967p27135449.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: Assembly as dependency of the same project

Posted by "Lacoste, Dana (EB Software San Diego)" <da...@hp.com>.
I understand your desire for "not wanting things too complex" but, in maven, it's important to follow one simple rule:

Every pom.xml (maven project) _should_ produce exactly one file as a resulting artifact

If you need two files (a  .jar and a .war) then you need two pom.xml (maven projects) and it's actually very very easy to split things up that way.  Yes, it does take some adjusting to use this model, and yes it can be quite difficult sometimes to follow "hey, why is it doing that here?" but in the end, if you follow the maven model, you might find it makes more sense to do it "the maven way".  (and if you don't like splitting it up, I would DEFINITELY recommend using Ivy or something: maven works wonders when it's used "the maven way" and causes no end of headache when you try to twist it do something else....)

Dana Lacoste

-----Original Message-----
From: Cecchi Sandrone [mailto:cecchisandrone@gmail.com] 
Sent: Tuesday, January 12, 2010 1:34 PM
To: users@maven.apache.org
Subject: Re: Assembly as dependency of the same project


Just to maintain the things not too complex. Furthermore, the same behavior I
described is needed for XmlBeans class generation. 
I have a set of classes generated from XSDs and I want to package them into
a jar and put it as a dependency of the project.

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


Re: Assembly as dependency of the same project

Posted by Stephen Connolly <st...@gmail.com>.
yes, but it's an ironic reference

Sent from my [rhymes with tryPod] ;-)

On 12 Jan 2010, at 21:52, Justin Edelson <ju...@gmail.com>  
wrote:

> You realize that "Drink the Kool-Aid" has a negative connotation,  
> right?
> Although now I'm going to be imagining a young Powers Booth playing  
> Jason in
> "Maven: The Movie".
>
> On Tue, Jan 12, 2010 at 4:46 PM, Stephen Connolly <
> stephen.alan.connolly@gmail.com> wrote:
>
>> sounds like by not drinking the coolaid and doing thinks the maven  
>> way
>> (separate project) you are making things more complex than necessary
>>
>> Sent from my [rhymes with tryPod] ;-)
>>
>>
>> On 12 Jan 2010, at 21:34, Cecchi Sandrone <ce...@gmail.com>
>> wrote:
>>
>>
>>> Just to maintain the things not too complex. Furthermore, the same
>>> behavior I
>>> described is needed for XmlBeans class generation.
>>> I have a set of classes generated from XSDs and I want to package  
>>> them
>>> into
>>> a jar and put it as a dependency of the project.
>>>
>>>
>>> justinedelson wrote:
>>>
>>>>
>>>> Why do you want to do this? It seems like it'd be much simpler to  
>>>> have a
>>>> separate project to produce the web service client.
>>>>
>>>> Justin
>>>>
>>>> On Tue, Jan 12, 2010 at 4:24 PM, Cecchi Sandrone
>>>> <ce...@gmail.com>wrote:
>>>>
>>>>
>>>>> Hi all,
>>>>> I have the following issue...
>>>>>
>>>>> The pom of my project is the following:
>>>>>
>>>>> artifactId: it.mega
>>>>> groupId: streamer
>>>>> version: 1.0.1
>>>>>
>>>>> 1) First of all I generate an Apache CXF web service client into  
>>>>> folder
>>>>> target/generated
>>>>> 2) Then I create an assembly (jar) containing the .class files
>>>>> 3) Next the assembly is installed into the local repo with the  
>>>>> same
>>>>> identifier of the project but classifier "web-service- 
>>>>> client" (e.g.
>>>>> /.m2/it/mega/streamer/1.0.1/Streamer-1.0.1-web-service-client.jar)
>>>>> 4) Now, I want to import this jar in the same project as a  
>>>>> dependency,
>>>>> because I prefer a single jar instead of hundreds of classes in
>>>>> packages.
>>>>> I
>>>>> tried inserting the following snippet in pom:
>>>>>
>>>>> <artifactId>it.mega</artifactId>
>>>>> <groupId>streamer</groupId>
>>>>> <version>1.0.1</version>
>>>>> <classifier>web-service-client</classifier>
>>>>>
>>>>> and It doesn't work in the same project (circular dependency  
>>>>> error)
>>>>> while
>>>>> it
>>>>> works correctly in other projects. How can I solve this problem  
>>>>> with a
>>>>> correct approach?
>>>>>
>>>>> Thank you in advance for any answer!
>>>>> --
>>>>> View this message in context:
>>>>>
>>>>> http://old.nabble.com/Assembly-as-dependency-of-the-same-project-tp27134967p27134967.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
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Assembly-as-dependency-of-the-same-project-tp27134967p27135141.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
>>>
>>>
>> ---------------------------------------------------------------------
>> 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: Assembly as dependency of the same project

Posted by Justin Edelson <ju...@gmail.com>.
You realize that "Drink the Kool-Aid" has a negative connotation, right?
Although now I'm going to be imagining a young Powers Booth playing Jason in
"Maven: The Movie".

On Tue, Jan 12, 2010 at 4:46 PM, Stephen Connolly <
stephen.alan.connolly@gmail.com> wrote:

> sounds like by not drinking the coolaid and doing thinks the maven way
> (separate project) you are making things more complex than necessary
>
> Sent from my [rhymes with tryPod] ;-)
>
>
> On 12 Jan 2010, at 21:34, Cecchi Sandrone <ce...@gmail.com>
> wrote:
>
>
>> Just to maintain the things not too complex. Furthermore, the same
>> behavior I
>> described is needed for XmlBeans class generation.
>> I have a set of classes generated from XSDs and I want to package them
>> into
>> a jar and put it as a dependency of the project.
>>
>>
>> justinedelson wrote:
>>
>>>
>>> Why do you want to do this? It seems like it'd be much simpler to have a
>>> separate project to produce the web service client.
>>>
>>> Justin
>>>
>>> On Tue, Jan 12, 2010 at 4:24 PM, Cecchi Sandrone
>>> <ce...@gmail.com>wrote:
>>>
>>>
>>>> Hi all,
>>>> I have the following issue...
>>>>
>>>> The pom of my project is the following:
>>>>
>>>> artifactId: it.mega
>>>> groupId: streamer
>>>> version: 1.0.1
>>>>
>>>> 1) First of all I generate an Apache CXF web service client into folder
>>>> target/generated
>>>> 2) Then I create an assembly (jar) containing the .class files
>>>> 3) Next the assembly is installed into the local repo with the same
>>>> identifier of the project but classifier "web-service-client" (e.g.
>>>> /.m2/it/mega/streamer/1.0.1/Streamer-1.0.1-web-service-client.jar)
>>>> 4) Now, I want to import this jar in the same project as a dependency,
>>>> because I prefer a single jar instead of hundreds of classes in
>>>> packages.
>>>> I
>>>> tried inserting the following snippet in pom:
>>>>
>>>> <artifactId>it.mega</artifactId>
>>>> <groupId>streamer</groupId>
>>>> <version>1.0.1</version>
>>>> <classifier>web-service-client</classifier>
>>>>
>>>> and It doesn't work in the same project (circular dependency error)
>>>> while
>>>> it
>>>> works correctly in other projects. How can I solve this problem with a
>>>> correct approach?
>>>>
>>>> Thank you in advance for any answer!
>>>> --
>>>> View this message in context:
>>>>
>>>> http://old.nabble.com/Assembly-as-dependency-of-the-same-project-tp27134967p27134967.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
>>>>
>>>>
>>>>
>>>
>>>
>> --
>> View this message in context:
>> http://old.nabble.com/Assembly-as-dependency-of-the-same-project-tp27134967p27135141.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
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Assembly as dependency of the same project

Posted by Stephen Connolly <st...@gmail.com>.
sounds like by not drinking the coolaid and doing thinks the maven way  
(separate project) you are making things more complex than necessary

Sent from my [rhymes with tryPod] ;-)

On 12 Jan 2010, at 21:34, Cecchi Sandrone <ce...@gmail.com>  
wrote:

>
> Just to maintain the things not too complex. Furthermore, the same  
> behavior I
> described is needed for XmlBeans class generation.
> I have a set of classes generated from XSDs and I want to package  
> them into
> a jar and put it as a dependency of the project.
>
>
> justinedelson wrote:
>>
>> Why do you want to do this? It seems like it'd be much simpler to  
>> have a
>> separate project to produce the web service client.
>>
>> Justin
>>
>> On Tue, Jan 12, 2010 at 4:24 PM, Cecchi Sandrone
>> <ce...@gmail.com>wrote:
>>
>>>
>>> Hi all,
>>> I have the following issue...
>>>
>>> The pom of my project is the following:
>>>
>>> artifactId: it.mega
>>> groupId: streamer
>>> version: 1.0.1
>>>
>>> 1) First of all I generate an Apache CXF web service client into  
>>> folder
>>> target/generated
>>> 2) Then I create an assembly (jar) containing the .class files
>>> 3) Next the assembly is installed into the local repo with the same
>>> identifier of the project but classifier "web-service-client" (e.g.
>>> /.m2/it/mega/streamer/1.0.1/Streamer-1.0.1-web-service-client.jar)
>>> 4) Now, I want to import this jar in the same project as a  
>>> dependency,
>>> because I prefer a single jar instead of hundreds of classes in  
>>> packages.
>>> I
>>> tried inserting the following snippet in pom:
>>>
>>> <artifactId>it.mega</artifactId>
>>> <groupId>streamer</groupId>
>>> <version>1.0.1</version>
>>> <classifier>web-service-client</classifier>
>>>
>>> and It doesn't work in the same project (circular dependency  
>>> error) while
>>> it
>>> works correctly in other projects. How can I solve this problem  
>>> with a
>>> correct approach?
>>>
>>> Thank you in advance for any answer!
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Assembly-as-dependency-of-the-same-project-tp27134967p27134967.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
>>>
>>>
>>
>>
>
> -- 
> View this message in context: http://old.nabble.com/Assembly-as-dependency-of-the-same-project-tp27134967p27135141.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
>

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


Re: Assembly as dependency of the same project

Posted by Cecchi Sandrone <ce...@gmail.com>.
Just to maintain the things not too complex. Furthermore, the same behavior I
described is needed for XmlBeans class generation. 
I have a set of classes generated from XSDs and I want to package them into
a jar and put it as a dependency of the project.


justinedelson wrote:
> 
> Why do you want to do this? It seems like it'd be much simpler to have a
> separate project to produce the web service client.
> 
> Justin
> 
> On Tue, Jan 12, 2010 at 4:24 PM, Cecchi Sandrone
> <ce...@gmail.com>wrote:
> 
>>
>> Hi all,
>> I have the following issue...
>>
>> The pom of my project is the following:
>>
>> artifactId: it.mega
>> groupId: streamer
>> version: 1.0.1
>>
>> 1) First of all I generate an Apache CXF web service client into folder
>> target/generated
>> 2) Then I create an assembly (jar) containing the .class files
>> 3) Next the assembly is installed into the local repo with the same
>> identifier of the project but classifier "web-service-client" (e.g.
>> /.m2/it/mega/streamer/1.0.1/Streamer-1.0.1-web-service-client.jar)
>> 4) Now, I want to import this jar in the same project as a dependency,
>> because I prefer a single jar instead of hundreds of classes in packages.
>> I
>> tried inserting the following snippet in pom:
>>
>> <artifactId>it.mega</artifactId>
>> <groupId>streamer</groupId>
>> <version>1.0.1</version>
>> <classifier>web-service-client</classifier>
>>
>> and It doesn't work in the same project (circular dependency error) while
>> it
>> works correctly in other projects. How can I solve this problem with a
>> correct approach?
>>
>> Thank you in advance for any answer!
>> --
>> View this message in context:
>> http://old.nabble.com/Assembly-as-dependency-of-the-same-project-tp27134967p27134967.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
>>
>>
> 
> 

-- 
View this message in context: http://old.nabble.com/Assembly-as-dependency-of-the-same-project-tp27134967p27135141.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: Assembly as dependency of the same project

Posted by Justin Edelson <ju...@gmail.com>.
Why do you want to do this? It seems like it'd be much simpler to have a
separate project to produce the web service client.

Justin

On Tue, Jan 12, 2010 at 4:24 PM, Cecchi Sandrone
<ce...@gmail.com>wrote:

>
> Hi all,
> I have the following issue...
>
> The pom of my project is the following:
>
> artifactId: it.mega
> groupId: streamer
> version: 1.0.1
>
> 1) First of all I generate an Apache CXF web service client into folder
> target/generated
> 2) Then I create an assembly (jar) containing the .class files
> 3) Next the assembly is installed into the local repo with the same
> identifier of the project but classifier "web-service-client" (e.g.
> /.m2/it/mega/streamer/1.0.1/Streamer-1.0.1-web-service-client.jar)
> 4) Now, I want to import this jar in the same project as a dependency,
> because I prefer a single jar instead of hundreds of classes in packages. I
> tried inserting the following snippet in pom:
>
> <artifactId>it.mega</artifactId>
> <groupId>streamer</groupId>
> <version>1.0.1</version>
> <classifier>web-service-client</classifier>
>
> and It doesn't work in the same project (circular dependency error) while
> it
> works correctly in other projects. How can I solve this problem with a
> correct approach?
>
> Thank you in advance for any answer!
> --
> View this message in context:
> http://old.nabble.com/Assembly-as-dependency-of-the-same-project-tp27134967p27134967.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
>
>