Unable to push artifact to GitHub Packages

41 views Asked by At

I am trying to push an artifact to GitHub packages with GitHub actions. But I'm getting following error:

Failed to deploy artifacts: Could not find artifact com.test.shared:test-shared-models:jar:1.0.5 in github (https://maven.pkg.github.com/iamvasu/test-shared-models)

Here are the steps I followed:

Added following snippet to pom.xml:

<distributionManagement>
        <repository>
            <id>github</id>
            <name>GitHub OWNER Apache Maven Packages</name>
            <url>https://maven.pkg.github.com/iamvasu/test-shared-models</url>
        </repository>
</distributionManagement>

and here is my ~/.m2/settings.xml:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">

  <activeProfiles>
    <activeProfile>github</activeProfile>
  </activeProfiles>

  <profiles>
    <profile>
      <id>github</id>
      <repositories>
        <repository>
          <id>central</id>
          <url>https://repo1.maven.org/maven2</url>
        </repository>
        <repository>
          <id>github</id>
          <url>https://maven.pkg.github.com/iamvasu/test-shared-models</url>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
      </repositories>
    </profile>
  </profiles>

  <servers>
    <server>
      <id>github</id>
      <username>username</username>
      <password>password</password>
    </server>
  </servers>
</settings>

And finally I ran:

mvn deploy

What am I missing?

0

There are 0 answers