You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Krabi <im...@hot.ee> on 2009/06/03 13:01:17 UTC

Maven collect JAR files into one ZIP

Hi,

I have maven project. If I make eclipse project (mvn eclipse:eclipse) then
from Eclipse I see, that
I have many dependency JAR files resolved. Is there any plug-in that can
make for me one ZIP file where all these are collected together? I found
that I can make one JAR where all these are collected. I don't need that
solution.
-- 
View this message in context: http://www.nabble.com/Maven-collect-JAR-files-into-one-ZIP-tp23849432p23849432.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: Maven collect JAR files into one ZIP

Posted by Krabi <im...@hot.ee>.
offtopic:

Nick Stolwijk-4 before you answered I already made some code ;).
For me is interesting to implement it. Can you watch on that issue and code?
http://code.google.com/p/jar-collector/issues/detail?id=1
https://jar-collector.googlecode.com/svn/branches/development/1.0.0
(
 # Non-members may check out a read-only working copy anonymously over HTTP.
svn checkout http://jar-collector.googlecode.com/svn/trunk/
jar-collector-read-only 
)
How to find direct deps. sub-deps packages in code?



Nick Stolwijk-4 wrote:
> 
> I think the combination of dependency:copy-dependencies [1] and the
> assembly plugin will do what you want.
> 
> [1]
> http://maven.apache.org/plugins/maven-dependency-plugin/copy-dependencies-mojo.html
> 
> Hth,
> 
> Nick Stolwijk
> ~Java Developer~
> 
> Iprofs BV.
> Claus Sluterweg 125
> 2012 WS Haarlem
> www.iprofs.nl
> 
> 
> 
> On Thu, Jun 4, 2009 at 7:59 AM, Krabi <im...@hot.ee> wrote:
>>
>> Yes I know that.
>> Jar-with-deps is taking out all class files from all dep. JAR files and
>> put
>> them into one single JAR file. I don't need that. Is nice to have one ZIP
>> where JARs are collected together.As same way how WAR files are built
>> with
>> maven. Inside WAR are also dep. jar files located.
>> As I understand there isn't such a plug-in for that?
>>
>> If I need develop it by my self, is it hard do develop? What
>> libraries/APIs
>> I must to know? Is there POM parser and some Maven APIs for getting for
>> project(for POM) list of all JARs(recursively resolved) with full path
>> from
>> local repository(like C:\Repo\org\some\lib\1.0\x-1.0.jar)? I know basic
>> of
>> making plug-ins but I don't know much about Maven APIs - how to get list
>> of
>> files and how to get maven context info(repository location, etc) and how
>> to
>> get plug-in configuration? Does I need to parse POM and toher XML files
>> by
>> my self or that functionality is supported by some Maven API? Any
>> suggestion
>> to read, search?
>>
>>
>> Wayne Fay wrote:
>>>
>>>> I think that better is to have plug-in that resolves deps(from POM) and
>>>> adds
>>>> into one ZIP.
>>>> Jar with deps is not nice solution - long build proccess and I cant
>>>> send
>>>> send ~50MB files.
>>>
>>> You realize that the Jar file format is essentially "zip plus some
>>> text files", right? What do you think would be magically different in
>>> this proposed Zip vs what Jar with deps is producing?
>>>
>>> Wayne
>>>
>>> ---------------------------------------------------------------------
>>> 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://www.nabble.com/Maven-collect-JAR-files-into-one-ZIP-tp23849432p23864206.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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Maven-collect-JAR-files-into-one-ZIP-tp23849432p23870362.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 : Maven collect JAR files into one ZIP

Posted by Julien HENRY <he...@yahoo.fr>.
Hi,

No need for the dependency plugin. The assembly plugin alone will do the job:

in pom.xml
<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.2-beta-3</version>
                <configuration>
                    <descriptors>
                        <descriptor>src/main/assembly/bundle.xml</descriptor>
                    </descriptors>
                </configuration>
            </plugin>

