Re: Leiningen resource-paths

2014-07-25 Thread Yura Perov
Dear Thomas Heller, Dear Laurent Petit,
 

 I don't quite understand the issue against using the way I described.

 
We just did not want to have an additional dependency of Maven. For 
example, Maven should be independentally installed on Windows.

My suggestion then: instead of storing the jar files, unzip them in their 
 respective resource directories? Should solve the über jar problem if 
 Leiningen isn't too strict in filtering what's copied from resources 
 folders to final build dir. 


Yes, this is what we wanted, but on the other hand it creates too many 
files in the repository.

***

For our project we have decided to depend on Maven and require user to 
install Maven and execute these several commands to add jars to the local 
repository.

Thank you very much!

Yours faithfully,
Yura

On Thursday, July 24, 2014 5:43:57 PM UTC+1, Laurent PETIT wrote:

 My suggestion then: instead of storing the jar files, unzip them in their 
 respective resource directories? Should solve the über jar problem if 
 Leiningen isn't too strict in filtering what's copied from resources 
 folders to final build dir. 

 Le mercredi 23 juillet 2014, Yura Perov alf...@gmail.com javascript: 
 a écrit :

 In my project.clj I include two jar files:

 :resource-paths [resources/exterior_jars/forssj-optimization.jar 
 resources/exterior_jars/umontreal-ssj-2.5.jar]

 In my main.clj I import some objects from these dependencies:

 (ns myproject.main
   (:import [umontreal.iro.lecuyer.probdist ChiSquareDist])
   ...)

 So I am able to use them in main.clj:

 (println Hello)
 (println (. umontreal.iro.lecuyer.probdist.ChiSquareDist cdf 5 10 3.0))
 (println Bye)

 It perfectly works if I do lein run.

 However, if I do lein uberjar these dependencies are not included to the 
 standalone jar file.

 I know that there exist way to use local Maven repository, but I would 
 like to avoid this way to simplify things for anybody who wants to download 
 the source code and compile it quickly.

 Could you advise, please, is it possible to somehow force Leiningen to 
 include these two resources in the final standalone jar?

 Thank you.

 

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Leiningen resource-paths

2014-07-25 Thread Shantanu Kumar



 For our project we have decided to depend on Maven and require user to 
 install Maven and execute these several commands to add jars to the local 
 repository.


You could probably have a script that uses lein-localrepo (to install all 
dependencies in one go) if you don't want to install Maven. (Sorry about 
the plug.)

https://github.com/kumarshantanu/lein-localrepo

Shantanu

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Leiningen resource-paths

2014-07-24 Thread Thomas Heller
Hey,

I had this problem with a jar from Bing which is not available on maven.

You can use a local repo without any plugins or extra work for others.

Try this:

Pick a directory for your local maven repo, should be inside your git repo. 
I'm using maven.

Take your jar and run

mvn deploy:deploy-file -Dfile=lib/bing-reporting.jar 
-DartifactId=bing-reporting -Dversion=1.0.0 -DgroupId=smartchecker 
-Dpackaging=jar -Durl=file:maven

Obviously change your arguments, the important part is: -Durl=file:maven 
where maven is the directory.

Then in your project.xml

add

:repositories {local file:maven}

and depend on the jar as usual

[smartchecker/bing-reporting 1.0.0]

uberjar works as well as the rest.

Hope that helps,
/thomas


On Wednesday, July 23, 2014 12:43:38 PM UTC+2, Yura Perov wrote:

 In my project.clj I include two jar files:

 :resource-paths [resources/exterior_jars/forssj-optimization.jar 
 resources/exterior_jars/umontreal-ssj-2.5.jar]

 In my main.clj I import some objects from these dependencies:

 (ns myproject.main
   (:import [umontreal.iro.lecuyer.probdist ChiSquareDist])
   ...)

 So I am able to use them in main.clj:

 (println Hello)
 (println (. umontreal.iro.lecuyer.probdist.ChiSquareDist cdf 5 10 3.0))
 (println Bye)

 It perfectly works if I do lein run.

 However, if I do lein uberjar these dependencies are not included to the 
 standalone jar file.

 I know that there exist way to use local Maven repository, but I would 
 like to avoid this way to simplify things for anybody who wants to download 
 the source code and compile it quickly.

 Could you advise, please, is it possible to somehow force Leiningen to 
 include these two resources in the final standalone jar?

 Thank you.



