I'm having a hard time publishing a Java library in its 0.0.1-SNAPSHOT version to GitHub Packages.
The library is a Gradle project. It would appear that, when the version is not on GitHub (yet), it gets created successfully, however after that, it never gets updated/overwritten, and the only way to publish a new SNAPSHOT version is to physically delete the existing one.
My build.gradle
:
plugins {
id 'java'
id 'maven-publish'
}
version = '0.0.1-SNAPSHOT'
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
repositories {
maven {
url = "https://maven.pkg.github.com/myOrg/myRepo"
credentials {
username = "myUsername"
password = "myPassword"
}
}
}
}
When I do gradle publish
(both locally or via GitHub actions), the log is nice and clean
> Task :compileJava UP-TO-DATE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE
> Task :jar UP-TO-DATE
> Task :javadoc UP-TO-DATE
> Task :javadocJar UP-TO-DATE
> Task :sourcesJar UP-TO-DATE
> Task :generateMetadataFileForMavenPublication
> Task :generatePomFileForMavenPublication
> Task :publishMavenPublicationToQuotechRepository
> Task :publish
BUILD SUCCESSFUL in 50s
8 actionable tasks: 3 executed, 5 up-to-date
even a gradle clean
, or wiping everything out doesn't make any difference. It seems that GitHub refuses to overwrite the existing SNAPSHOT with the new one. Checking timestamps on GitHub only points to the very first SNAPSHOT upload.
Any clue how to get this to work? Shouldn't a standard Maven repository automatically overwrite SNAPSHOT versions every time a new one is pushed?
Thanks