bundle.xml
<assembly>
    <id>bundle</id>
    <formats>
        <format>zip</format>
    </formats>
    <dependencySets>
        <dependencySet>
            <unpack>false</unpack>
            <scope>runtime</scope>
            <useProjectArtifact>true</useProjectArtifact>
        </dependencySet>
    </dependencySets>
</assembly>

Regards,

Julien




________________________________
De : Krabi <im...@hot.ee>
À : users@maven.apache.org
Envoyé le : Jeudi, 4 Juin 2009, 15h13mn 30s
Objet : Re: Maven collect JAR files into one ZIP


Thanks!
This solution is good enough :)


Nick Stolwijk-4 wrote:
> 
> I think the combination of dependency:copy-dependencies [1] and the
> assembly plugin will do what you want.
> 
> [1]
> http://maven.apache.org/plugins/maven-dependency-plugin/copy-dependencies-mojo.html
> 
> Hth,
> 
> Nick Stolwijk
> ~Java Developer~
> 
> Iprofs BV.
> Claus Sluterweg 125
> 2012 WS Haarlem
> www.iprofs.nl
> 
> 
> 
> On Thu, Jun 4, 2009 at 7:59 AM, Krabi <im...@hot.ee> wrote:
>>
>> Yes I know that.
>> Jar-with-deps is taking out all class files from all dep. JAR files and
>> put
>> them into one single JAR file. I don't need that. Is nice to have one ZIP
>> where JARs are collected together.As same way how WAR files are built
>> with
>> maven. Inside WAR are also dep. jar files located.
>> As I understand there isn't such a plug-in for that?
>>
>> If I need develop it by my self, is it hard do develop? What
>> libraries/APIs
>> I must to know? Is there POM parser and some Maven APIs for getting for
>> project(for POM) list of all JARs(recursively resolved) with full path
>> from
>> local repository(like C:\Repo\org\some\lib\1.0\x-1.0.jar)? I know basic
>> of
>> making plug-ins but I don't know much about Maven APIs - how to get list
>> of
>> files and how to get maven context info(repository location, etc) and how
>> to
>> get plug-in configuration? Does I need to parse POM and toher XML files
>> by
>> my self or that functionality is supported by some Maven API? Any
>> suggestion
>> to read, search?
>>
>>
>> Wayne Fay wrote:
>>>
>>>> I think that better is to have plug-in that resolves deps(from POM) and
>>>> adds
>>>> into one ZIP.
>>>> Jar with deps is not nice solution - long build proccess and I cant
>>>> send
>>>> send ~50MB files.
>>>
>>> You realize that the Jar file format is essentially "zip plus some
>>> text files", right? What do you think would be magically different in
>>> this proposed Zip vs what Jar with deps is producing?
>>>
>>> Wayne
>>>
>>> ---------------------------------------------------------------------
>>> 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://www.nabble.com/Maven-collect-JAR-files-into-one-ZIP-tp23849432p23864206.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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Maven-collect-JAR-files-into-one-ZIP-tp23849432p23869693.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: Maven collect JAR files into one ZIP

Posted by Krabi <im...@hot.ee>.
Thanks!
This solution is good enough :)


