Unable to publish JAR ot Github Package Registry due to 404

I’m part of an organization and I’ve created a token for myself. I’ve updated my Gradle file to have a publication section.

publishing{  
repositories{  
maven{  
name ="GitHubPackages"  
url = uri("https://maven.pkg.github.com/myorg/mypackage")
credentials{  
username ="mridang"  
password ="\*\*\*\*\*\*\*"  
}  
 }  
 }  
publications{  
gpr(MavenPublication){  
from(components.java)
}  
 }  
}

When I run gradle publish I see it being uploaded and then it fails with  

Could not PUT 'https://maven.pkg.github.com/myorg/mypackage/com/myorg/mypackage/0.0.1-SNAPSHOT/mypackage-0.0.1-20200511.185059-1.jar'. Received status code 404 from server: Not Found

The group-id is com.myorg and I cannot seem to understand why it won’t publish.

1 Like

I believe the problem is that you need to specify the repository you want to associate with your package, not the package name.

For example:

url = uri("https://maven.pkg.github.com/ORG/REPO")

The 404 is because it can’t find a repository called mypackage .