Skip to content

Commit

Permalink
Merge pull request #389 from raynigon/feature/improve-dependency-reso…
Browse files Browse the repository at this point in the history
…lution

Improve Dependency Resolution
  • Loading branch information
raynigon authored Nov 12, 2024
2 parents 879756f + 1758906 commit 3af3456
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 59 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ subprojects {

dependencies {
// Commons Lang
implementation("org.apache.commons:commons-lang3:3.17.0")
api("org.apache.commons:commons-lang3:3.17.0")

// Spock
testImplementation(platform("org.spockframework:spock-bom:2.4-M4-groovy-4.0"))
Expand Down
6 changes: 3 additions & 3 deletions ecs-logging-access/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dependencies {
implementation(project(':ecs-logging-base'))
implementation('ch.qos.logback.access:common:2.0.3')
implementation("ch.qos.logback.access:tomcat:2.0.3"){
api(project(':ecs-logging-base'))
api("ch.qos.logback.access:common:2.0.3")
api("ch.qos.logback.access:tomcat:2.0.3"){
exclude group: 'org.apache.tomcat'
}
compileOnly("org.springframework.boot:spring-boot-starter-web")
Expand Down
2 changes: 1 addition & 1 deletion ecs-logging-app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dependencies {
implementation(project(':ecs-logging-base'))
api(project(':ecs-logging-base'))
compileOnly("org.springframework.boot:spring-boot-starter-web")
testImplementation("org.springframework.boot:spring-boot-starter-web")

Expand Down
3 changes: 1 addition & 2 deletions ecs-logging-async/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
dependencies {
implementation(project(':ecs-logging-base'))
api(project(':ecs-logging-base'))
compileOnly("org.springframework.boot:spring-boot-starter-web")
compileOnly("io.micrometer:micrometer-core")
testImplementation("org.springframework.boot:spring-boot-starter-web")

compileOnly("ch.qos.logback:logback-core")
testImplementation("io.micrometer:micrometer-core")
Expand Down
2 changes: 1 addition & 1 deletion ecs-logging-audit/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dependencies {
implementation project(':ecs-logging-base')
api(project(':ecs-logging-base'))
compileOnly("org.springframework.boot:spring-boot-starter-web")
testImplementation("org.springframework.boot:spring-boot-starter-web")
}
6 changes: 3 additions & 3 deletions ecs-logging-kafka/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dependencies {
implementation project(':ecs-logging-base')
implementation("org.slf4j:slf4j-api:2.0.16")
implementation("jakarta.annotation:jakarta.annotation-api:3.0.0")
api(project(':ecs-logging-base'))
api("org.slf4j:slf4j-api:2.0.16")
api("jakarta.annotation:jakarta.annotation-api:3.0.0")
compileOnly("org.springframework.kafka:spring-kafka")

testImplementation("org.springframework.kafka:spring-kafka")
Expand Down
4 changes: 2 additions & 2 deletions ecs-logging-okhttp3/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies {
implementation(project(':ecs-logging-base'))
implementation("org.slf4j:slf4j-api:2.0.16")
api(project(':ecs-logging-base'))
api("org.slf4j:slf4j-api:2.0.16")
compileOnly("com.squareup.okhttp3:okhttp:4.12.0")
compileOnly("ch.qos.logback:logback-core")

Expand Down
76 changes: 30 additions & 46 deletions gradle/scripts/publishing.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

signing {
required {
findProperty("signingKey") != null
Expand All @@ -22,58 +21,43 @@ publishing {
}
}
publications {
basic(MavenPublication) {
create("maven", MavenPublication) {
artifactId = project.name

artifact project.tasks.jar
artifact sourcesJar
artifact javadocJar
from components.java

pom.withXml {
def rootNode = asNode()
rootNode.children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST

name project.name
description "The ${project.name} is a part of the unit-api"
url 'https://github.com/raynigon/spring-boot/'
issueManagement {
system 'GitHub'
url 'https://github.com/raynigon/spring-boot/issues'
}
licenses {
license {
name 'Apache-2.0'
url 'https://opensource.org/licenses/Apache-2.0'
}
}
scm {
url 'https://github.com/raynigon/spring-boot/'
connection 'scm:git:git://github.com/raynigon/spring-boot.git'
developerConnection 'scm:git:ssh://[email protected]/raynigon/spring-boot.git'
}
developers {
developer {
id 'raynigon'
name 'Simon Schneider'
email '[email protected]'
}
pom {
name = project.name
description = "The ${project.name} is a part of the unit-api"
url = 'https://github.com/raynigon/spring-boot/'
issueManagement {
system = 'GitHub'
url = 'https://github.com/raynigon/spring-boot/issues'
}
licenses {
license {
name = 'Apache-2.0'
url = 'https://opensource.org/licenses/Apache-2.0'
}
}

rootNode.remove((Node) ((Node) rootNode).get("dependencyManagement").get(0))
def dependenciesNode = rootNode.appendNode('dependencies')

def addDependency = { dependency, scope ->
dependenciesNode.appendNode('dependency').with {
appendNode('groupId', dependency.group)
appendNode('artifactId', dependency.name)
appendNode('version', dependency.version)
appendNode('scope', scope)
scm {
url = 'https://github.com/raynigon/spring-boot/'
connection = 'scm:git:git://github.com/raynigon/spring-boot.git'
developerConnection = 'scm:git:ssh://[email protected]/raynigon/spring-boot.git'
}
developers {
developer {
id = 'raynigon'
name = 'Simon Schneider'
email = '[email protected]'
}
}
project.configurations.implementation.dependencies.each { addDependency(it, 'compile') }
}
// Remove Spring Boot Dependency Management
pom.withXml {
def rootNode = asNode()
rootNode.remove((Node) ((Node) rootNode).get("dependencyManagement").get(0))
}
}
}
}
}

0 comments on commit 3af3456

Please sign in to comment.