You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Kasun Siyambalapitiya <ka...@wso2.com> on 2017/11/10 05:30:01 UTC

Is there any possibility to reduce the size of maven distribution

Hi all,

I am currently working on a project which packs `maven` distribution in
itself, so that the programme is capable of performing a `maven` build if
the running system is having `Java` pre installed. Since the `maven`
distribution (apache-maven-3.5.2-bin.zip) size is around 9MB the total
resultant output of the program becomes bulky. Is there any way to reduce
the size of the `maven` distribution by keeping only the libs which
required for performing the maven build.

Thanks

-- 
*Regards,*

*Kasun Siyambalapitiya*
*Software Engineer*
WSO2 Inc. - http://wso2.com/
lean . enterprise . middleware
Tel : 0715523466
E mail : kasunsi@wso2.com
Blog: https://medium.com/@kasunsiyambalapitiya
<https://wso2.com/signature>

RE: Is there any possibility to reduce the size of maven distribution

Posted by Samuli Saarinen <sa...@remion.com>.
Hi,

You can do a successful build with mvnw too. It just downloads the maven distribution (the 9MB) also before Maven downloads "half the internet" when building.
So if you are not running the actual build in offline mode it's just 9MB more to download before running the build which gets also cached for future use.

br, 
Samuli

> -----Original Message-----
> From: Kasun Siyambalapitiya [mailto:kasunsi@wso2.com]
> Sent: 10. marraskuutata 2017 9:23
> To: Maven Users List <us...@maven.apache.org>
> Subject: Re: Is there any possibility to reduce the size of maven distribution
> 
> Hi Samuli,
> 
> Thank you for the quick response. But what I want is to reduce the size of
> a given `maven` distribution (if possible) without losing the ability of
> performing a successful build so that overall size of my application can be
> reduced. (`maven` distribution is around 9MB)
> 
> Once again thank your for quickly responding :)
> 
> On Fri, Nov 10, 2017 at 12:07 PM, Samuli Saarinen <
> samuli.saarinen@remion.com> wrote:
> 
> > Hi,
> >
> > Could you use maven wrapper [1]? It obviously needs to download Maven
> from
> > the interwebs when performing the build though.
> >
> > [1] https://github.com/takari/maven-wrapper
> >
> > br,
> > Samuli
> >
> > > -----Original Message-----
> > > From: Kasun Siyambalapitiya [mailto:kasunsi@wso2.com]
> > > Sent: 10. marraskuutata 2017 7:30
> > > To: users@maven.apache.org
> > > Subject: Is there any possibility to reduce the size of maven
> > distribution
> > >
> > > Hi all,
> > >
> > > I am currently working on a project which packs `maven` distribution in
> > > itself, so that the programme is capable of performing a `maven` build if
> > > the running system is having `Java` pre installed. Since the `maven`
> > > distribution (apache-maven-3.5.2-bin.zip) size is around 9MB the total
> > > resultant output of the program becomes bulky. Is there any way to
> reduce
> > > the size of the `maven` distribution by keeping only the libs which
> > > required for performing the maven build.
> > >
> > > Thanks
> > >
> > > --
> > > *Regards,*
> > >
> > > *Kasun Siyambalapitiya*
> > > *Software Engineer*
> > > WSO2 Inc. - http://wso2.com/
> > > lean . enterprise . middleware
> > > Tel : 0715523466
> > > E mail : kasunsi@wso2.com
> > > Blog: https://medium.com/@kasunsiyambalapitiya
> > > <https://wso2.com/signature>
> >
> 
> 
> 
> --
> *Regards,*
> 
> *Kasun Siyambalapitiya*
> *Software Engineer*
> WSO2 Inc. - http://wso2.com/
> lean . enterprise . middleware
> Tel : 0715523466
> E mail : kasunsi@wso2.com
> Blog: https://medium.com/@kasunsiyambalapitiya
> <https://wso2.com/signature>

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

Re: Is there any possibility to reduce the size of maven distribution

Posted by Kasun Siyambalapitiya <ka...@wso2.com>.
Hi Samuli,

Thank you for the quick response. But what I want is to reduce the size of
a given `maven` distribution (if possible) without losing the ability of
performing a successful build so that overall size of my application can be
reduced. (`maven` distribution is around 9MB)

