Skip to content

Commit d04baab

Browse files
committed
improve docs
1 parent 2ac8909 commit d04baab

5 files changed

Lines changed: 27 additions & 29 deletions

File tree

docs/src/content/docs/index.mdx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Nmcp (New Maven Central Publishing) is a plugin that uses the new [Central Porta
88

99
Nmcp is compatible with modern Gradle development practices:
1010
* Compatible with [Configuration Cache](https://docs.gradle.org/current/userguide/configuration_cache_enabling.html).
11-
* Compatible with [Isolated project](https://docs.gradle.org/current/userguide/isolated_projects.html).
11+
* Compatible with [Isolated projects](https://docs.gradle.org/current/userguide/isolated_projects.html).
1212
* Compatible with [multi-project builds](https://docs.gradle.org/current/userguide/multi_project_builds.html).
1313
* Uses [classloader isolation](https://mbonnin.net/2025-08-24_isolation_101/) to prevent conflicts with other plugins.
1414
* Uses [Gradle 8.8 lifecycle callbacks ](https://docs.gradle.org/8.8/release-notes.html) for easy configuration.
@@ -21,9 +21,7 @@ For a higher level API use [vanniktech/gradle-maven-publish-plugin](https://gith
2121

2222
### Requirements
2323

24-
Nmcp requires Java 17+, Gradle 8.8+ for the settings plugin and Gradle 8.2+ otherwise.
25-
26-
24+
Nmcp requires Java 17+, Gradle 8.2+ and Gradle 8.8+ for the settings plugin.
2725

2826
### Configuring the settings plugin
2927

@@ -64,15 +62,15 @@ Call `publishAggregationToCentralPortal` to publish the aggregation:
6462

6563
```bash
6664
./gradlew publishAggregationToCentralPortal
67-
# yay everything is uploaded 🎉
68-
# go to https://central.sonatype.com/ to release if you used USER_MANAGED
65+
# Your deployment is uploaded
66+
# go to https://central.sonatype.com/ to release it if you used USER_MANAGED
6967
```
7068

71-
Call `publishAggregationToCentralPortalSnapshots` to publish to the snapshots:
69+
Call `publishAggregationToCentralSnapshots` to publish to the snapshots:
7270

7371
```bash
74-
./gradlew publishAggregationToCentralPortalSnapshots
75-
# yay everything is uploaded to "https://central.sonatype.com/repository/maven-snapshots/" 🎉
72+
./gradlew publishAggregationToCentralSnapshots
73+
# Your snapshots are uploaded to "https://central.sonatype.com/repository/maven-snapshots/"
7674
```
7775

7876
Under the hood, the `com.gradle.nmcp.settings` plugin applies the `com.gradleup.nmcp` plugin to all your projects and `com.gradleup.nmcp.aggregation` to your root project.

docs/src/content/docs/manual-configuration.mdx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Manual configuration
44

55
import { Aside } from '@astrojs/starlight/components';
66

7-
For simple projects, the [settings plugin](/nmcp) is recommended.
7+
For simple projects, the [settings plugin](/nmcp#configuring-the-settings-plugin) is recommended.
88

99
For more control, you can configure the `com.gradleup.nmcp.aggregation` and `com.gradleup.nmcp` plugins manually as described in this page.
1010

@@ -60,7 +60,7 @@ nmcpAggregation {
6060

6161
```
6262

63-
_Note that you may also apply both `com.gradleup.nmcp.aggregation` and `com.gradleup.nmcp` in the same project._
63+
_Note that you may apply both `com.gradleup.nmcp.aggregation` and `com.gradleup.nmcp` in the same project._
6464

6565
For the aggregation to find the outgoing variant, you need to add the `nmcpAggregation` dependency for each project that you want to publish:
6666

@@ -74,18 +74,17 @@ dependencies {
7474
}
7575
```
7676

77-
`com.gradleup.nmcp.aggregation` uses a lenient configuration to collect all the project. You may declare a dependency on all projects and the ones that do not apply `com.gradleup.nmcp` _should_ be ignored:
77+
`com.gradleup.nmcp.aggregation` uses a lenient configuration to collect files. You may add all projects and projects that do not apply `com.gradleup.nmcp` are ignored:
7878

7979
```kotlin
8080
// build.gradle.kts
8181
dependencies {
8282
/**
83-
* You may also do this
83+
* Add all projects to the `nmcpAggregation` dependency. Projets that do not
84+
* apply `com.gradleup.nmcp` are ignored.
8485
*
85-
* This is a bit more dangerous as it relies on the fact that
86-
* the resolution is lenient.
87-
* If you find unexpected content in your publications or bump
88-
* into resolution errors, list all projects explicitly.
86+
* Note: if you are using isolated projects, this potentially "over" configures
87+
* your build by configuring projects that are not important for publishing.
8988
*/
9089
allprojects {
9190
nmcpAggregation(project(path))
@@ -101,9 +100,9 @@ Call `publishAggregationToCentralPortal` to publish the aggregation:
101100
# go to https://central.sonatype.com/ to release if you used USER_MANAGED
102101
```
103102

104-
Call `publishAggregationToCentralPortalSnapshots` to publish to the snapshots:
103+
Call `publishAggregationToCentralSnapshots` to publish to the snapshots:
105104

106105
```bash
107-
./gradlew publishAggregationToCentralPortalSnapshots
108-
# yay everything is uploaded to "https://central.sonatype.com/repository/maven-snapshots/" 🎉
106+
./gradlew publishAggregationToCentralSnapshots
107+
# Your snapshots are uploaded to "https://central.sonatype.com/repository/maven-snapshots/"
109108
```

nmcp/src/main/kotlin/nmcp/NmcpAggregationExtension.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ import org.gradle.api.file.FileCollection
66
interface NmcpAggregationExtension {
77
/**
88
* Configures publishing to central portal releases (Maven Central) and central portal snapshots.
9-
*
10-
* Adds the following tasks:
11-
* - nmcpPublishAggregationToCentralPortal
12-
* - nmcpPublishAggregationToCentralPortalSnapshots
139
*/
1410
fun centralPortal(action: Action<CentralPortalOptions>)
1511

nmcp/src/main/kotlin/nmcp/NmcpSettings.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ import org.gradle.api.file.FileCollection
66
interface NmcpSettings {
77
/**
88
* Configures publishing to central portal releases (Maven Central) and central portal snapshots.
9-
*
10-
* Adds the following tasks:
11-
* - nmcpPublishAggregationToCentralPortal
12-
* - nmcpPublishAggregationToCentralPortalSnapshots
139
*/
1410
fun centralPortal(action: Action<CentralPortalOptions>)
1511
}

nmcp/src/main/kotlin/nmcp/internal/utils.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ internal fun Project.registerPublishToCentralPortalTasks(
6969
else -> null
7070
}
7171
val centralPortalLifecycleTaskName = "publish${name.capitalizeFirstLetter()}ToCentralPortal"
72-
val snapshotsLifecycleTaskName = "publish${name.capitalizeFirstLetter()}ToCentralPortalSnapshots"
72+
val deprecatedLifecycleTaskName = "publish${name.capitalizeFirstLetter()}ToCentralPortalSnapshots"
73+
val snapshotsLifecycleTaskName = "publish${name.capitalizeFirstLetter()}ToCentralSnapshots"
7374

7475
val zipName = "${name}.zip"
7576
val zipTaskProvider = tasks.register(zipTaskName, Zip::class.java) {
@@ -119,6 +120,14 @@ internal fun Project.registerPublishToCentralPortalTasks(
119120
it.description = "$description to the Central Snapshots repository."
120121
it.dependsOn(centralSnapshots)
121122
}
123+
project.tasks.register(deprecatedLifecycleTaskName) {
124+
it.group = PUBLISH_TASK_GROUP
125+
it.description = "$description to the Central Snapshots repository."
126+
it.dependsOn(snapshotsLifecycleTaskName)
127+
it.doLast {
128+
println("'$deprecatedLifecycleTaskName' is deprecated and will be removed in a future release. Use '$snapshotsLifecycleTaskName' instead.")
129+
}
130+
}
122131

123132
val m2File = File(System.getProperty("user.home")).resolve(".m2/repository")
124133
registerNmcpPublishFileByFileToFileSystemTask(

0 commit comments

Comments
 (0)