Move api artifact to own module
This commit is contained in:
parent
8ad06a748a
commit
33dea801c1
4 changed files with 23 additions and 2 deletions
16
api/build.gradle.kts
Normal file
16
api/build.gradle.kts
Normal file
|
@ -0,0 +1,16 @@
|
|||
plugins {
|
||||
}
|
||||
|
||||
group = "org.springframework.samples"
|
||||
|
||||
val apiArtifact by configurations.creating {
|
||||
isCanBeResolved = false
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
artifacts {
|
||||
add(apiArtifact.name, file("${projectDir}/openapi.yml"))
|
||||
}
|
|
@ -7,6 +7,10 @@ plugins {
|
|||
|
||||
group = "org.springframework.samples"
|
||||
|
||||
val apiArtifact by configurations.creating {
|
||||
isCanBeConsumed = false
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(21)
|
||||
|
@ -24,6 +28,7 @@ repositories {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
apiArtifact(project(":api", "apiArtifact"))
|
||||
implementation("org.springframework.boot:spring-boot-starter-web")
|
||||
implementation("org.springframework.boot:spring-boot-starter-validation")
|
||||
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0")
|
||||
|
@ -38,7 +43,7 @@ java.sourceSets["main"].java {
|
|||
}
|
||||
|
||||
openApiGenerate {
|
||||
inputSpec.set("${projectDir}/src/main/resources/openapi.yml")
|
||||
inputSpec.set(apiArtifact.singleFile.absolutePath)
|
||||
outputDir.set(layout.buildDirectory.dir("generated/sources/openapi").map { it.asFile.absolutePath })
|
||||
generatorName.set("spring")
|
||||
library.set("spring-boot")
|
||||
|
|
|
@ -5,4 +5,4 @@
|
|||
* For more detailed information on multi-project builds, please refer to https://docs.gradle.org/8.7/userguide/multi_project_builds.html in the Gradle documentation.
|
||||
*/
|
||||
rootProject.name = "petclinic"
|
||||
include("backend", "backend-model")
|
||||
include("backend", "backend-model", "api")
|
||||
|
|
Loading…
Add table
Reference in a new issue