1- plugins {
2- val nmcpVersion = " 1.2.0"
3- val mavenPluginDevVersion = " 1.0.3"
1+ plugins { id(" org.gradlex.maven-plugin-development" ) version " 1.0.3" }
42
5- id(" com.gradleup.nmcp" ) version nmcpVersion
6- id(" com.gradleup.nmcp.aggregation" ) version nmcpVersion
7- id(" org.gradlex.maven-plugin-development" ) version mavenPluginDevVersion
8- id(" maven-publish" )
9- id(" signing" )
10- id(" checkstyle" )
11- }
12-
13- group = " org.gradlex"
143version = " 1.2"
154
165val mvnVersion = " 3.9.11"
@@ -21,98 +10,28 @@ dependencies {
2110 compileOnly(" org.apache.maven:maven-core:$mvnVersion " )
2211 compileOnly(" org.apache.maven:maven-plugin-api:$mvnVersion " )
2312 compileOnly(" org.apache.maven.plugin-tools:maven-plugin-annotations:3.15.2" )
24-
25- nmcpAggregation(project(path))
2613}
2714
28- mavenPlugin {
29- name = " Gradle Module Metadata Maven Plugin"
30- description = " A Maven plugin to publish Gradle Module Metadata"
31- helpMojoPackage = " org.gradlex.maven.gmm"
32- }
33-
34- java {
35- toolchain.languageVersion = JavaLanguageVersion .of(17 )
36- withSourcesJar()
37- withJavadocJar()
38- }
39-
40- tasks.compileJava {
41- options.release = 8
42- options.compilerArgs.add(" -Werror" )
15+ configurations.api {
16+ withDependencies { clear() } // remove gradleApi() dependency
4317}
4418
4519tasks.javadoc {
4620 options {
4721 this as StandardJavadocDocletOptions
48- addStringOption(" Xdoclint:all,-missing" , " -Xwerror" )
49- tags(
50- " goal:a:Goal:" ,
51- " requiresProject:a:Requires Project:" ,
52- " threadSafe:a:Thread Safe:"
53- )
54- }
55- }
56-
57- @Suppress(" UnstableApiUsage" )
58- testing.suites.named<JvmTestSuite >(" test" ) {
59- useJUnitJupiter()
60- dependencies {
61- implementation(gradleTestKit())
62- implementation(" org.assertj:assertj-core:3.27.6" )
63- }
64- }
65-
66- publishing {
67- publications.register<MavenPublication >(" mavenPlugin" ) {
68- from(components[" java" ])
69- pom {
70- name = mavenPlugin.name
71- description = mavenPlugin.description
72- url = " https://github.com/gradlex-org/gradle-module-metadata-maven-plugin"
73- licenses {
74- license {
75- name = " Apache License, Version 2.0"
76- url = " http://www.apache.org/licenses/LICENSE-2.0.txt"
77- }
78- }
79- scm {
80- connection = " scm:git:git://github.com/gradlex-org/gradle-module-metadata-maven-plugin.git"
81- developerConnection = " scm:git:git://github.com/gradlex-org/gradle-module-metadata-maven-plugin.git"
82- url = " https://github.com/gradlex-org/gradle-module-metadata-maven-plugin"
83- }
84- developers {
85- developer {
86- name = " Jendrik Johannes"
87- 88- }
89- }
90- }
22+ tags(" goal:a:Goal:" , " requiresProject:a:Requires Project:" , " threadSafe:a:Thread Safe:" )
9123 }
9224}
9325
94- signing {
95- if (providers.gradleProperty(" sign" ).getOrElse(" false" ).toBoolean()) {
96- useInMemoryPgpKeys(
97- providers.environmentVariable(" SIGNING_KEY" ).getOrNull(),
98- providers.environmentVariable(" SIGNING_PASSPHRASE" ).getOrNull()
99- )
100- sign(publishing.publications[" mavenPlugin" ])
101- }
26+ mavenPlugin {
27+ name = " Gradle Module Metadata Maven Plugin"
28+ description = " A Maven plugin to publish Gradle Module Metadata"
29+ helpMojoPackage = " org.gradlex.maven.gmm"
10230}
10331
104- nmcpAggregation {
105- centralPortal {
106- username = providers.environmentVariable(" MAVEN_CENTRAL_USERNAME" )
107- password = providers.environmentVariable(" MAVEN_CENTRAL_PASSWORD" )
108- publishingType = " AUTOMATIC" // "USER_MANAGED"
32+ publishingConventions {
33+ mavenCentral {
34+ displayName = mavenPlugin.name
35+ description = mavenPlugin.description
10936 }
11037}
111-
112- checkstyle {
113- configDirectory = layout.projectDirectory.dir(" gradle/checkstyle" )
114- }
115-
116- tasks.checkstyleMain {
117- exclude(" **/HelpMojo.java" )
118- }
0 commit comments