I am struggling to publish artifacts to Maven repository (Packages) through gradle.
Note: Publishing using pom worked as expected.
Here’s what i tried so far. (Note: it’s kotlin DSL syntax)
publishing {
publications {
create(“mavenJava”) {
from(components[“java”])
}
}
repositories {
maven {
name = “gitlab-maven”
url = uri(“https://gitlab.com/api/v4/projects/Package-ID/packages/maven”)
credentials(HttpHeaderCredentials::class) {
name = “Private-Token”
value = “TOKEN”
}
authentication {
create(“header”)
}
}
}
}
When i try to publish everything go through fine without any error BUT i can’t see anything gets uploaded to packages.
NOTE: Publishing to Local works just fine.
I would appreciate any pointers where exactly i am making any mistake.
Thanks.
Zeeshan.