Nick Stolwijk-4 wrote:
> 
> I think the combination of dependency:copy-dependencies [1] and the
> assembly plugin will do what you want.
> 
> [1]
> http://maven.apache.org/plugins/maven-dependency-plugin/copy-dependencies-mojo.html
> 
> Hth,
> 
> Nick Stolwijk
> ~Java Developer~
> 
> Iprofs BV.
> Claus Sluterweg 125
> 2012 WS Haarlem
> www.iprofs.nl
> 
> 
> 
> On Thu, Jun 4, 2009 at 7:59 AM, Krabi <im...@hot.ee> wrote:
>>
>> Yes I know that.
>> Jar-with-deps is taking out all class files from all dep. JAR files and
>> put
>> them into one single JAR file. I don't need that. Is nice to have one ZIP
>> where JARs are collected together.As same way how WAR files are built
>> with
>> maven. Inside WAR are also dep. jar files located.
>> As I understand there isn't such a plug-in for that?
>>
>> If I need develop it by my self, is it hard do develop? What
>> libraries/APIs
>> I must to know? Is there POM parser and some Maven APIs for getting for
>> project(for POM) list of all JARs(recursively resolved) with full path
>> from
>> local repository(like C:\Repo\org\some\lib\1.0\x-1.0.jar)? I know basic
>> of
>> making plug-ins but I don't know much about Maven APIs - how to get list
>> of
>> files and how to get maven context info(repository location, etc) and how
>> to
>> get plug-in configuration? Does I need to parse POM and toher XML files
>> by
>> my self or that functionality is supported by some Maven API? Any
>> suggestion
>> to read, search?
>>
>>
>> Wayne Fay wrote:
>>>
>>>> I think that better is to have plug-in that resolves deps(from POM) and
>>>> adds
>>>> into one ZIP.
>>>> Jar with deps is not nice solution - long build proccess and I cant
>>>> send
>>>> send ~50MB files.
>>>
>>> You realize that the Jar file format is essentially "zip plus some
>>> text files", right? What do you think would be magically different in
>>> this proposed Zip vs what Jar with deps is producing?
>>>
>>> Wayne
>>>
>>> ---------------------------------------------------------------------
>>> 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://www.nabble.com/Maven-collect-JAR-files-into-one-ZIP-tp23849432p23864206.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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Maven-collect-JAR-files-into-one-ZIP-tp23849432p23869693.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: Maven collect JAR files into one ZIP

Posted by Nick Stolwijk <ni...@gmail.com>.
I think the combination of dependency:copy-dependencies [1] and the
assembly plugin will do what you want.

[1] http://maven.apache.org/plugins/maven-dependency-plugin/copy-dependencies-mojo.html

Hth,

Nick Stolwijk
~Java Developer~

Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl



On Thu, Jun 4, 2009 at 7:59 AM, Krabi <im...@hot.ee> wrote:
>
> Yes I know that.
> Jar-with-deps is taking out all class files from all dep. JAR files and put
> them into one single JAR file. I don't need that. Is nice to have one ZIP
> where JARs are collected together.As same way how WAR files are built with
> maven. Inside WAR are also dep. jar files located.
> As I understand there isn't such a plug-in for that?
>
> If I need develop it by my self, is it hard do develop? What libraries/APIs
> I must to know? Is there POM parser and some Maven APIs for getting for
> project(for POM) list of all JARs(recursively resolved) with full path from
> local repository(like C:\Repo\org\some\lib\1.0\x-1.0.jar)? I know basic of
> making plug-ins but I don't know much about Maven APIs - how to get list of
> files and how to get maven context info(repository location, etc) and how to
> get plug-in configuration? Does I need to parse POM and toher XML files by
> my self or that functionality is supported by some Maven API? Any suggestion
> to read, search?
>
>
> Wayne Fay wrote:
>>
>>> I think that better is to have plug-in that resolves deps(from POM) and
>>> adds
>>> into one ZIP.
>>> Jar with deps is not nice solution - long build proccess and I cant send
>>> send ~50MB files.
>>
>> You realize that the Jar file format is essentially "zip plus some
>> text files", right? What do you think would be magically different in
>> this proposed Zip vs what Jar with deps is producing?
>>
>> Wayne
>>
>> ---------------------------------------------------------------------
>> 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://www.nabble.com/Maven-collect-JAR-files-into-one-ZIP-tp23849432p23864206.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: Maven collect JAR files into one ZIP

Posted by Krabi <im...@hot.ee>.
Yes I know that.
Jar-with-deps is taking out all class files from all dep. JAR files and put
them into one single JAR file. I don't need that. Is nice to have one ZIP
where JARs are collected together.As same way how WAR files are built with
maven. Inside WAR are also dep. jar files located. 
As I understand there isn't such a plug-in for that?

