librelist archives

« back to archive

How to install an uberjar?

How to install an uberjar?

From:
Anth Courtney
Date:
2014-10-13 @ 08:44
Hello,

I'm looking to install an uberjar into my local repository for use by
another project.

Is there an easy way to achieve this?

I've tried using the lein-package plugin, and by following the classifier
test example, (
https://github.com/pliant/lein-package/tree/2.1/test-projects/test-classifier),
however I simply end up with my jar and uberjar being built without any
install activity.

Given this plugin hasn't been updated for 14 months, I'm loathe to invest
too much more time spent investigating it.

cheers,
Anth

Re: [leiningen] How to install an uberjar?

From:
Chris Jenkins
Date:
2014-10-13 @ 09:06
I assume you have a project that is a library that you want to use in
another project. I use the following for this purpose (run from the
directory of the library that you want to install):

lein install

It builds the library and installs it into your .m2 directory, thus making
it available when you build or run other projects on that machine.


On 13 October 2014 09:44, Anth Courtney <anthcourtney@gmail.com> wrote:

> Hello,
>
> I'm looking to install an uberjar into my local repository for use by
> another project.
>
> Is there an easy way to achieve this?
>
> I've tried using the lein-package plugin, and by following the classifier
> test example, (
> https://github.com/pliant/lein-package/tree/2.1/test-projects/test-classifier),
> however I simply end up with my jar and uberjar being built without any
> install activity.
>
> Given this plugin hasn't been updated for 14 months, I'm loathe to invest
> too much more time spent investigating it.
>
> cheers,
> Anth
>

Re: [leiningen] How to install an uberjar?

From:
Anth Courtney
Date:
2014-10-13 @ 09:58
A 'lein install' only installs the jar for my project, not the uberjar.

I need to depend upon the uberjar due to the nature of my projects (i.e.
project 1 is a web-app, project 2 is an installer of that web-app).
.

On Mon, Oct 13, 2014 at 8:06 PM, Chris Jenkins <cdpjenkins@gmail.com> wrote:

> I assume you have a project that is a library that you want to use in
> another project. I use the following for this purpose (run from the
> directory of the library that you want to install):
>
> lein install
>
> It builds the library and installs it into your .m2 directory, thus making
> it available when you build or run other projects on that machine.
>
>
> On 13 October 2014 09:44, Anth Courtney <anthcourtney@gmail.com> wrote:
>
>> Hello,
>>
>> I'm looking to install an uberjar into my local repository for use by
>> another project.
>>
>> Is there an easy way to achieve this?
>>
>> I've tried using the lein-package plugin, and by following the classifier
>> test example, (
>> https://github.com/pliant/lein-package/tree/2.1/test-projects/test-classifier),
>> however I simply end up with my jar and uberjar being built without any
>> install activity.
>>
>> Given this plugin hasn't been updated for 14 months, I'm loathe to invest
>> too much more time spent investigating it.
>>
>> cheers,
>> Anth
>>
>
>

Re: [leiningen] How to install an uberjar?

From:
Chris Jenkins
Date:
2014-10-13 @ 12:53
Apologies, I should have read your email a little more carefully. I'd be
interested to hear if you do figure out a way to automatically publish an
uberjar into your local repository.

On 13 October 2014 10:58, Anth Courtney <anthcourtney@gmail.com> wrote:

> A 'lein install' only installs the jar for my project, not the uberjar.
>
> I need to depend upon the uberjar due to the nature of my projects (i.e.
> project 1 is a web-app, project 2 is an installer of that web-app).
> .
>
> On Mon, Oct 13, 2014 at 8:06 PM, Chris Jenkins <cdpjenkins@gmail.com>
> wrote:
>
>> I assume you have a project that is a library that you want to use in
>> another project. I use the following for this purpose (run from the
>> directory of the library that you want to install):
>>
>> lein install
>>
>> It builds the library and installs it into your .m2 directory, thus
>> making it available when you build or run other pr ojects on that machine.
>>
>>
>> On 13 October 2014 09:44, Anth Courtney <anthcourtney@gmail.com> wrote:
>>
>>> Hello,
>>>
>>> I'm looking to install an uberjar into my local repository for use by
>>> another project.
>>>
>>> Is there an easy way to achieve this?
>>>
>>> I've tried using the lein-package plugin, and by following the
>>> classifier test example, (
>>> 
https://github.com/pliant/lein-package/tree/2.1/test-projects/test-classifier),
>>> however I simply end up with my jar and uberjar being built without any
>>> install activity.
>>>
>>> Given this plugin hasn't been updated for 14 months, I'm loathe to
>>> invest too much more time spent investigating it.
>>>
>>> cheers,
>>> Anth
>>>
>>
>>
>

Re: [leiningen] How to install an uberjar?

From:
David Kincaid
Date:
2014-10-13 @ 13:26
I use the lein-localrepo <https://github.com/kumarshantanu/lein-localrepo>
plugin all the time to do this. Works great.

- Dave

On Mon, Oct 13, 2014 at 7:53 AM, Chris Jenkins <cdpjenkins@gmail.com> wrote:

> Apologies, I should have read your email a little more carefully. I'd be
> interested to hear if you do figure out a way to automatically publish an
> uberjar into your local repository.
>
> On 13 October 2014 10:58, Anth Courtney <anthcourtney@gmail.com> wrote:
>
>> A 'lein install' only installs the jar for my project, not the uberjar.
>>
>> I need to depend upon the uberjar due to the nature of my projects (i.e.
>> project 1 is a web-app, project 2 is an installer of that web-app).
>> .
>>
>> On Mon, Oct 13, 2014 at 8:06 PM, Chris Jenkins <cdpjenkins@gmail.com>
>> wrote:
>>
>>> I assume you have a project that is a library that you want to use in
>>> another project. I use the following for this purpose (run from the
>>> directory of the library that you want to install):
>>>
>>> lein install
>>>
>>> It builds the library and installs it into your .m2 directory, thus
>>> making it available when you build or run other pr ojects on that machine.
>>>
>>>
>>> On 13 October 2014 09:44, Anth Courtney <anthcourtney@gmail.com> wrote:
>>>
>>>> Hello,
>>>>
>>>> I'm looking to install an uberjar into my local repository for use by
>>>> another project.
>>>>
>>>> Is there an easy way to achieve this?
>>>>
>>>> I've tried using the lein-package plugin, and by following the
>>>> classifier test example, (
>>>> 
https://github.com/pliant/lein-package/tree/2.1/test-projects/test-classifier),
>>>> however I simply end up with my jar and uberjar being built without any
>>>> install activity.
>>>>
>>>> Given this plugin hasn't been updated for 14 months, I'm loathe to
>>>> invest too much more time spent investigating it.
>>>>
>>>> cheers,
>>>> Anth
>>>>
>>>
>>>
>>
>

Re: [leiningen] How to install an uberjar?

From:
Anth Courtney
Date:
2014-10-15 @ 00:12
Thanks for the suggestion. I've used the lein-localrepo plugin to
successfully do what I needed.

cheers,
Anth

On Tue, Oct 14, 2014 at 12:26 AM, David Kincaid <kincaid.dave@gmail.com>
wrote:

> I use the lein-localrepo <https://github.com/kumarshantanu/lein-localrepo>
> plugin all the time to do this. Works great.
>
> - Dave
>
> On Mon, Oct 13, 2014 at 7:53 AM, Chris Jenkins <cdpjenkins@gmail.com>
> wrote:
>
>> Apologies, I should have read your email a little more carefully. I'd be
>> interested to hear if you do figure out a way to automatically publish an
>> uberjar into your local repository.
>>
>> On 13 October 2014 10:58, Anth Courtney <anthcourtney@gmail.com> wrote:
>>
>>> A 'lein install' only installs the jar for my project, not the uberjar.
>>>
>>> I need to depend upon the uberjar due to the nature of my projects (i.e.
>>> project 1 is a web-app, project 2 is an installer of that web-app).
>>> .
>>>
>>> On Mon, Oct 13, 2014 at 8:06 PM, Chris Jenkins <cdpjenkins@gmail.com>
>>> wrote:
>>>
>>>> I assume you have a project that is a library that you want to use in
>>>> another project. I use the following for this purpose (run from the
>>>> directory of the library that you want to install):
>>>>
>>>> lein install
>>>>
>>>> It builds the library and installs it into your .m2 dir ectory, thus
>>>> making it available when you build or run other pr ojects on that machine.
>>>>
>>>>
>>>> On 13 October 2014 09:44, Anth Courtney <anthcourtney@gmail.com> wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> I'm looking to install an uberjar into my local repository for use by
>>>>> another project.
>>>>>
>>>>> Is there an easy way to achieve this?
>>>>>
>>>>> I've tried using the lein-package plugin, and by following the
>>>>> classifier test example, (
>>>>> 
https://github.com/pliant/lein-package/tree/2.1/test-projects/test-classifier),
>>>>> however I simply end up with my jar and uberjar being built without any
>>>>> install activity.
>>>>>
>>>>> Given this plugin hasn't been updated for 14 months, I'm loathe to
>>>>> invest too much more time spent investigating it.
>>>>>
>>>>> cheers,
>>>>> Anth
>>>>>
>>>>
>>>>
>>>
>>
>

Re: [leiningen] How to install an uberjar?

From:
Phil Hagelberg
Date:
2014-10-13 @ 17:04
Anth Courtney <anthcourtney@gmail.com> writes:

> A 'lein install' only installs the jar for my project, not the uberjar.
>
> I need to depend upon the uberjar due to the nature of my projects (i.e.
> project 1 is a web-app, project 2 is an installer of that web-app).

I don't think the application/installer relationship is one that fits
the dependency model very well, but if you really need to do this, you
can just use the second arity of the `lein deploy` task, which takes
arbitrary file arguments.

However, if you do this, you will get duplicate copies of project 1's
dependencies on the classpath; one from inside the uberjar and one from
project 1's :dependencies, which is why I don't think depending on a
project makes any sense for an installer.

-Phil

Re: [leiningen] How to install an uberjar?

From:
Sebastian Hennebrueder
Date:
2014-10-13 @ 17:19
Hi,

the need for uberjar or uberwar depend on the deployment scenario. 

While some cloud environments read your project.clj and provide all 
dependencies as classpath, a simpler deployment infrastructure might 
prefer a single jar, so that it can easily be executed. The same is true 
for deployments to Jetty/Tomcat and co where war file including all 
dependencies is required.

I am using the lein package plugin to achieve different packaging styles. 
You need to add hooks, so that the leiningen plugin can actually be 
executed, when a install or deploy command is issued. Here is a snipped 
from my project.clj used for war deployment:

 :hooks [leiningen.package.hooks.deploy leiningen.package.hooks.install]
:package {:skipjar true :autobuild true
                      :artifacts [{:build "ring uberwar" :classifier 
"standalone" :extension "war"}]}



-- 
Best Regards / Viele Grüße

Sebastian Hennebrueder

-----
http://www.laliluna.de
Software developer and Coach for Java, JEE, Clojure and Java Persistence

Am 13.10.2014 um 19:04 schrieb Phil Hagelberg <phil@hagelb.org>:

> Anth Courtney <anthcourtney@gmail.com> writes:
> 
>> A 'lein install' only installs the jar for my project, not the uberjar.
>> 
>> I need to depend upon the uberjar due to the nature of my projects (i.e.
>> project 1 is a web-app, project 2 is an installer of that web-app).
> 
> I don't think the application/installer relationship is one that fits
> the dependency model very well, but if you really need to do this, you
> can just use the second arity of the `lein deploy` task, which takes
> arbitrary file arguments.
> 
> However, if you do this, you will get duplicate copies of project 1's
> dependencies on the classpath; one from inside the uberjar and one from
> project 1's :dependencies, which is why I don't think depending on a
> project makes any sense for an installer.
> 
> -Phil

Re: [leiningen] How to install an uberjar?

From:
Phil Hagelberg
Date:
2014-10-13 @ 17:51
Sebastian Hennebrueder <usenet@laliluna.de> writes:

> the need for uberjar or uberwar depend on the deployment scenario. 

I understand there are cases in which it makes sense to place uberjars
in repositories. But rather than declaring a dependency on those
uberjars from another application, it makes more sense to download them
directly, because otherwise you'll pull in their dependencies twice.

-Phil