Hello! Could somebody be so kind and explain to me why clj is trying to download a dependency from Maven Central when I told it to you our company repository (I assume M.C. is always used as a back up; but it doesn't seem it has even tried?!:
$ cat deps.edn
{:mvn/repos {"telia-aws" {:url "<https://my.company.net/component/artifacts>"}}
:deps {com.oracle.jdbc/ojdbc8 {:mvn/version "12.2.0.1"}}}
$ deps.exe -Sverbose
deps.clj version = 0.0.8
...
Refreshing classpath
Error building classpath. Could not find artifact com.oracle.jdbc:ojdbc8:jar:12.2.0.1 in central (<https://repo1.maven.org/maven2/>)
đ Thank you!I think that error message just picks a repo and doesn't list all of them
It seems you were right! The problem turned out to be that my URL was wrong, it was missing a part of the path. The -Sverbose
option was quite useless for troubleshooting this... :-(
Any idea why is clj trying to download a snapshot .jar from Central (where it isn't) when I have it in the local .m2 repo? Do I need to tell it to use the local repo?? > Error building classpath. Could not find artifact no.telia:clj-common:jar:0.1.0-20200507.122109-9 in central (https://repo1.maven.org/maven2/)
ls ~/.m2/repository/no/telia/clj-common/0.1.0-SNAPSHOT/clj-common-0.1.0-20200507.122109-9.jar
/Users/me/.m2/repository/no/telia/clj-common/0.1.0-SNAPSHOT/clj-common-0.1.0-20200507.122109-9.jar
The dependency is declared as:
no.telia/clj-common {:mvn/version "0.1.0-20200507.122109-9"} ;; a particular SNAPSHOT
SNAPSHOT versions are refreshed from external repositories at least once a day (by default, you can configure this in .m2
settings I believe)
it's maven behavior
Ah, ok. And if it fails to refresh, it just crashes without using the old version?
I found http://maven.apache.org/ref/3.6.2/maven-settings/settings.html#class_snapshots, I can try to set updatePolicy
to never...
Hm, it seems that clj simply ignores my local .m2/repository. Now it is trying to download com.oracle.jdbc:ucp:pom:12.2.0.1 even though ~/.m2/repository/com/oracle/jdbc/ucp/12.2.0.1/ucp-12.2.0.1.jar
exists...:
$ cat deps.edn
{:deps {com.oracle.jdbc/ucp {:mvn/version "12.2.0.1"}}}
$ clj
Error building classpath. Could not find artifact com.oracle.jdbc:ucp:jar:12.2.0.1 in central (<https://repo1.maven.org/maven2/>)
$ ls -lh ~/.m2/repository/com/oracle/jdbc/ucp/12.2.0.1/ucp-12.2.0.1.jar
-rw-r--r-- 1 holyjak staff 1.0M Apr 2 13:55 /Users/holyjak/.m2/repository/com/oracle/jdbc/ucp/12.2.0.1/ucp-12.2.0.1.jar
Why?!did you put that jar manually in your .m2?
if so, you may be missing some metadata in your local cache that's triggering a lookup
deps doesn't currently expose this setting
So it doesn't take all of settings.xml into account, only parts of it (ie auth)?
it does not consider that setting, it does take more than just auth though
No, via mvn install-file . And it used to work...
https://clojure.org/reference/deps_and_cli describes supported stuff
specifically, also supports mirrors and proxies
and http properties
based on what I see here, I would expect it to find and use the jar in your local cache
you might want to clj -Sforce to make sure you don't have a cached classpath or something
I don't think that will matter since it seems to be building the classpath when it encounters the error, but just a good habit when diagnosing clj stuff
Ok, thank you!