If I need develop it by my self, is it hard do develop? What libraries/APIs
I must to know? Is there POM parser and some Maven APIs for getting for
project(for POM) list of all JARs(recursively resolved) with full path from
local repository(like C:\Repo\org\some\lib\1.0\x-1.0.jar)? I know basic of
making plug-ins but I don't know much about Maven APIs - how to get list of
files and how to get maven context info(repository location, etc) and how to
get plug-in configuration? Does I need to parse POM and toher XML files by
my self or that functionality is supported by some Maven API? Any suggestion
to read, search?


Wayne Fay wrote:
> 
>> I think that better is to have plug-in that resolves deps(from POM) and
>> adds
>> into one ZIP.
>> Jar with deps is not nice solution - long build proccess and I cant send
>> send ~50MB files.
> 
> You realize that the Jar file format is essentially "zip plus some
> text files", right? What do you think would be magically different in
> this proposed Zip vs what Jar with deps is producing?
> 
> Wayne
> 
> ---------------------------------------------------------------------
> 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://www.nabble.com/Maven-collect-JAR-files-into-one-ZIP-tp23849432p23864206.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: Maven collect JAR files into one ZIP

Posted by Wayne Fay <wa...@gmail.com>.
> I think that better is to have plug-in that resolves deps(from POM) and adds
> into one ZIP.
> Jar with deps is not nice solution - long build proccess and I cant send
> send ~50MB files.

You realize that the Jar file format is essentially "zip plus some
text files", right? What do you think would be magically different in
this proposed Zip vs what Jar with deps is producing?

Wayne

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


Re: Maven collect JAR files into one ZIP

Posted by Wayne Fay <wa...@gmail.com>.
> I think that better is to have plug-in that resolves deps(from POM) and adds
> into one ZIP.
> Jar with deps is not nice solution - long build proccess and I cant send
> send ~50MB files.

You realize that the Jar file format is essentially "zip plus some
text files", right? What do you think would be magically different in
this proposed Zip vs what Jar with deps is producing?

Wayne

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


Re: Maven collect JAR files into one ZIP

Posted by Krabi <im...@hot.ee>.
Hi,

Yes I now that, but if I look at 
http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html#bin
http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html#bin 
then I must write a XML where I must point all files that are ZIPed!
I think that better is to have plug-in that resolves deps(from POM) and adds
into one ZIP.
Jar with deps is not nice solution - long build proccess and I cant send
send ~50MB files.


Deng Ching wrote:
> 
> Assembly plugin maybe?
> http://maven.apache.org/plugins/maven-assembly-plugin/
> 
> -Deng
> 
> On Wed, Jun 3, 2009 at 7:01 PM, Krabi <im...@hot.ee> wrote:
> 
>>
>> Hi,
>>
>> I have maven project. If I make eclipse project (mvn eclipse:eclipse)
>> then
>> from Eclipse I see, that
>> I have many dependency JAR files resolved. Is there any plug-in that can
>> make for me one ZIP file where all these are collected together? I found
>> that I can make one JAR where all these are collected. I don't need that
>> solution.
>> --
>> View this message in context:
>> http://www.nabble.com/Maven-collect-JAR-files-into-one-ZIP-tp23849432p23849432.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://www.nabble.com/Maven-collect-JAR-files-into-one-ZIP-tp23849432p23851158.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: Maven collect JAR files into one ZIP

Posted by Deng Ching <od...@gmail.com>.
Assembly plugin maybe?
http://maven.apache.org/plugins/maven-assembly-plugin/

-Deng

On Wed, Jun 3, 2009 at 7:01 PM, Krabi <im...@hot.ee> wrote:

>
> Hi,
>
> I have maven project. If I make eclipse project (mvn eclipse:eclipse) then
> from Eclipse I see, that
> I have many dependency JAR files resolved. Is there any plug-in that can
> make for me one ZIP file where all these are collected together? I found
> that I can make one JAR where all these are collected. I don't need that
> solution.
> --
> View this message in context:
> http://www.nabble.com/Maven-collect-JAR-files-into-one-ZIP-tp23849432p23849432.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
>
>