Skip to content

Commit

Permalink
publishing config for applying pom attributes for gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Ski committed Aug 15, 2024
1 parent dc17f37 commit 1bf9b78
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ gradle-app.setting
.settings
bin
out/
local.properties
24 changes: 13 additions & 11 deletions publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,7 @@ subprojects
afterEvaluate { project ->
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
withType(MavenPublication) {
pom {
name = POM_NAME
description = POM_DESCRIPTION
Expand All @@ -41,12 +32,23 @@ subprojects
}
}
}
mavenJava(MavenPublication) {
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
}
}

repositories {
maven {
url = version.endsWith('SNAPSHOT') ? getSnapshotRepositoryUrl() : getReleaseRepositoryUrl()

if (getRepositoryUsername() || getRepositoryPassword())
{
credentials {
Expand Down

0 comments on commit 1bf9b78

Please sign in to comment.