From ac22f6340410daeae82fe2c5954624f82076d6c3 Mon Sep 17 00:00:00 2001 From: qingmo Date: Tue, 26 Apr 2022 14:34:27 +0800 Subject: [PATCH] fix(gradlebuildconfig): add pom.xml & change swaggerV2 from runtime to compile for maven project (#438) add new pom.xml generate task in jar task && change swaggerV2 from implementation to api --- .gitignore | 2 ++ build.gradle | 5 +++++ swagger2markup/build.gradle | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 880dd1c3..275b24f0 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ build /.classpath /.project /.settings/ +*.ipr +*.iws \ No newline at end of file diff --git a/build.gradle b/build.gradle index ca7dafb2..95193523 100644 --- a/build.gradle +++ b/build.gradle @@ -35,6 +35,7 @@ ext { configure(project.coreProjects) { apply plugin: 'java' + apply plugin: 'java-library' apply plugin: 'maven' apply plugin: 'maven-publish' apply from: "${rootDir}/publishing.gradle" @@ -100,6 +101,10 @@ subprojects { // exclude subprojects that don't produce a jar file or by design. if (!project.name.equals('swagger2markup-bom') && !project.name.equals('swagger2markup-documentation')) { jar { + into("META-INF/maven/$project.group/$project.name") { + from {generatePomFileForMavenJavaPublication} + rename ".*", "pom.xml" + } inputs.property('moduleName', moduleName) manifest.attributes( 'Automatic-Module-Name': moduleName diff --git a/swagger2markup/build.gradle b/swagger2markup/build.gradle index 4e7d535c..fa2c0112 100644 --- a/swagger2markup/build.gradle +++ b/swagger2markup/build.gradle @@ -28,7 +28,7 @@ dependencies { implementation implLibraries.guava implementation implLibraries.paleo implementation implLibraries.slf4j - implementation implLibraries.swaggerV2 + api implLibraries.swaggerV2 implementation implLibraries.vavr testImplementation testLibraries.assertj testImplementation testLibraries.assertjDiff