|
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" } |
4 | 2 |
|
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" |
14 | 3 | version = "1.2" |
15 | 4 |
|
16 | 5 | val mvnVersion = "3.9.11" |
17 | 6 |
|
18 | 7 | dependencies { |
19 | | - implementation("com.google.code.gson:gson:2.13.2") |
| 8 | + implementation("com.google.code.gson:gson:2.13.1") |
20 | 9 |
|
21 | 10 | compileOnly("org.apache.maven:maven-core:$mvnVersion") |
22 | 11 | compileOnly("org.apache.maven:maven-plugin-api:$mvnVersion") |
23 | 12 | compileOnly("org.apache.maven.plugin-tools:maven-plugin-annotations:3.15.1") |
24 | | - |
25 | | - nmcpAggregation(project(path)) |
26 | 13 | } |
27 | 14 |
|
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 |
43 | 17 | } |
44 | 18 |
|
45 | 19 | tasks.javadoc { |
46 | 20 | options { |
47 | 21 | 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:") |
91 | 23 | } |
92 | 24 | } |
93 | 25 |
|
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" |
102 | 30 | } |
103 | 31 |
|
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 |
109 | 36 | } |
110 | 37 | } |
111 | | - |
112 | | -checkstyle { |
113 | | - configDirectory = layout.projectDirectory.dir("gradle/checkstyle") |
114 | | -} |
115 | | - |
116 | | -tasks.checkstyleMain { |
117 | | - exclude("**/HelpMojo.java") |
118 | | -} |
0 commit comments