You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by EJ Ciramella <ec...@casenetinc.com> on 2011/05/10 21:19:19 UTC

Nested artifacts

Is there a simple way to unpack a dependency then unpack an artifact that lives inside that dependency?

We have several third party utilities stored in Nexus and referenced as dependencies, but I'd like to unpack a rar that is nested within a zip.

Is there a maven 2 way or do I just rely on an ant task?

Thanks in advance!

________________________________
CONFIDENTIALITY NOTICE: This e-mail and the information transmitted within including any attachments is only for the recipient(s) to which it is intended and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of; or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please send the e-mail back by replying to the sender and permanently delete the entire message and its attachments from all computers and network systems involved in its receipt.

Re: Nested artifacts

Posted by Andreas Sewe <se...@st.informatik.tu-darmstadt.de>.
Hi,

> So the first part of the problem is the zip contains multiple rar files, but only one needs to be unpacked and tinkered with.

the maven-external-dependency-plugin might fit the bill: 
<http://code.google.com/p/maven-external-dependency-plugin/>. If the RAR 
file is not found in the local repository, the plugin tries to download 
the ZIP file, extracts the RAR, and installs it in your local 
repository. You would then bind dependency:unpack to a later phase, 
referring to the RAR artifact just installed. (I use this plugin in a 
similar way, with dependency:copy: 
<https://bitbucket.org/scalabench/scalac-dacapo-benchmark/src/4dac488d735c/pom.xml#cl-246>.)

The only issue 
<http://code.google.com/p/maven-external-dependency-plugin/issues/detail?id=8> 
I have found so far with the maven-external-dependency-plugin is that it 
doesn't work well with Maven 3 if the artifacts you want to extract 
(RARs in your case) are among the project dependencies. Unlike Maven 2, 
Maven 3 seems to resolve all project dependencies first, before any 
lifecycle phases are executed; thus, the 
maven-external-dependency-plugin doesn't get a chance of installing the 
missing dependencies first. This is not a problem when using 
dependency:copy or dependency:unpack, however.

I hope this helps.

Andreas Sewe

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


RE: Nested artifacts

Posted by EJ Ciramella <ec...@casenetinc.com>.
Thanks all who have replied!

So the first part of the problem is the zip contains multiple rar files, but only one needs to be unpacked and tinkered with.

You can't put a dependency on anything that doesn't exist when maven tries to validate the poms and resolve the dependencies.  So what I ended up doing is just putting a dependency unpack on the zip then later binding an ant call to unzip the rar.

What I don't want to have to do is say, "Ok, so we've decided to update this 3rd party thing, now upload these 24 artifacts into nexus".  I'd rather say, "Ok, just zip it up and stuff the whole thing up there".

Thanks again all - I appreciate all the suggestions and feedback!

P.S. - Maybe if/when I have absolutely nothing to do, I'll submit a patch that offers a recursive unpacking of a given dependency with includes/excludes - that would have been the ultimate solution for me ;-)

-----Original Message-----
From: Wendy Smoak [mailto:wsmoak@gmail.com]
Sent: Wednesday, May 11, 2011 4:28 PM
To: Maven Users List
Subject: Re: Nested artifacts

On Tue, May 10, 2011 at 3:19 PM, EJ Ciramella <ec...@casenetinc.com> wrote:
> Is there a simple way to unpack a dependency then unpack an artifact that lives inside that dependency?
>
> We have several third party utilities stored in Nexus and referenced as dependencies, but I'd like to unpack a rar that is nested within a zip.
>
> Is there a maven 2 way or do I just rely on an ant task?

I would probably unpack the zip myself and deploy the rar artifacts to
the repository once, rather than trying to do it every time you build.

How frequently do the third party utilities change?

--
Wendy

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


CONFIDENTIALITY NOTICE:  This e-mail and the information transmitted within including any attachments is only for the recipient(s) to which it is intended and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of; or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please send the e-mail back by replying to the sender and permanently delete the entire message and its attachments from all computers and network systems involved in its receipt.

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


Re: Nested artifacts

Posted by Wendy Smoak <ws...@gmail.com>.
On Tue, May 10, 2011 at 3:19 PM, EJ Ciramella <ec...@casenetinc.com> wrote:
> Is there a simple way to unpack a dependency then unpack an artifact that lives inside that dependency?
>
> We have several third party utilities stored in Nexus and referenced as dependencies, but I'd like to unpack a rar that is nested within a zip.
>
> Is there a maven 2 way or do I just rely on an ant task?

I would probably unpack the zip myself and deploy the rar artifacts to
the repository once, rather than trying to do it every time you build.

How frequently do the third party utilities change?

-- 
Wendy

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


Re: Nested artifacts

Posted by "Asmann, Roland" <Ro...@adesso.at>.
Sorry, let me rephrase it all a bit (keep in mind that I am not saying 
it works, I am currently unable to test anything in Maven!):

You need to configure the dependency-plugin to extract the ZIP and only 
AFTER that, try to unpack the RAR -- in a separate step. I believe there 
are a couple of phases that run WITHOUT Maven checking for the 
dependencies and crying about a missing one.

If I can get around to playing with my laptop a bit, I might test this 
out and report back to you. In the mean-time, feel free to try this.

One question that just popped into my mind: do you have to be in a 
certain phase when extracting or is any phase right for you?

Roland


On 11-05-11 21:46, EJ Ciramella wrote:
> Hmmm - kinda.
>
> Again, I'd like to unpack a rar that is nested within a zip.
>
> The dependency unpack bits even if it's a system scoped dependency will try and resolve that and it won't be there.
>
> :-/
>
> I think I just need to "shell out" to ant...
>
> -----Original Message-----
> From: Asmann, Roland [mailto:Roland.Asmann@adesso.at]
> Sent: Wednesday, May 11, 2011 12:04 PM
> To: Maven Users List
> Subject: Re: Nested artifacts
>
> Not 100% sure about this one, but you could try it with the
> dependency-plugin [1]. I believe it does not allow system-dependencies
> in its configuration, but judging from the sentence
>
> "The artifact version is optional. If not set, the plugin will attempt
> to resolve it from the project dependencies and then the
> dependencyManagement section." [2]
>
> I think that if you add that dependency to your
> dependency(-management)-list with the correct path, it should work.
>
> Roland
>
>
> [1] http://maven.apache.org/plugins/maven-dependency-plugin/unpack-mojo.html
> [2]
> http://maven.apache.org/plugins/maven-dependency-plugin/usage.html#The_dependency:unpack_mojo
>
>
>
> On 20:59, EJ Ciramella wrote:
>> Is there a simple way to unpack a dependency then unpack an artifact that lives inside that dependency?
>>
>> We have several third party utilities stored in Nexus and referenced as dependencies, but I'd like to unpack a rar that is nested within a zip.
>>
>> Is there a maven 2 way or do I just rely on an ant task?
>>
>> Thanks in advance!
>>
>> ________________________________
>> CONFIDENTIALITY NOTICE: This e-mail and the information transmitted within including any attachments is only for the recipient(s) to which it is intended and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of; or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please send the e-mail back by replying to the sender and permanently delete the entire message and its attachments from all computers and network systems involved in its receipt.
>
> --
> Roland Asmann
> Senior Software Engineer
>
> adesso Austria GmbH
> Floridotower 26. Stock              T +43 1 2198790-27
> Floridsdorfer Hauptstr. 1           F +43 1 2198790-927
> A-1210 Wien                         M +43 664 88657566
>                                      E roland.asmann@adesso.at
>                                      W www.adesso.at
>
> -------------------------------------------------------------
>               >>>  business. people. technology.<<<
> -------------------------------------------------------------
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
> CONFIDENTIALITY NOTICE:  This e-mail and the information transmitted within including any attachments is only for the recipient(s) to which it is intended and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of; or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please send the e-mail back by replying to the sender and permanently delete the entire message and its attachments from all computers and network systems involved in its receipt.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

-- 
Roland Asmann
Senior Software Engineer

adesso Austria GmbH
Floridotower 26. Stock              T +43 1 2198790-27
Floridsdorfer Hauptstr. 1           F +43 1 2198790-927
A-1210 Wien                         M +43 664 88657566
                                    E roland.asmann@adesso.at
                                    W www.adesso.at

-------------------------------------------------------------
             >>> business. people. technology. <<<
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Nested artifacts

Posted by EJ Ciramella <ec...@casenetinc.com>.
Hmmm - kinda.

Again, I'd like to unpack a rar that is nested within a zip.

The dependency unpack bits even if it's a system scoped dependency will try and resolve that and it won't be there.

:-/

I think I just need to "shell out" to ant...

-----Original Message-----
From: Asmann, Roland [mailto:Roland.Asmann@adesso.at]
Sent: Wednesday, May 11, 2011 12:04 PM
To: Maven Users List
Subject: Re: Nested artifacts

Not 100% sure about this one, but you could try it with the
dependency-plugin [1]. I believe it does not allow system-dependencies
in its configuration, but judging from the sentence

"The artifact version is optional. If not set, the plugin will attempt
to resolve it from the project dependencies and then the
dependencyManagement section." [2]

I think that if you add that dependency to your
dependency(-management)-list with the correct path, it should work.

Roland


[1] http://maven.apache.org/plugins/maven-dependency-plugin/unpack-mojo.html
[2]
http://maven.apache.org/plugins/maven-dependency-plugin/usage.html#The_dependency:unpack_mojo



On 20:59, EJ Ciramella wrote:
> Is there a simple way to unpack a dependency then unpack an artifact that lives inside that dependency?
>
> We have several third party utilities stored in Nexus and referenced as dependencies, but I'd like to unpack a rar that is nested within a zip.
>
> Is there a maven 2 way or do I just rely on an ant task?
>
> Thanks in advance!
>
> ________________________________
> CONFIDENTIALITY NOTICE: This e-mail and the information transmitted within including any attachments is only for the recipient(s) to which it is intended and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of; or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please send the e-mail back by replying to the sender and permanently delete the entire message and its attachments from all computers and network systems involved in its receipt.

--
Roland Asmann
Senior Software Engineer

adesso Austria GmbH
Floridotower 26. Stock              T +43 1 2198790-27
Floridsdorfer Hauptstr. 1           F +43 1 2198790-927
A-1210 Wien                         M +43 664 88657566
                                    E roland.asmann@adesso.at
                                    W www.adesso.at

-------------------------------------------------------------
             >>> business. people. technology. <<<
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


CONFIDENTIALITY NOTICE:  This e-mail and the information transmitted within including any attachments is only for the recipient(s) to which it is intended and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of; or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please send the e-mail back by replying to the sender and permanently delete the entire message and its attachments from all computers and network systems involved in its receipt.

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


Re: Nested artifacts

Posted by "Asmann, Roland" <Ro...@adesso.at>.
Not 100% sure about this one, but you could try it with the 
dependency-plugin [1]. I believe it does not allow system-dependencies 
in its configuration, but judging from the sentence

"The artifact version is optional. If not set, the plugin will attempt 
to resolve it from the project dependencies and then the 
dependencyManagement section." [2]

I think that if you add that dependency to your 
dependency(-management)-list with the correct path, it should work.

Roland


[1] http://maven.apache.org/plugins/maven-dependency-plugin/unpack-mojo.html
[2] 
http://maven.apache.org/plugins/maven-dependency-plugin/usage.html#The_dependency:unpack_mojo



On 20:59, EJ Ciramella wrote:
> Is there a simple way to unpack a dependency then unpack an artifact that lives inside that dependency?
>
> We have several third party utilities stored in Nexus and referenced as dependencies, but I'd like to unpack a rar that is nested within a zip.
>
> Is there a maven 2 way or do I just rely on an ant task?
>
> Thanks in advance!
>
> ________________________________
> CONFIDENTIALITY NOTICE: This e-mail and the information transmitted within including any attachments is only for the recipient(s) to which it is intended and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of; or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please send the e-mail back by replying to the sender and permanently delete the entire message and its attachments from all computers and network systems involved in its receipt.

-- 
Roland Asmann
Senior Software Engineer

adesso Austria GmbH
Floridotower 26. Stock              T +43 1 2198790-27
Floridsdorfer Hauptstr. 1           F +43 1 2198790-927
A-1210 Wien                         M +43 664 88657566
                                    E roland.asmann@adesso.at
                                    W www.adesso.at

-------------------------------------------------------------
             >>> business. people. technology. <<<
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org