Skip to content

Commit

Permalink
added pom config
Browse files Browse the repository at this point in the history
  • Loading branch information
tanya732 committed Sep 20, 2024
1 parent 5645355 commit e6b1bb0
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions gradle/maven-publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ task('sourcesJar', type: Jar, dependsOn: classes) {
}

task('javadocJar', type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
archiveClassifier = 'javadoc'
from javadoc.getDestinationDir()
}
tasks.withType(Javadoc).configureEach {
Expand Down Expand Up @@ -37,11 +37,10 @@ publishing {
artifactId = POM_ARTIFACT_ID
version = getVersionName()

artifact("$buildDir/libs/${project.name}-${version}.jar")
artifact sourcesJar
artifact javadocJar

from components.java

pom {
name = POM_NAME
packaging = POM_PACKAGING
Expand Down Expand Up @@ -69,6 +68,17 @@ publishing {
connection = POM_SCM_CONNECTION
developerConnection = POM_SCM_DEV_CONNECTION
}

pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')

project.configurations.implementation.allDependencies.each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
Expand Down

0 comments on commit e6b1bb0

Please sign in to comment.