Once again thank your for quickly responding :)

On Fri, Nov 10, 2017 at 12:07 PM, Samuli Saarinen <
samuli.saarinen@remion.com> wrote:

> Hi,
>
> Could you use maven wrapper [1]? It obviously needs to download Maven from
> the interwebs when performing the build though.
>
> [1] https://github.com/takari/maven-wrapper
>
> br,
> Samuli
>
> > -----Original Message-----
> > From: Kasun Siyambalapitiya [mailto:kasunsi@wso2.com]
> > Sent: 10. marraskuutata 2017 7:30
> > To: users@maven.apache.org
> > Subject: Is there any possibility to reduce the size of maven
> distribution
> >
> > Hi all,
> >
> > I am currently working on a project which packs `maven` distribution in
> > itself, so that the programme is capable of performing a `maven` build if
> > the running system is having `Java` pre installed. Since the `maven`
> > distribution (apache-maven-3.5.2-bin.zip) size is around 9MB the total
> > resultant output of the program becomes bulky. Is there any way to reduce
> > the size of the `maven` distribution by keeping only the libs which
> > required for performing the maven build.
> >
> > Thanks
> >
> > --
> > *Regards,*
> >
> > *Kasun Siyambalapitiya*
> > *Software Engineer*
> > WSO2 Inc. - http://wso2.com/
> > lean . enterprise . middleware
> > Tel : 0715523466
> > E mail : kasunsi@wso2.com
> > Blog: https://medium.com/@kasunsiyambalapitiya
> > <https://wso2.com/signature>
>



-- 
*Regards,*

*Kasun Siyambalapitiya*
*Software Engineer*
WSO2 Inc. - http://wso2.com/
lean . enterprise . middleware
Tel : 0715523466
E mail : kasunsi@wso2.com
Blog: https://medium.com/@kasunsiyambalapitiya
<https://wso2.com/signature>

RE: Is there any possibility to reduce the size of maven distribution

Posted by Samuli Saarinen <sa...@remion.com>.
Hi,

Could you use maven wrapper [1]? It obviously needs to download Maven from the interwebs when performing the build though.

[1] https://github.com/takari/maven-wrapper

br, 
Samuli

> -----Original Message-----
> From: Kasun Siyambalapitiya [mailto:kasunsi@wso2.com]
> Sent: 10. marraskuutata 2017 7:30
> To: users@maven.apache.org
> Subject: Is there any possibility to reduce the size of maven distribution
> 
> Hi all,
> 
> I am currently working on a project which packs `maven` distribution in
> itself, so that the programme is capable of performing a `maven` build if
> the running system is having `Java` pre installed. Since the `maven`
> distribution (apache-maven-3.5.2-bin.zip) size is around 9MB the total
> resultant output of the program becomes bulky. Is there any way to reduce
> the size of the `maven` distribution by keeping only the libs which
> required for performing the maven build.
> 
> Thanks
> 
> --
> *Regards,*
> 
> *Kasun Siyambalapitiya*
> *Software Engineer*
> WSO2 Inc. - http://wso2.com/
> lean . enterprise . middleware
> Tel : 0715523466
> E mail : kasunsi@wso2.com
> Blog: https://medium.com/@kasunsiyambalapitiya
> <https://wso2.com/signature>

Re: Is there any possibility to reduce the size of maven distribution

Posted by Kasun Siyambalapitiya <ka...@wso2.com>.
Hi Samuli,

Thanks for the reply. As with the response from Anders, I decided to keep
the distribution as it is since it having only the basic features required
for build.

Thank you once again :)

On Fri, Nov 10, 2017 at 2:57 PM, Dan Tran <da...@gmail.com> wrote:

> I believe you can shave off 1 to 2M by removing those already shaded by
> wagon-http.
>
> -D
>
> On Fri, Nov 10, 2017 at 1:18 AM, Kasun Siyambalapitiya <ka...@wso2.com>
> wrote:
>
> > Hi Anders,
> >
> > Thank you for the quick response, I'll keep it as it is then :)
> >
> > On Fri, Nov 10, 2017 at 2:03 PM, Anders Hammar <an...@hammar.net>
> wrote:
> >
> > > I doubt there is very much you can remove. The Maven installation just
> > > includes the basic features to perform the core features of a build,
> then
> > > additional plugins are downloaded as needed to do specific tasks during
> > the
> > > build steps. I think that you could reduce the size by removing the
> color
> > > logging support (jansi).
> > >
> > > Please keep in mind that Maven will (typically) download A LOT of
> > artifacts
> > > during the build. So the 9MB of Maven core is not your main concern if
> > you
> > > want to keep the total size down.
> > >
> > > /Anders
> > >
> > > On Fri, Nov 10, 2017 at 6:30 AM, Kasun Siyambalapitiya <
> kasunsi@wso2.com
> > >
> > > wrote:
> > >
> > > > Hi all,
> > > >
> > > > I am currently working on a project which packs `maven` distribution
> in
> > > > itself, so that the programme is capable of performing a `maven`
> build
> > if
> > > > the running system is having `Java` pre installed. Since the `maven`
> > > > distribution (apache-maven-3.5.2-bin.zip) size is around 9MB the
> total
> > > > resultant output of the program becomes bulky. Is there any way to
> > reduce
> > > > the size of the `maven` distribution by keeping only the libs which
> > > > required for performing the maven build.
> > > >
> > > > Thanks
> > > >
> > > > --
> > > > *Regards,*
> > > >
> > > > *Kasun Siyambalapitiya*
> > > > *Software Engineer*
> > > > WSO2 Inc. - http://wso2.com/
> > > > lean . enterprise . middleware
> > > > Tel : 0715523466
> > > > E mail : kasunsi@wso2.com
> > > > Blog: https://medium.com/@kasunsiyambalapitiya
> > > > <https://wso2.com/signature>
> > > >
> > >
> >
> >
> >
> > --
> > *Regards,*
> >
> > *Kasun Siyambalapitiya*
> > *Software Engineer*
> > WSO2 Inc. - http://wso2.com/
> > lean . enterprise . middleware
> > Tel : 0715523466
> > E mail : kasunsi@wso2.com
> > Blog: https://medium.com/@kasunsiyambalapitiya
> > <https://wso2.com/signature>
> >
>



-- 
*Regards,*

*Kasun Siyambalapitiya*
*Software Engineer*
WSO2 Inc. - http://wso2.com/
lean . enterprise . middleware
Tel : 0715523466
E mail : kasunsi@wso2.com
Blog: https://medium.com/@kasunsiyambalapitiya
<https://wso2.com/signature>

Re: Is there any possibility to reduce the size of maven distribution

Posted by Dan Tran <da...@gmail.com>.
I believe you can shave off 1 to 2M by removing those already shaded by
wagon-http.

-D

On Fri, Nov 10, 2017 at 1:18 AM, Kasun Siyambalapitiya <ka...@wso2.com>
wrote:

> Hi Anders,
>
> Thank you for the quick response, I'll keep it as it is then :)
>
> On Fri, Nov 10, 2017 at 2:03 PM, Anders Hammar <an...@hammar.net> wrote:
>
> > I doubt there is very much you can remove. The Maven installation just
> > includes the basic features to perform the core features of a build, then
> > additional plugins are downloaded as needed to do specific tasks during
> the
> > build steps. I think that you could reduce the size by removing the color
> > logging support (jansi).
> >
> > Please keep in mind that Maven will (typically) download A LOT of
> artifacts
> > during the build. So the 9MB of Maven core is not your main concern if
> you
> > want to keep the total size down.
> >
> > /Anders
> >
> > On Fri, Nov 10, 2017 at 6:30 AM, Kasun Siyambalapitiya <kasunsi@wso2.com
> >
> > wrote:
> >
> > > Hi all,
> > >
> > > I am currently working on a project which packs `maven` distribution in
> > > itself, so that the programme is capable of performing a `maven` build
> if
> > > the running system is having `Java` pre installed. Since the `maven`
> > > distribution (apache-maven-3.5.2-bin.zip) size is around 9MB the total
> > > resultant output of the program becomes bulky. Is there any way to
> reduce
> > > the size of the `maven` distribution by keeping only the libs which
> > > required for performing the maven build.
> > >
> > > Thanks
> > >
> > > --
> > > *Regards,*
> > >
> > > *Kasun Siyambalapitiya*
> > > *Software Engineer*
> > > WSO2 Inc. - http://wso2.com/
> > > lean . enterprise . middleware
> > > Tel : 0715523466
> > > E mail : kasunsi@wso2.com
> > > Blog: https://medium.com/@kasunsiyambalapitiya
> > > <https://wso2.com/signature>
> > >
> >
>
>
>
> --
> *Regards,*
>
> *Kasun Siyambalapitiya*
> *Software Engineer*
> WSO2 Inc. - http://wso2.com/
> lean . enterprise . middleware
> Tel : 0715523466
> E mail : kasunsi@wso2.com
> Blog: https://medium.com/@kasunsiyambalapitiya
> <https://wso2.com/signature>
>

