Using GitHub Packages with Apache Ivy

Hello,

I’m using Apache Ivy to manage dependencies for my project and I’m trying to add a GitHub Package as one of the dependencies.

Has anyone successfully gotten this to work? I can’t seem find the right configuration for the GitHub resolver in my ivysettings.xml file.

Here is the package I’m trying to add: Package org.voyant-tools.trombone · voyanttools/trombone · GitHub

Here is the dependency entry:

<dependency org="voyanttools" name="trombone" rev="5.2.1" />

And here is my ivysettings.xml file:

<ivysettings>
    <settings defaultResolver="ibiblio"/>
    <resolvers>
        <ibiblio name="ibiblio" />
        <url name="github" m2compatible="true">
            <artifact pattern="https://maven.pkg.github.com/[organisation]/[module]/[artifact]-[revision].[ext]" />
        </url>
    </resolvers>
    <modules>
        <module organisation="voyanttools" name="*" resolver="github" />
    </modules>
    <property name="github.user" value="foo" override="false" />
    <property name="github.token" value="bar" override="false" />
    <credentials host="maven.pkg.github.com" realm="GitHub Package Registry" username="${github.user}" passwd="${github.token}" />
</ivysettings>

(I am passing my actual GitHub username and PAT via the command line.)

Here’s the debug output I’m getting when running ivy:

[ivy:retrieve] try to get credentials for: GitHub Package Registry@maven.pkg.github.com
[ivy:retrieve] authentication: k='GitHub Package Registry@maven.pkg.github.com' c='GitHub Package Registry@maven.pkg.github.com ajmacdonald/****************************************'
Class java.net.PasswordAuthentication loaded from parent loader (parentFirst)
[ivy:retrieve] HTTP response status: 422 url=https://maven.pkg.github.com/voyanttools/trombone/trombone-5.2.1.jar
[ivy:retrieve] CLIENT ERROR: Unprocessable Entity url=https://maven.pkg.github.com/voyanttools/trombone/trombone-5.2.1.jar
[ivy:retrieve] 	github: resource not reachable for voyanttools#trombone;5.2.1: res=https://maven.pkg.github.com/voyanttools/trombone/trombone-5.2.1.jar
[ivy:retrieve] 	github: no ivy file nor artifact found for voyanttools#trombone;5.2.1
[ivy:retrieve] WARN: 	module not found: voyanttools#trombone;5.2.1
[ivy:retrieve] WARN: ==== github: tried
[ivy:retrieve] WARN:   -- artifact voyanttools#trombone;5.2.1!trombone.jar:
[ivy:retrieve] WARN:   https://maven.pkg.github.com/voyanttools/trombone/trombone-5.2.1.jar

Any help or pointers would be greatly appreciated!