-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Leiningen resource-paths

2014-07-24 Thread Yura Perov
Dear Thomas Heller,

Thank you very much for your reply.

As I mentioned in my initial post (sorry, it was a bit long), I 
successfully managed local Maven repository to work with Leiningen:

 I know that there exist way to use local Maven repository, but I would 
 like to avoid this way to simplify things for anybody who wants to download 
 the source code and compile it quickly.


However, local Maven is an additional issue developers should care about, 
and I am trying to find a way to avoid using it at least for exterior jars 
I am sure we do not need to update or care about their versions.

I am trying to understand how does Leiningen process :resource-paths 
directive and if there is a way to force classes from exterior jars be 
included in the producing standalone jar.

Yours faithfully,
Yura

On Thursday, July 24, 2014 9:18:51 AM UTC+1, Thomas Heller wrote:

 Hey,

 I had this problem with a jar from Bing which is not available on maven.

 You can use a local repo without any plugins or extra work for others.

 Try this:

 Pick a directory for your local maven repo, should be inside your git 
 repo. I'm using maven.

 Take your jar and run

 mvn deploy:deploy-file -Dfile=lib/bing-reporting.jar 
 -DartifactId=bing-reporting -Dversion=1.0.0 -DgroupId=smartchecker 
 -Dpackaging=jar -Durl=file:maven

 Obviously change your arguments, the important part is: -Durl=file:maven 
 where maven is the directory.

 Then in your project.xml

 add

 :repositories {local file:maven}

 and depend on the jar as usual

 [smartchecker/bing-reporting 1.0.0]

 uberjar works as well as the rest.

 Hope that helps,
 /thomas


 On Wednesday, July 23, 2014 12:43:38 PM UTC+2, Yura Perov wrote:

 In my project.clj I include two jar files:

 :resource-paths [resources/exterior_jars/forssj-optimization.jar 
 resources/exterior_jars/umontreal-ssj-2.5.jar]

 In my main.clj I import some objects from these dependencies:

 (ns myproject.main
   (:import [umontreal.iro.lecuyer.probdist ChiSquareDist])
   ...)

 So I am able to use them in main.clj:

 (println Hello)
 (println (. umontreal.iro.lecuyer.probdist.ChiSquareDist cdf 5 10 3.0))
 (println Bye)

 It perfectly works if I do lein run.

 However, if I do lein uberjar these dependencies are not included to the 
 standalone jar file.

 I know that there exist way to use local Maven repository, but I would 
 like to avoid this way to simplify things for anybody who wants to download 
 the source code and compile it quickly.

 Could you advise, please, is it possible to somehow force Leiningen to 
 include these two resources in the final standalone jar?

 Thank you.



-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Leiningen resource-paths

2014-07-24 Thread Thomas Heller
I don't quite understand the issue against using the way I described.

Assuming you keep everything in a git repo (inclucing that maven 
directory), only you have to execute the mvn command ONCE, all it does it 
put the file into the correct directory and generate the needed metadata 
files. After that users of your code just check out everything and run lein 
like normal. No extra maven commands to run or setup. IMHO its just the 
same as depending on the jar via :resource-paths. As I understand it there 
are other ways to setup local Maven depositories, maybe you tried it a 
different way which may require more steps. IIRC its mvn deploy:deploy-file 
vs install-file or something, can't remember exactly.

As for :resource-paths and how leiningen handles them: they are just 
appended to the classpath, thats about it. uberjar doesn't identify jars in 
there so just copies them INSIDE the uberjar so you'll have jar in a jar 
which java doesnt understand.

/thomas