Re: Is there any possibility to reduce the size of maven distribution

Posted by Kasun Siyambalapitiya <ka...@wso2.com>.
Hi Anders,

Thank you for the quick response, I'll keep it as it is then :)

On Fri, Nov 10, 2017 at 2:03 PM, Anders Hammar <an...@hammar.net> wrote:

> I doubt there is very much you can remove. The Maven installation just
> includes the basic features to perform the core features of a build, then
> additional plugins are downloaded as needed to do specific tasks during the
> build steps. I think that you could reduce the size by removing the color
> logging support (jansi).
>
> Please keep in mind that Maven will (typically) download A LOT of artifacts
> during the build. So the 9MB of Maven core is not your main concern if you
> want to keep the total size down.
>
> /Anders
>
> On Fri, Nov 10, 2017 at 6:30 AM, Kasun Siyambalapitiya <ka...@wso2.com>
> wrote:
>
> > Hi all,
> >
> > I am currently working on a project which packs `maven` distribution in
> > itself, so that the programme is capable of performing a `maven` build if
> > the running system is having `Java` pre installed. Since the `maven`
> > distribution (apache-maven-3.5.2-bin.zip) size is around 9MB the total
> > resultant output of the program becomes bulky. Is there any way to reduce
> > the size of the `maven` distribution by keeping only the libs which
> > required for performing the maven build.
> >
> > Thanks
> >
> > --
> > *Regards,*
> >
> > *Kasun Siyambalapitiya*
> > *Software Engineer*
> > WSO2 Inc. - http://wso2.com/
> > lean . enterprise . middleware
> > Tel : 0715523466
> > E mail : kasunsi@wso2.com
> > Blog: https://medium.com/@kasunsiyambalapitiya
> > <https://wso2.com/signature>
> >
>



-- 
*Regards,*

*Kasun Siyambalapitiya*
*Software Engineer*
WSO2 Inc. - http://wso2.com/
lean . enterprise . middleware
Tel : 0715523466
E mail : kasunsi@wso2.com
Blog: https://medium.com/@kasunsiyambalapitiya
<https://wso2.com/signature>

Re: Is there any possibility to reduce the size of maven distribution

Posted by Anders Hammar <an...@hammar.net>.
I doubt there is very much you can remove. The Maven installation just
includes the basic features to perform the core features of a build, then
additional plugins are downloaded as needed to do specific tasks during the
build steps. I think that you could reduce the size by removing the color
logging support (jansi).

Please keep in mind that Maven will (typically) download A LOT of artifacts
during the build. So the 9MB of Maven core is not your main concern if you
want to keep the total size down.

/Anders

On Fri, Nov 10, 2017 at 6:30 AM, Kasun Siyambalapitiya <ka...@wso2.com>
wrote:

> Hi all,
>
> I am currently working on a project which packs `maven` distribution in
> itself, so that the programme is capable of performing a `maven` build if
> the running system is having `Java` pre installed. Since the `maven`
> distribution (apache-maven-3.5.2-bin.zip) size is around 9MB the total
> resultant output of the program becomes bulky. Is there any way to reduce
> the size of the `maven` distribution by keeping only the libs which
> required for performing the maven build.
>
> Thanks
>
> --
> *Regards,*
>
> *Kasun Siyambalapitiya*
> *Software Engineer*
> WSO2 Inc. - http://wso2.com/
> lean . enterprise . middleware
> Tel : 0715523466
> E mail : kasunsi@wso2.com
> Blog: https://medium.com/@kasunsiyambalapitiya
> <https://wso2.com/signature>
>