Skip to content

Commit 2f99422

Browse files
dariuszkucsmyrick
authored andcommitted
[build] configure nexus-staging plugin (#558)
`maven-publish` plugin only uploads to nexus staging but does not release the artifacts which means ithe release process requires an extra manual step (i.e. log into nexus web ui and release). `nexus-staging` plugin automates this proces by allowing you to automatically release published artifacts to nexus (i.e. similar to what maven `nexus-staging-maven-plugin`). Updated build process so the `publish` task is finalized by `closeAndReleaseRepository` task.
1 parent 804da12 commit 2f99422

File tree

8 files changed

+44
-16
lines changed

8 files changed

+44
-16
lines changed

CONTRIBUTING.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ where "my-new-feature" describes what you're working on.
1919
You can use Gradle to build all the modules from the root directory
2020

2121
```shell script
22-
gradle clean build
22+
./gradlew clean build
2323
```
2424

25-
Or you can navigate to each module to build them individually
25+
Or you can navigate to each module to build them individually.
26+
27+
> NOTE: in order to ensure you use the right version of Gradle we highly recommend to use the provided wrapper scripts
2628
2729
## Add tests for any bug fixes or new functionality
2830

@@ -33,7 +35,7 @@ We are using [mockk](http://mockk.io), [JUnit](https://junit.org/junit5/), and [
3335
To run tests use Maven
3436

3537
```shell script
36-
gradle check
38+
./gradlew check
3739
```
3840

3941
You can also view the code coverage reports published to Codecov. This validates that our coverage levels are maintained. Links are in the README.
@@ -45,10 +47,10 @@ We are also [ktlint](https://ktlint.github.io/) and [detekt](https://arturbosch.
4547
These will be run as part of the `validate` phase of a full build but if you want to run them manually you will have to navigate to each module directory and run the command
4648

4749
```shell script
48-
gradle ktlintCheck
50+
./gradlew ktlintCheck
4951
```
5052
```shell script
51-
gradle detekt
53+
./gradlew detekt
5254
```
5355

5456
## Add documentation for new or updated functionality

build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ plugins {
1616
jacoco
1717
signing
1818
`maven-publish`
19+
id("io.codearte.nexus-staging")
1920
}
2021

2122
allprojects {
@@ -180,4 +181,7 @@ tasks {
180181
jar {
181182
enabled = false
182183
}
184+
val closeAndReleaseRepository by getting
185+
val publish by getting
186+
publish.finalizedBy(closeAndReleaseRepository)
183187
}

examples/federation/base-app/README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,22 @@
33
One way to run a GraphQL server is with [Spring Boot](https://github.com/spring-projects/spring-boot). This example app uses [Spring Webflux](https://docs.spring.io/spring/docs/current/spring-framework-reference/web-reactive.html) together with `graphql-kotlin` and [graphql-playground](https://github.com/prisma/graphql-playground).
44

55
### Running locally
6-
Build the application
6+
Build the application by running the following from examples root directory:
77

88
```bash
9-
gradle build
9+
# build all examples
10+
./gradlew build
11+
12+
# only build federation extended app project
13+
./gradlew :federation-example:base-app
1014
```
1115

16+
> NOTE: in order to ensure you use the right version of Gradle we highly recommend to use the provided wrapper scripts
17+
1218
Start the server:
1319

1420
* Run `Application.kt` directly from your IDE
15-
* Alternatively you can also use the spring boot maven plugin by running `gradle bootRun` from the command line.
21+
* Alternatively you can also use the spring boot maven plugin by running `./gradlew ::federation-example:base-app:bootRun` from the command line in the root examples directory.
1622

1723

1824
Once the app has started you can explore the example schema by opening Playground endpoint at http://localhost:8080/playground.

examples/federation/extend-app/README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,22 @@
33
One way to run a GraphQL server is with [Spring Boot](https://github.com/spring-projects/spring-boot). This example app uses [Spring Webflux](https://docs.spring.io/spring/docs/current/spring-framework-reference/web-reactive.html) together with `graphql-kotlin` and [graphql-playground](https://github.com/prisma/graphql-playground).
44

55
### Running locally
6-
Build the application
6+
Build the application by running the following from examples root directory:
77

88
```bash
9-
gradle build
9+
# build all examples
10+
./gradlew build
11+
12+
# only build federation extended app project
13+
./gradlew :federation-example:extend-app
1014
```
1115

16+
> NOTE: in order to ensure you use the right version of Gradle we highly recommend to use the provided wrapper scripts
17+
1218
Start the server:
1319

1420
* Run `Application.kt` directly from your IDE
15-
* Alternatively you can also use the spring boot maven plugin by running `gradle bootRun` from the command line.
21+
* Alternatively you can also use the spring boot maven plugin by running `./gradlew :federation-example:extend-app:bootRun` from the command line in the root examples directory.
1622

1723

1824
Once the app has started you can explore the example schema by opening Playground endpoint at http://localhost:8080/playground.

examples/spring/README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,23 @@ One way to run a GraphQL server is with [Spring Boot](https://github.com/spring-
44

55
### Running locally
66

7-
First you must build all the other modules since this is a multi-module project.
7+
First you must build all the other necessary modules since this is a multi-module project.
88

9-
From the root directory:
9+
From the root examples directory you can run the following:
1010

1111
```shell script
12-
gradle build
12+
# build all examples
13+
./gradlew build
14+
15+
# only build spring-example project
16+
./gradlew :spring-example:build
1317
```
1418

19+
> NOTE: in order to ensure you use the right version of Gradle we highly recommend to use the provided wrapper scripts
20+
1521
Then to start the server:
1622

1723
* Run `Application.kt` directly from your IDE
18-
* Alternatively you can also use the spring boot maven plugin by running `gradle bootRun` from the command line in the spring example directory.
24+
* Alternatively you can also use the spring boot maven plugin by running `./gradlew :spring-example:bootRun` from the command line in the root examples directory.
1925

2026
Once the app has started you can explore the example schema by opening the GraphQL Playground endpoint at http://localhost:8080/playground.

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ dokkaVersion = 0.10.0
2626
jacocoVersion = 0.8.5
2727
ktlintVersion = 0.35.0
2828
ktlintPluginVersion = 9.1.1
29+
stagingPluginVersion = 0.21.2

graphql-kotlin-spring-server/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ description = "Spring Boot autoconfiguration library for creating reactive Graph
22

33
plugins {
44
id("org.jetbrains.kotlin.plugin.spring")
5-
kotlin("kapt")
5+
id("org.jetbrains.kotlin.kapt")
66
}
77

88
val kotlinCoroutinesVersion: String by project

settings.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ pluginManagement {
44
val kotlinVersion: String by settings
55
val ktlintPluginVersion: String by settings
66
val springBootVersion: String by settings
7+
val stagingPluginVersion: String by settings
78

89
plugins {
910
id("org.jetbrains.kotlin.jvm") version kotlinVersion
11+
id("org.jetbrains.kotlin.kapt") version kotlinVersion
1012
id("org.jetbrains.kotlin.plugin.spring") version kotlinVersion
1113
id("io.gitlab.arturbosch.detekt") version detektVersion
1214
id("org.jlleitschuh.gradle.ktlint") version ktlintPluginVersion
1315
id("org.jetbrains.dokka") version dokkaVersion
1416
id("org.springframework.boot") version springBootVersion
17+
id("io.codearte.nexus-staging") version stagingPluginVersion
1518
}
1619
}
1720

0 commit comments

Comments
 (0)