Fork me on GitHub
#shadow-cljs
<
2022-12-23
>
William Mizuta17:12:02

I am trying to configure shadow-cljs.edn to use AWS codeartifact as a repository source. I ran the AWS codeartifact to update my ~/.m2/settings.xml with the tokens to authorize me to Download from codeartifact, but I am getting the error

DependencyResolutionException Failed to collect dependencies at xxx:xxx:jar:a.b.c
	org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies (DefaultRepositorySystem.java:351)
	jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
	jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
	jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke (Method.java:566)
	clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:167)
	clojure.lang.Reflector.invokeInstanceMethod (Reflector.java:102)
	cemerick.pomegranate.aether/resolve-dependencies* (aether.clj:806)
	cemerick.pomegranate.aether/resolve-dependencies* (aether.clj:707)
	clojure.core/apply (core.clj:665)
	clojure.core/apply (core.clj:660)
	cemerick.pomegranate.aether/resolve-dependencies (aether.clj:815)
Caused by:
DependencyCollectionException Failed to collect dependencies at xxx:xxx:jar:a.b.c
	org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies (DefaultDependencyCollector.java:293)
	org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies (DefaultRepositorySystem.java:307)
	jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)

...

AuthorizationException Not authorized , ReasonPhrase:Unauthorized.
	org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.fillInputData (AbstractHttpClientWagon.java:1021)
	org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.fillInputData (AbstractHttpClientWagon.java:976)
	org.apache.maven.wagon.StreamWagon.getInputStream (StreamWagon.java:126)
But the same works when I use leiningen to download the same dependency from AWS codeartifact.

William Mizuta21:12:35

It works when I explicit copy the username and password from ~/.m2/settings.xml that codeartificat generated

thheller06:12:30

hmm this is the same library that leiningen uses to resolve dependencies

thheller06:12:40

so I'm not sure what works differently

William Mizuta13:12:34

Looking at Leiningen code, there is a specific function to resolve the credentials: https://codeberg.org/leiningen/leiningen/src/branch/main/leiningen-core/src/leiningen/core/user.clj#L163