### get(path: String) Source: https://gradleup.com/nmcp/kdoc/nmcp-tasks/nmcp.transport/-transport/index.html Retrieves data from the specified path as a BufferedSource. ```APIDOC ## fun get(path: String): BufferedSource? ### Description Retrieves content from the provided path. Returns a BufferedSource if the content exists, otherwise returns null. ### Parameters - **path** (String) - The path to the resource to retrieve. ``` -------------------------------- ### Configure aggregation using allprojects Source: https://gradleup.com/nmcp/manual-configuration Use allprojects to include all modules; projects without the NMCP plugin applied are automatically ignored. ```kotlin dependencies { /** * * Using `allprojects {}` is also possible. * * Projets that do not apply `com.gradleup.nmcp` are ignored. * * Note: if you are using isolated projects, this potentially "over" configures * your build by configuring projects that are not important for publishing. */ allprojects { nmcpAggregation(project(path)) } } ``` -------------------------------- ### Publish Aggregation to Central Portal Source: https://gradleup.com/nmcp Execute this command to upload the deployment to the Central Portal. ```bash ./gradlew publishAggregationToCentralPortal # Your deployment is uploaded # go to https://central.sonatype.com/ to release it if you used USER_MANAGED ``` -------------------------------- ### Apply com.gradleup.nmcp plugin Source: https://gradleup.com/nmcp/manual-configuration Apply this plugin to all projects that require publishing. The version is defined in the root project. ```kotlin plugins { // Note you don't need to set a plugin version here. // The root project defines the version. id("com.gradleup.nmcp") } ``` -------------------------------- ### Configure com.gradleup.nmcp.aggregation plugin Source: https://gradleup.com/nmcp/manual-configuration Apply the aggregation plugin in the root project and configure Central Portal credentials and publishing settings. ```kotlin plugins { id("com.gradleup.nmcp.aggregation").version("1.6.1") } nmcpAggregation { centralPortal { username = TODO("Create a token username at https://central.sonatype.com/") password = TODO("Create a token password at https://central.sonatype.com/") // optional: publish manually from the portal publishingType = "USER_MANAGED" // optional: configure the name of your publication in the portal UI publicationName = "my-publication:$version" // optional: increase the validation timeout to 30 minutes validationTimeout = java.time.Duration.of(30, ChronoUnit.MINUTES) // optional: disable waiting for publishing publishingTimeout = java.time.Duration.ZERO // optional: send publications serially instead of in parallel (might be slower) uploadSnapshotsParallelism.set(1) } } ``` -------------------------------- ### Publish file by file to local repository Source: https://gradleup.com/nmcp/kdoc/nmcp-tasks/nmcp.transport/publish-file-by-file.html Publishes files from a source directory to a destination directory in a local repository, automatically generating maven-metadata.xml. ```kotlin fun publishFileByFile(from: File, into: File) ``` -------------------------------- ### NmcpExtension.extraFiles() Source: https://gradleup.com/nmcp/programmatic-api Allows adding files to a deployment at execution time, useful when publication coordinates are not known until runtime. ```APIDOC ## NmcpExtension.extraFiles() ### Description Adds files to the deployment process. This method is intended for use when publication coordinates are determined during task execution. ### Usage ```kotlin val nmcpExtension = extensions.findByType(NmcpExtension::class.java) nmcpExtension!!.extraFiles(someTask.map { it.output }) ``` ``` -------------------------------- ### publishFileByFile(from: File, into: File) Source: https://gradleup.com/nmcp/kdoc/nmcp-tasks/nmcp.transport/publish-file-by-file.html Publishes files from a source directory to a destination directory in a local repository, automatically generating maven-metadata.xml files. ```APIDOC ## publishFileByFile(from: File, into: File) ### Description Publishes files to a local repository. This function computes the group and version maven-metadata.xml files for the published artifacts. ### Parameters - **from** (File) - Required - A directory containing the files to publish as a m2 layout without maven-metadata.xml. - **into** (File) - Required - The destination directory. ``` -------------------------------- ### Add extra files to deployment with NmcpExtension Source: https://gradleup.com/nmcp/programmatic-api Use this to add files to a deployment when publication coordinates are only known at execution time. ```kotlin val someTask = TODO() // A task that generates a publication at execution time val nmcpExtension = extensions.findByType(NmcpExtension::class.java) nmcpExtension!!.extraFiles(someTask.map { it.output }) ``` -------------------------------- ### Publish to Maven Local Source: https://gradleup.com/nmcp/debugging Copies publication files to the local ~/.m2 repository for local testing and verification. ```bash ./gradlew nmcpPublishAggregationToMavenLocal # the files are copied to ~/.m2 ``` -------------------------------- ### Configure Nmcp Settings Plugin Source: https://gradleup.com/nmcp Add the plugin to settings.gradle.kts and configure the centralPortal extension with credentials and optional settings. ```kotlin plugins { id("com.gradleup.nmcp.settings").version("1.6.1") } nmcpSettings { centralPortal { username = TODO("Create a token username at https://central.sonatype.com/") password = TODO("Create a token password at https://central.sonatype.com/") // optional: publish manually from the portal publishingType = "USER_MANAGED" // optional: configure the name of your publication in the portal UI publicationName = "my-publication:$version" // optional: increase the validation timeout to 30 minutes validationTimeout = java.time.Duration.of(30, ChronoUnit.MINUTES) // optional: disable waiting for publishing publishingTimeout = java.time.Duration.ZERO // optional: send publications serially instead of in parallel (might be slower) uploadSnapshotsParallelism.set(1) // optional: publish all checksums (md5, sha1, sha256, sha512, including for signature files) publishAllChecksums.set(true) } } ``` -------------------------------- ### Publish file by file signatures Source: https://gradleup.com/nmcp/kdoc/nmcp-tasks/nmcp.transport/publish-file-by-file.html Function signatures for publishing files using a transport and input files, with an optional parallelism parameter. ```kotlin fun publishFileByFile(transport: Transport, inputFiles: GInputFiles) fun publishFileByFile(transport: Transport, inputFiles: GInputFiles, parallelism: Int) ``` -------------------------------- ### Publish Aggregation to Snapshots Source: https://gradleup.com/nmcp Execute this command to upload snapshots to the Maven snapshots repository. ```bash ./gradlew publishAggregationToCentralSnapshots # Your snapshots are uploaded to "https://central.sonatype.com/repository/maven-snapshots/" ``` -------------------------------- ### Retrieve deployment files with NmcpAggregationExtension Source: https://gradleup.com/nmcp/programmatic-api Access deployment files at execution time to facilitate uploads to custom repositories like Google Cloud or AWS. ```kotlin val nmcpAggregationExtension = extensions.findByType(NmcpAggregationExtension::class.java) tasks.register("uploadFilesToGoogleCloud", UploadToGoogleCloud::class.java) { inputFiles.from(nmcpAggregationExtension.allFiles) } ``` -------------------------------- ### localRepository(Action) Source: https://gradleup.com/nmcp/kdoc/nmcp/nmcp/-nmcp-aggregation-extension/local-repository.html Registers an extra task to publish the aggregation to a local repository using the provided configuration action. ```APIDOC ## localRepository ### Description Registers an extra task to publish the aggregation to a local repository. ### Signature `abstract fun localRepository(action: Action)` ### Parameters - **action** (Action) - Required - An action to configure the local repository options. ``` -------------------------------- ### Configure Central Snapshots Repository Source: https://gradleup.com/nmcp/development Add the Sonatype snapshot repository to your project's build configuration. ```gradle repositories { maven("https://central.sonatype.com/repository/maven-snapshots/") } ``` -------------------------------- ### NmcpAggregationExtension.allFiles Source: https://gradleup.com/nmcp/programmatic-api Provides access to deployment files at execution time for custom repository uploads. ```APIDOC ## NmcpAggregationExtension.allFiles ### Description Retrieves the collection of deployment files at execution time. This is useful for tasks that need to upload these files to custom repositories like Google Cloud or AWS. ### Usage ```kotlin val nmcpAggregationExtension = extensions.findByType(NmcpAggregationExtension::class.java) tasks.register("uploadFilesToGoogleCloud", UploadToGoogleCloud::class.java) { inputFiles.from(nmcpAggregationExtension.allFiles) } ``` ``` -------------------------------- ### abstract fun extraFiles(files: Any) Source: https://gradleup.com/nmcp/kdoc/nmcp/nmcp/-nmcp-extension/extra-files.html Adds files to the nmcpProducer outgoing variant. This is useful for adding publications whose files are not known until execution time. ```APIDOC ## abstract fun extraFiles(files: Any) ### Description Adds files to the `nmcpProducer` outgoing variant. By default, the Nmcp plugin adds all the publications to the `nmcpProducer` outgoing variant. This method allows adding more files that are not coming from the traditional `maven-publish` plugin, particularly useful for files not known until execution time. ### Parameters - **files** (Any) - Required - The files to be added. The given paths are evaluated as per `org.gradle.api.Project.files`. Typically, this is built from a `org.gradle.api.file.FileTree` or a `org.gradle.api.file.DirectoryProperty` to preserve relative paths. ``` -------------------------------- ### centralPortal(action: Action) Source: https://gradleup.com/nmcp/kdoc/nmcp/nmcp/-nmcp-aggregation-extension/central-portal.html Configures publishing to central portal releases (Maven Central) and central portal snapshots. ```APIDOC ## centralPortal ### Description Configures publishing to central portal releases (Maven Central) and central portal snapshots. ### Signature `abstract fun centralPortal(action: Action)` ### Parameters - **action** (Action) - Required - An action to configure the CentralPortalOptions. ``` -------------------------------- ### Configure GradleUp Snapshots Repository Source: https://gradleup.com/nmcp/development Add the GradleUp snapshot repository to your project's build configuration. ```gradle repositories { maven("http://storage.googleapis.com/gradleup/m2/") } ``` -------------------------------- ### allFiles Source: https://gradleup.com/nmcp/kdoc/nmcp/nmcp/-nmcp-aggregation-extension/all-files.html Access the FileCollection containing all files from the nmcpAggregation configuration. ```APIDOC ## Property: allFiles ### Description Returns a `FileCollection` containing all files present in the `nmcpAggregation` configuration. This is a multi-rooted `org.gradle.api.file.FileTree` that can be used for manual publishing to repositories such as Google Cloud Storage or AWS S3. ### Signature `abstract val allFiles: FileCollection` ``` -------------------------------- ### Inspect deployment ZIP content Source: https://gradleup.com/nmcp/debugging Generates the ZIP file intended for Maven Central to allow manual inspection of the deployment package. ```bash ./gradlew nmcpZipAggregation # the zip file is in build/nmcp/zip/aggregation.zip ``` -------------------------------- ### publishAllProjectsProbablyBreakingProjectIsolation() Source: https://gradleup.com/nmcp/kdoc/nmcp/nmcp/-nmcp-aggregation-extension/publish-all-projects-probably-breaking-project-isolation.html A deprecated function that applies the com.gradleup.nmcp plugin to every project that also applies maven-publish. It is discouraged for use in projects requiring project isolation. ```APIDOC ## publishAllProjectsProbablyBreakingProjectIsolation() ### Description Applies the `com.gradleup.nmcp` plugin to every project that also applies `maven-publish`. This function is deprecated because it breaks project isolation. ### Signature `abstract fun publishAllProjectsProbablyBreakingProjectIsolation()` ### Usage Note This API is not compatible with Gradle project isolation. Users are encouraged to use the `com.gradleup.nmcp.settings` plugin or a convention plugin instead of this method. ``` -------------------------------- ### abstract val baseUrl: Property Source: https://gradleup.com/nmcp/kdoc/nmcp/nmcp/-central-portal-options/base-url.html Configures the API endpoint URL for the Central Portal. This property is optional and defaults to 'https://central.sonatype.com/'. ```APIDOC ## Property: baseUrl ### Description The API endpoint to use for the Central Portal. This is an optional configuration property. ### Type `Property` ### Default Value `"https://central.sonatype.com/"` ``` -------------------------------- ### Add dependencies for aggregation Source: https://gradleup.com/nmcp/manual-configuration Specify the projects to be included in the aggregation for publishing. ```kotlin dependencies { // Add all dependencies here nmcpAggregation(project(":module1")) nmcpAggregation(project(":module2")) nmcpAggregation(project(":module3")) } ``` -------------------------------- ### extraFiles(files: Any) Source: https://gradleup.com/nmcp/kdoc/nmcp/nmcp/-nmcp-extension/index.html Adds additional files to the nmcpProducer outgoing variant. This is useful for including files not managed by the standard maven-publish plugin. ```APIDOC ## extraFiles(files: Any) ### Description Adds files to the `nmcpProducer` outgoing variant. By default, the Nmcp plugin adds all publications to this variant; this method allows for the inclusion of additional files. ### Parameters - **files** (Any) - Required - The files to be added to the producer variant. ``` -------------------------------- ### put(path: String, body: Content) Source: https://gradleup.com/nmcp/kdoc/nmcp-tasks/nmcp.transport/-transport/index.html Uploads or stores content at the specified path. ```APIDOC ## fun put(path: String, body: Content) ### Description Stores the provided content body at the specified path. ### Parameters - **path** (String) - The destination path. - **body** (Content) - The content to be stored. ``` -------------------------------- ### publishAllPublicationsToCentralPortal(action: Action) Source: https://gradleup.com/nmcp/kdoc/nmcp/nmcp/-nmcp-extension/publish-all-publications-to-central-portal.html Configures publishing all publications at once to the Central Portal. This method adds the nmcpPublishAllPublicationsToCentralPortal and nmcpPublishAllPublicationsToCentralPortalSnapshots tasks. ```APIDOC ## publishAllPublicationsToCentralPortal ### Description Configures publishing all publications at once in a single deployment to the Central Portal. This method is deprecated; users should apply `com.gradleup.nmcp.aggregation` or the settings plugin instead. ### Signature `abstract fun publishAllPublicationsToCentralPortal(action: Action)` ### Effects - Adds `nmcpPublishAllPublicationsToCentralPortal` task - Adds `nmcpPublishAllPublicationsToCentralPortalSnapshots` task ``` -------------------------------- ### Convert Content to RequestBody Source: https://gradleup.com/nmcp/kdoc/nmcp-tasks/nmcp.transport/-content/index.html Converts the current Content instance into a RequestBody. ```kotlin fun Content.toRequestBody(): RequestBody ``` -------------------------------- ### NmcpAggregationExtension Configuration Source: https://gradleup.com/nmcp/kdoc/nmcp/nmcp/-nmcp-aggregation-extension/index.html Properties and functions available for configuring the NMCP aggregation extension. ```APIDOC ## Properties - **allFiles** (FileCollection) - Contains all files present in the "nmcpAggregation" configuration. - **allowDuplicateProjectNames** (Property) - Configures whether to allow duplicate project names. Defaults to false. - **allowEmptyAggregation** (Property) - Configures whether to allow empty aggregations. Defaults to false. - **publishAllChecksums** (Property) - Configures whether to publish all checksum files. Defaults to false. ## Functions ### centralPortal(action: Action) Configures publishing to central portal releases (Maven Central) and central portal snapshots. ### localRepository(action: Action) Registers an extra task to publish the aggregation to a local repository. ### publishAllProjectsProbablyBreakingProjectIsolation() Applies the `com.gradleup.nmcp` plugin to every project that also applies `maven-publish`. ``` -------------------------------- ### publishFileByFile Source: https://gradleup.com/nmcp/kdoc/nmcp-tasks/nmcp.transport/index.html Publishes files to a local repository or via a transport mechanism with optional parallelism. ```APIDOC ## fun publishFileByFile(from: File, into: File) ### Description Publishes files to a local repository. ### Parameters - **from** (File) - Source file - **into** (File) - Destination file ## fun publishFileByFile(transport: Transport, inputFiles: GInputFiles, parallelism: Int = 1) ### Description Publishes files using a specified transport mechanism, supporting optional parallelism. ### Parameters - **transport** (Transport) - The transport implementation - **inputFiles** (GInputFiles) - The files to be published - **parallelism** (Int) - Optional number of parallel operations ``` -------------------------------- ### Write Content to Sink Source: https://gradleup.com/nmcp/kdoc/nmcp-tasks/nmcp.transport/-content/index.html Writes the content to the provided BufferedSink. ```kotlin abstract fun writeTo(sink: BufferedSink) ``` -------------------------------- ### publishingTimeout Source: https://gradleup.com/nmcp/kdoc/nmcp/nmcp/-central-portal-options/publishing-timeout.html Configures the timeout duration for deployment publishing. Setting this to 0 disables the wait period. ```APIDOC ## publishingTimeout ### Description Specifies the duration to wait for the deployment to reach the `PUBLISHED` or `FAILED` status. If set to 0, the system will not wait for publishing to complete. ### Signature `abstract val publishingTimeout: Property` ### Default Value 0 ``` -------------------------------- ### Content.writeTo Source: https://gradleup.com/nmcp/kdoc/nmcp-tasks/nmcp.transport/-content/index.html Writes the content to the provided BufferedSink. ```APIDOC ### abstract fun Content.writeTo(sink: BufferedSink) #### Description Writes the content data to the specified BufferedSink. #### Parameters - **sink** (BufferedSink) - The destination sink to write the content to. ``` -------------------------------- ### publishAllPublicationsToCentralPortal(action: Action) Source: https://gradleup.com/nmcp/kdoc/nmcp/nmcp/-nmcp-extension/index.html Configures the publishing of all publications in a single deployment to the Central Portal. ```APIDOC ## publishAllPublicationsToCentralPortal(action: Action) ### Description Configures publishing all publications at once in a single deployment to the Central Portal. ### Parameters - **action** (Action) - Required - An action to configure the CentralPortalOptions. ``` -------------------------------- ### Configure Maven Repository for OSSRH Compatibility Source: https://gradleup.com/nmcp/portal-faq Update the repository URL in your build configuration to use the compatibility endpoint for the Central portal. ```groovy repositories { maven { name = 'ossrh-staging-api' url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" url = "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/" } } ``` ```groovy repositories { maven { name = 'ossrh-staging-api' url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" url = "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/" } } ``` -------------------------------- ### allowDuplicateProjectNames Source: https://gradleup.com/nmcp/kdoc/nmcp/nmcp/-nmcp-aggregation-extension/allow-duplicate-project-names.html A property of type Property that controls whether duplicate project names are permitted during aggregation. ```APIDOC ## allowDuplicateProjectNames ### Signature abstract val allowDuplicateProjectNames: Property ### Description By default, Nmcp errors if there are duplicate project names because it confuses the dependency resolution algorithm. If you have duplicate project names that do not contribute publishing, set this to true to allow them. ### Type Property ``` -------------------------------- ### Content.toRequestBody Source: https://gradleup.com/nmcp/kdoc/nmcp-tasks/nmcp.transport/index.html Converts a Content object into a RequestBody. ```APIDOC ## fun Content.toRequestBody(): RequestBody ### Description Converts the current Content instance into a RequestBody suitable for network transmission. ``` -------------------------------- ### allowEmptyAggregation Source: https://gradleup.com/nmcp/kdoc/nmcp/nmcp/-nmcp-aggregation-extension/allow-empty-aggregation.html A property that determines if empty aggregations are permitted during the NMCP process. ```APIDOC ## allowEmptyAggregation ### Description By default, NMCP throws an error if the aggregation is empty. This property can be set to true to allow empty aggregations. ### Signature `abstract val allowEmptyAggregation: Property` ``` -------------------------------- ### publishAllChecksums Source: https://gradleup.com/nmcp/kdoc/nmcp/nmcp/-nmcp-aggregation-extension/publish-all-checksums.html A Property that determines if checksum files should be published. When set to true, it overrides the default behavior of filtering out .sha256, .sha512, and associated signature checksum files. ```APIDOC ## Property: publishAllChecksums ### Description Controls whether checksum files are included in the publication. By default, this is set to `false` to filter out `.sha256`, `.sha512`, and signature checksum files to comply with Maven Central publishing limits. ### Signature `abstract val publishAllChecksums: Property` ### Default Value `false` ``` -------------------------------- ### publishingType Source: https://gradleup.com/nmcp/kdoc/nmcp/nmcp/-central-portal-options/publishing-type.html The publishingType property allows users to configure the publication behavior of their deployment. It accepts either 'AUTOMATIC' or 'USER_MANAGED' as values. ```APIDOC ## publishingType ### Description Defines the publication strategy for the deployment. ### Signature `abstract val publishingType: Property` ### Options - **AUTOMATIC**: The deployment is automatically published upon successful validation. - **USER_MANAGED**: The deployment is validated but remains unpublished, requiring manual intervention via the Central Portal UI. ### Default Value `AUTOMATIC` ``` -------------------------------- ### uploadSnapshotsParallelism Source: https://gradleup.com/nmcp/kdoc/nmcp/nmcp/-central-portal-options/upload-snapshots-parallelism.html The uploadSnapshotsParallelism property allows users to configure the number of parallel threads used when uploading publications to snapshots. Note that files within a single publication are still uploaded serially. ```APIDOC ## Property: uploadSnapshotsParallelism ### Description Defines the parallelism level for uploading publications to snapshots. Files within a single publication (group/artifact) are processed serially. ### Type `Property` ### Default Value 8 ``` -------------------------------- ### abstract val validationTimeout: Property Source: https://gradleup.com/nmcp/kdoc/nmcp/nmcp/-central-portal-options/validation-timeout.html Configures the timeout duration for deployment validation. If the timeout is reached, the process will stop waiting for the status to transition to VALIDATED or FAILED. ```APIDOC ## validationTimeout ### Description The `validationTimeout` property specifies the duration to wait for a deployment to reach the `VALIDATED` or `FAILED` status after being uploaded to the central portal. ### Signature `abstract val validationTimeout: Property` ### Details - **Default Value**: 10 minutes - **Special Value**: Setting this to `0` disables waiting for validation. ### Behavior - If `publishingType` is `AUTOMATIC`, the status transitions to `PUBLISHING` automatically after successful validation. - If `publishingType` is `USER_MANAGED`, the status remains `VALIDATED`, requiring manual intervention via the portal UI. ``` -------------------------------- ### publicationName Source: https://gradleup.com/nmcp/kdoc/nmcp/nmcp/-central-portal-options/publication-name.html The publicationName property is an abstract Property used to define a custom name for a publication. If not provided, the system generates a name based on the deployment contents, typically including the groupId and version. ```APIDOC ## Property: publicationName ### Description An optional name for the publication. By default, the system generates a name based on the deployment contents. If the deployment contains multiple publications, the generated name will reflect common parts such as the groupId and version. ### Signature `abstract val publicationName: Property` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.