On Thursday, July 24, 2014 3:22:37 PM UTC+2, Yura Perov wrote:

 Dear Thomas Heller,

 Thank you very much for your reply.

 As I mentioned in my initial post (sorry, it was a bit long), I 
 successfully managed local Maven repository to work with Leiningen:

 I know that there exist way to use local Maven repository, but I would 
 like to avoid this way to simplify things for anybody who wants to download 
 the source code and compile it quickly.


 However, local Maven is an additional issue developers should care about, 
 and I am trying to find a way to avoid using it at least for exterior jars 
 I am sure we do not need to update or care about their versions.

 I am trying to understand how does Leiningen process :resource-paths 
 directive and if there is a way to force classes from exterior jars be 
 included in the producing standalone jar.

 Yours faithfully,
 Yura

 On Thursday, July 24, 2014 9:18:51 AM UTC+1, Thomas Heller wrote:

 Hey,

 I had this problem with a jar from Bing which is not available on maven.

 You can use a local repo without any plugins or extra work for others.

 Try this:

 Pick a directory for your local maven repo, should be inside your git 
 repo. I'm using maven.

 Take your jar and run

 mvn deploy:deploy-file -Dfile=lib/bing-reporting.jar 
 -DartifactId=bing-reporting -Dversion=1.0.0 -DgroupId=smartchecker 
 -Dpackaging=jar -Durl=file:maven

 Obviously change your arguments, the important part is: -Durl=file:maven 
 where maven is the directory.

 Then in your project.xml

 add

 :repositories {local file:maven}

 and depend on the jar as usual

 [smartchecker/bing-reporting 1.0.0]

 uberjar works as well as the rest.

 Hope that helps,
 /thomas


 On Wednesday, July 23, 2014 12:43:38 PM UTC+2, Yura Perov wrote:

 In my project.clj I include two jar files:

 :resource-paths [resources/exterior_jars/forssj-optimization.jar 
 resources/exterior_jars/umontreal-ssj-2.5.jar]

 In my main.clj I import some objects from these dependencies:

 (ns myproject.main
   (:import [umontreal.iro.lecuyer.probdist ChiSquareDist])
   ...)

 So I am able to use them in main.clj:

 (println Hello)
 (println (. umontreal.iro.lecuyer.probdist.ChiSquareDist cdf 5 10 3.0))
 (println Bye)

 It perfectly works if I do lein run.

 However, if I do lein uberjar these dependencies are not included to 
 the standalone jar file.

 I know that there exist way to use local Maven repository, but I would 
 like to avoid this way to simplify things for anybody who wants to download 
 the source code and compile it quickly.

 Could you advise, please, is it possible to somehow force Leiningen to 
 include these two resources in the final standalone jar?

 Thank you.



-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Leiningen resource-paths

2014-07-24 Thread Laurent PETIT
My suggestion then: instead of storing the jar files, unzip them in their
respective resource directories? Should solve the über jar problem if
Leiningen isn't too strict in filtering what's copied from resources
folders to final build dir.

Le mercredi 23 juillet 2014, Yura Perov alfu...@gmail.com a écrit :

 In my project.clj I include two jar files:

 :resource-paths [resources/exterior_jars/forssj-optimization.jar
 resources/exterior_jars/umontreal-ssj-2.5.jar]

 In my main.clj I import some objects from these dependencies:

 (ns myproject.main
   (:import [umontreal.iro.lecuyer.probdist ChiSquareDist])
   ...)

 So I am able to use them in main.clj:

 (println Hello)
 (println (. umontreal.iro.lecuyer.probdist.ChiSquareDist cdf 5 10 3.0))
 (println Bye)

 It perfectly works if I do lein run.

 However, if I do lein uberjar these dependencies are not included to the
 standalone jar file.

 I know that there exist way to use local Maven repository, but I would
 like to avoid this way to simplify things for anybody who wants to download
 the source code and compile it quickly.

 Could you advise, please, is it possible to somehow force Leiningen to
 include these two resources in the final standalone jar?

 Thank you.

  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 javascript:_e(%7B%7D,'cvml','clojure@googlegroups.com');
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 javascript:_e(%7B%7D,'cvml','clojure%2bunsubscr...@googlegroups.com');
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com
 javascript:_e(%7B%7D,'cvml','clojure%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Leiningen resource-paths

2014-07-23 Thread Yura Perov
In my project.clj I include two jar files:

:resource-paths [resources/exterior_jars/forssj-optimization.jar 
resources/exterior_jars/umontreal-ssj-2.5.jar]

In my main.clj I import some objects from these dependencies:

(ns myproject.main
  (:import [umontreal.iro.lecuyer.probdist ChiSquareDist])
  ...)

So I am able to use them in main.clj:

(println Hello)
(println (. umontreal.iro.lecuyer.probdist.ChiSquareDist cdf 5 10 3.0))
(println Bye)

It perfectly works if I do lein run.

However, if I do lein uberjar these dependencies are not included to the 
standalone jar file.

I know that there exist way to use local Maven repository, but I would like 
to avoid this way to simplify things for anybody who wants to download the 
source code and compile it quickly.

Could you advise, please, is it possible to somehow force Leiningen to 
include these two resources in the final standalone jar?

Thank you.

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.