Skip to content

Commit 778e776

Browse files
mykevinjungKevin Jung
andauthored
feat: Support graphql-kotlin-bom (#2020)
### 📝 Description Adding a support on `graphql-kotlin-bom` Generated BOM looks like this: ``` <?xml version="1.0" encoding="UTF-8"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <!-- This module was also published with a richer model, Gradle metadata, --> <!-- which should be used instead. Do not delete the following line which --> <!-- is to indicate to Gradle or any Gradle module metadata file consumer --> <!-- that they should prefer consuming it instead. --> <!-- do_not_remove: published-with-gradle-metadata --> <modelVersion>4.0.0</modelVersion> <groupId>com.expediagroup</groupId> <artifactId>graphql-kotlin-bom</artifactId> <version>8.0.0-SNAPSHOT</version> <packaging>pom</packaging> <name>graphql-kotlin-bom</name> <description>BOM (Bill Of Materials) for graphql-kotlin</description> <dependencies> <dependency> <groupId>com.expediagroup</groupId> <artifactId>graphql-kotlin-automatic-persisted-queries</artifactId> <version>8.0.0-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.expediagroup</groupId> <artifactId>graphql-kotlin-client</artifactId> <version>8.0.0-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.expediagroup</groupId> <artifactId>graphql-kotlin-client-generator</artifactId> <version>8.0.0-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.expediagroup</groupId> <artifactId>graphql-kotlin-client-jackson</artifactId> <version>8.0.0-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.expediagroup</groupId> <artifactId>graphql-kotlin-client-serialization</artifactId> <version>8.0.0-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.expediagroup</groupId> <artifactId>graphql-kotlin-dataloader</artifactId> <version>8.0.0-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.expediagroup</groupId> <artifactId>graphql-kotlin-dataloader-instrumentation</artifactId> <version>8.0.0-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.expediagroup</groupId> <artifactId>graphql-kotlin-federated-hooks-provider</artifactId> <version>8.0.0-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.expediagroup</groupId> <artifactId>graphql-kotlin-federation</artifactId> <version>8.0.0-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.expediagroup</groupId> <artifactId>graphql-kotlin-graalvm-metadata-generator</artifactId> <version>8.0.0-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.expediagroup</groupId> <artifactId>graphql-kotlin-gradle-plugin</artifactId> <version>8.0.0-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.expediagroup</groupId> <artifactId>graphql-kotlin-hooks-provider</artifactId> <version>8.0.0-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.expediagroup</groupId> <artifactId>graphql-kotlin-ktor-client</artifactId> <version>8.0.0-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.expediagroup</groupId> <artifactId>graphql-kotlin-ktor-server</artifactId> <version>8.0.0-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.expediagroup</groupId> <artifactId>graphql-kotlin-maven-plugin</artifactId> <version>8.0.0-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.expediagroup</groupId> <artifactId>graphql-kotlin-schema-generator</artifactId> <version>8.0.0-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.expediagroup</groupId> <artifactId>graphql-kotlin-sdl-generator</artifactId> <version>8.0.0-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.expediagroup</groupId> <artifactId>graphql-kotlin-server</artifactId> <version>8.0.0-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.expediagroup</groupId> <artifactId>graphql-kotlin-spring-client</artifactId> <version>8.0.0-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.expediagroup</groupId> <artifactId>graphql-kotlin-spring-server</artifactId> <version>8.0.0-SNAPSHOT</version> <scope>compile</scope> </dependency> </dependencies> </project> ``` ### 🔗 Related Issues --------- Co-authored-by: Kevin Jung <kjung@expediagroup.com>
1 parent c6c2782 commit 778e776

File tree

4 files changed

+122
-1
lines changed

4 files changed

+122
-1
lines changed

bom/README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# GraphQL Kotlin BOM
2+
[![Maven Central](https://img.shields.io/maven-central/v/com.expediagroup/graphql-kotlin-bom.svg?label=Maven%20Central)](https://central.sonatype.com/search?namespace=com.expediagroup&q=name%3Agraphql-kotlin-bom)
3+
4+
`graphql-kotlin-bom` defines the versions of all the modules in `graphql-kotlin`.
5+
This allows the version of the modules imported in your project to be consistent
6+
without needing to specify the version of each module.
7+
8+
## Usage
9+
10+
With Maven, import a dependency on `graphql-kotlin-bom` in `dependencyManagement` section in your project pom,
11+
and add dependencies on `graphql-kotlin` modules with no version.
12+
13+
```xml
14+
<dependencyManagement>
15+
<dependencies>
16+
<dependency>
17+
<groupId>com.expediagroup</groupId>
18+
<artifactId>graphql-kotlin-bom</artifactId>
19+
<version>${latestVersion}</version>
20+
<type>pom</type>
21+
<scope>import</scope>
22+
</dependency>
23+
</dependencies>
24+
</dependencyManagement>
25+
26+
<dependencies>
27+
<dependency>
28+
<groupId>com.expediagroup</groupId>
29+
<artifactId>graphql-kotlin-client</artifactId>
30+
</dependency>
31+
</dependencies>
32+
```
33+
34+
With Gradle, import `graphql-kotlin-bom` using Gradle `platform`,
35+
and add dependencies on `graphql-kotlin` modules with no version.
36+
37+
```kotlin
38+
implementation(platform("com.expediagroup:graphql-kotlin-bom:$latestVersion"))
39+
40+
implementation("com.expediagroup:graphql-kotlin-client")
41+
```
42+
43+
## Documentation
44+
45+
Additional information can be found in our [documentation](https://opensource.expediagroup.com/graphql-kotlin/docs/server/graphql-server)
46+
and the [Javadocs](https://www.javadoc.io/doc/com.expediagroup/graphql-kotlin-server) of all published library versions.
47+
48+
If you have a question about something you can not find in our documentation or javadocs, feel free to [start a new discussion](https://github.com/ExpediaGroup/graphql-kotlin/discussions).

bom/build.gradle.kts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
description = "BOM (Bill Of Materials) for graphql-kotlin"
2+
3+
plugins {
4+
`maven-publish`
5+
`java-platform`
6+
}
7+
8+
javaPlatform {
9+
allowDependencies()
10+
}
11+
12+
dependencies {
13+
project.rootProject.subprojects.forEach { subproject ->
14+
if (subproject.name != "graphql-kotlin-bom") {
15+
api(subproject)
16+
}
17+
}
18+
}
19+
20+
publishing {
21+
publications {
22+
create<MavenPublication>("graphql-kotlin-bom") {
23+
from(components["javaPlatform"])
24+
pom {
25+
description = "BOM (Bill Of Materials) for graphql-kotlin"
26+
name = "graphql-kotlin-bom"
27+
packaging = "pom"
28+
}
29+
}
30+
}
31+
}

settings.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ include(":graphql-kotlin-dataloader")
3232
include(":graphql-kotlin-dataloader-instrumentation")
3333
include(":graphql-kotlin-automatic-persisted-queries")
3434

35+
// BOM
36+
include(":graphql-kotlin-bom")
37+
3538
//
3639
// Project mappings so we don't need to create projects that group subprojects
3740
//
@@ -65,3 +68,6 @@ project(":graphql-kotlin-ktor-server").projectDir = file("servers/graphql-kotlin
6568
project(":graphql-kotlin-dataloader").projectDir = file("executions/graphql-kotlin-dataloader")
6669
project(":graphql-kotlin-dataloader-instrumentation").projectDir = file("executions/graphql-kotlin-dataloader-instrumentation")
6770
project(":graphql-kotlin-automatic-persisted-queries").projectDir = file("executions/graphql-kotlin-automatic-persisted-queries")
71+
72+
// BOM
73+
project(":graphql-kotlin-bom").projectDir = file("bom")

website/docs/getting-started.mdx

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ Using a JVM dependency manager, link any `graphql-kotlin-*` library to your proj
1818
defaultValue="gradle"
1919
values={[
2020
{ label: 'Gradle Kotlin', value: 'gradle' },
21-
{ label: 'Maven', value: 'maven' }
21+
{ label: 'Gradle Kotlin with BOM', value: 'gradle-bom' },
22+
{ label: 'Maven', value: 'maven' },
23+
{ label: 'Maven with BOM', value: 'maven-bom' }
2224
]
2325
}>
2426

@@ -28,6 +30,15 @@ Using a JVM dependency manager, link any `graphql-kotlin-*` library to your proj
2830
implementation("com.expediagroup", "graphql-kotlin-spring-server", latestVersion)
2931
```
3032

33+
</TabItem>
34+
<TabItem value="gradle-bom">
35+
36+
```kotlin
37+
implementation(platform("com.expediagroup:graphql-kotlin-bom:$latestVersion"))
38+
39+
implementation("com.expediagroup", "graphql-kotlin-spring-server")
40+
```
41+
3142
</TabItem>
3243
<TabItem value="maven">
3344

@@ -39,6 +50,31 @@ implementation("com.expediagroup", "graphql-kotlin-spring-server", latestVersion
3950
</dependency>
4051
```
4152

53+
</TabItem>
54+
55+
<TabItem value="maven-bom">
56+
57+
```xml
58+
<dependencyManagement>
59+
<dependencies>
60+
<dependency>
61+
<groupId>com.expediagroup</groupId>
62+
<artifactId>graphql-kotlin-bom</artifactId>
63+
<version>${latestVersion}</version>
64+
<type>pom</type>
65+
<scope>import</scope>
66+
</dependency>
67+
</dependencies>
68+
</dependencyManagement>
69+
70+
<dependencies>
71+
<dependency>
72+
<groupId>com.expediagroup</groupId>
73+
<artifactId>graphql-kotlin-spring-server</artifactId>
74+
</dependency>
75+
</dependencies>
76+
```
77+
4278
</TabItem>
4379
</Tabs>
4480

0 commit comments

Comments
 (0)