I have a very strange problem. I'm trying to publish a library to GH Packages private repository, but the action to ./gradlew publish
does nothing. It "succeeds", but nothing happens. Also produces no logs at all.
My repository is structured as a parent project, and one subproject, like this:
settings.gradle
rootProject.name = 'dark-commons'
include ":framework"
Now the build.gradle
in dark-commons root looks like this:
buildscript {
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
google()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
group = 'com.dark.dark-commons'
version = '1.0.0'
configurations.all {
resolutionStrategy.preferProjectModules()
}
repositories {
mavenCentral()
}
}
subprojects {
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.compilerArgs += ['-Xlint:all', '-Xlint:-serial']
}
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'kotlin'
repositories {
mavenLocal()
mavenCentral()
}
buildscript {
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
google()
}
}
allprojects {
group = 'com.dark.dark-commons'
version = '1.0.0'
configurations.all {
resolutionStrategy.preferProjectModules()
}
repositories {
mavenCentral()
}
}
subprojects {
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.compilerArgs += ['-Xlint:all', '-Xlint:-serial']
}
dependencies {
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: jacksonVersion
}
java {
withSourcesJar()
}
repositories {
mavenLocal()
mavenCentral()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/dark-com/dark-commons")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GRADLE_USER")
password = project.findProperty("gpr.key") ?: System.getenv("GRADLE_READ_KEY")
}
}
}
publishing {
repositories {
mavenLocal()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/dark-com/dark-commons")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
pom {
url = 'http://github.com/dark-com/dark-commons.git'
}
}
}
}
}
java {
withSourcesJar()
}
}
And then in my sub-module I only have the dependencies defined.
dependencies {
api "javax.activation:javax.activation-api:1.2.0"
api "javax.xml.bind:jaxb-api:2.2.11"
// Apache
api "org.apache.commons:commons-configuration2:$apacheCommonsVersion"
api "commons-codec:commons-codec:1.15"
}
I do have the repository in GitHub, so I don't really understand what's going on.
Nothing appears in my GitHub Packages when I do the ./gradlew publish
.