Skip to content

Commit

Permalink
Upgrade nexus plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklakariada committed Jan 27, 2024
1 parent 37971cc commit bf11b74
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 12 deletions.
33 changes: 25 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@ Also see [`DemoModelMatcher`](src/test/java/com/github/hamstercommunity/matcher/
## Development

```bash
$ git clone https://github.com/itsallcode/hamcrest-auto-matcher.git
$ ./gradlew check
git clone https://github.com/itsallcode/hamcrest-auto-matcher.git
cd hamcrest-auto-matcher
./gradlew check
# Test report: build/reports/tests/index.html
```

Expand All @@ -174,6 +175,16 @@ Import into eclipse using [buildship](https://projects.eclipse.org/projects/tool
./gradlew dependencyUpdates
```


### Test Coverage

To calculate and view test coverage:

```sh
./gradlew check jacocoTestReport
open build/reports/jacoco/test/html/index.html
```

### Publish to Maven Central

1. Add the following to your `~/.gradle/gradle.properties`:
Expand All @@ -187,12 +198,18 @@ Import into eclipse using [buildship](https://projects.eclipse.org/projects/tool
signing.secretKeyRingFile=<path to secret keyring file>
```

2. Increment version number in `build.gradle`, update version in README.md, commit and push.
3. Run the following command:
2. Increment version number in `build.gradle` and `README.md`, commit and push.
3. Optional: run the following command to do a dry-run:

```sh
./gradlew clean check build publishToSonatype closeSonatypeStagingRepository --info
```

4. Run the following command to publish to Maven Central:

```bash
$ ./gradlew clean check build publish closeAndReleaseRepository --info
```sh
./gradlew clean check build publishToSonatype closeAndReleaseSonatypeStagingRepository --info
```

4. Create a new [release](https://github.com/itsallcode/hamcrest-auto-matcher/releases) on GitHub.
5. After some time the release will be available at [Maven Central](https://repo1.maven.org/maven2/org/itsallcode/hamcrest-auto-matcher/).
5. Create a new [release](https://github.com/itsallcode/hamcrest-auto-matcher/releases) on GitHub.
6. After some time the release will be available at [Maven Central](https://repo1.maven.org/maven2/org/itsallcode/hamcrest-auto-matcher/).
14 changes: 10 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
id "maven-publish"
id "jacoco"
id "org.sonarqube" version "4.4.1.3373"
id "io.codearte.nexus-staging" version "0.30.0"
id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
id "com.github.ben-manes.versions" version "0.51.0"
}

Expand Down Expand Up @@ -124,10 +124,16 @@ signing {
sign publishing.publications.mavenJava
}

nexusStaging {

nexusPublishing {
packageGroup = project.group
username = getOptionalProperty("ossrhUsername")
password = getOptionalProperty("ossrhPassword")
repositories {
sonatype {
stagingProfileId = "546ea6ce74787e"
username = getOptionalProperty("ossrhUsername")
password = getOptionalProperty("ossrhPassword")
}
}
}

def isNonStable = { String version ->
Expand Down

0 comments on commit bf11b74

Please sign in to comment.