Skip to content

Commit

Permalink
Revert README changes for new targets API. (#27)
Browse files Browse the repository at this point in the history
I have the changes locally and will update the README once 0.6.0 is released. Once this is done we can update the open PR and merge it.
  • Loading branch information
vanniktech committed Oct 1, 2018
1 parent d474b9e commit cb93c48
Showing 1 changed file with 6 additions and 31 deletions.
37 changes: 6 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,44 +31,19 @@ classpath 'com.vanniktech:gradle-maven-publish-plugin:0.7.0-SNAPSHOT'

## Configuration

Those are all the available configurations - shown with default values and their types. More information can be found in the [Documentation of the Extension](src/main/kotlin/com/vanniktech/maven/publish/MavenPublishPluginExtension.kt).
Those are all the available configurations - shown with default values and their types. More information can be found in the [Documentation of the Extension](src/test/kotlin/com/vanniktech/maven/publish/MavenPublishPluginExtensionTest.kt).

```groovy
mavenPublish {
targets {
uploadArchives {
releaseRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
snapshotRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
repositoryUsername = null // This defaults to either the SONATYPE_NEXUS_USERNAME Gradle property or the system environment variable.
repositoryPassword = null // This defaults to either the SONATYPE_NEXUS_PASSWORD Gradle property or the system environment variable.
}
}
releaseRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
snapshotRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
repositoryUsername = null // This defaults to either the SONATYPE_NEXUS_USERNAME Gradle property or the system environment variable.
repositoryPassword = null // This defaults to either the SONATYPE_NEXUS_PASSWORD Gradle property or the system environment variable.
}
```

Once you've configured this and defined the typical pom attributes via Gradle properties you can upload your library using the `uploadArchives` task.

If you need to upload to multiple repositories you can also add additional targets.

```groovy
mavenPublish {
targets {
uploadArchives {
// Configure as above.
}
internalRepo {
// Configure as above.
}
betaRepo {
// Configure as above.
}
}
}
This will create `uploadArchivesInternalRepo` and `uploadArchivesBetaRepo` tasks.
# Sample

This Gradle plugin is using itself to publish any of the updates. It applies a previously released version in the build.gradle just as mentioned above and sets the Gradle properties in this [gradle.properties](gradle.properties).
Expand All @@ -77,4 +52,4 @@ This Gradle plugin is using itself to publish any of the updates. It applies a p

Copyright (C) 2018 Vanniktech - Niklas Baudy

Licensed under the Apache License, Version 2.0
Licensed under the Apache License, Version 2.0

0 comments on commit cb93c48

Please sign in to comment.