I am trying to use a jar file in my Clojure app. I have never done this before, but reading various articles on the web, I started by doing this, inside of my project:
mkdir maven_repository
mvn install:install-file -DgroupId=local -DartifactId=nlp -Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=original-nlp-1.0-SNAPSHOT.jar -DlocalRepositoryPath=maven_repository
And in my project.clj file I have:
[local/nlp "1.0-SNAPSHOT"]
but when I run:
lein clean
lein uberjar
I get this error:
Could not transfer artifact local:nlp:pom:1.0-SNAPSHOT from/to local (/salesslick/maven_repository/): no supported algorithms found
I've checked things like this:
lein uberjar
(Retrieving local/nlp/1.0-SNAPSHOT/nlp-1.0-SNAPSHOT.pom from local)
(Could not transfer artifact local:nlp:pom:1.0-SNAPSHOT from/to local (file:/Users/charlottesville/projects/ollio/salesslick/maven_repository/): no supported algorithms found)
This could be due to a typo in :dependencies or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.
Uberjar aborting because jar failed: Could not resolve dependencies
cat local/nlp/1.0-SNAPSHOT/nlp-1.0-SNAPSHOT.pom
cat maven_repository/local/nlp/1.0-SNAPSHOT/nlp-1.0-SNAPSHOT.pom
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>local</groupId>
<artifactId>nlp</artifactId>
<version>1.0-SNAPSHOT</version>
<description>POM was created from install:install-file</description>
</project>
lein --version
Leiningen 2.4.1 on Java 1.8.0_25 Java HotSpot(TM) 64-Bit Server VM
What am I doing wrong?
Joining really on time...
I had the same issue and the solution seems to be to actually use maven deploy instead of install.
So the command will look like this:
You also of course need
in your defproject and
in your dependencies. Note that in -Durl=file:repo file is needed (kind of obvious though) and repo is a folder in the root folder of your repository.
Another way to achieve the same result using purely Leiningen and forgetting about any mvn commands would be to use
instead of the mvn command shown above. This can save you the trouble of actually installing maven on a docker container for example (which can also be tricky depending on the container OS).
All this info is taken from here.