Skip to content

Commit 7f6cdc8

Browse files
feat: add Paper API dependency example for Maven (#485)
* add maven dependency info * Fix indent * Apply Indent Config * fix snapshot --------- Co-authored-by: olijeffers0n <[email protected]>
1 parent a192539 commit 7f6cdc8

File tree

4 files changed

+101
-53
lines changed

4 files changed

+101
-53
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ indent_size = 2
88
max_line_length = 100
99
insert_final_newline = true
1010
trim_trailing_whitespace = true
11+
12+
[{*.md,*.mdx}]
13+
indent_size = 4

CONTRIBUTING.md

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -106,49 +106,49 @@ of a few ways:
106106

107107
1. `SoftwareVersion` component
108108

109-
This component is used to embed the current version of the software into the documentation. An example of this would be:
109+
This component is used to embed the current version of the software into the documentation. An example of this would be:
110110

111-
```jsx
112-
<SoftwareVersion versionType={"maj-min-pat"}/> // e.g. 1.19.2
113-
<SoftwareVersion versionType={"maj-min"}/> // e.g. 1.19
114-
<SoftwareVersion versionType={"maj"}/> // e.g. 1
111+
```jsx
112+
<SoftwareVersion versionType={"maj-min-pat"}/> // e.g. 1.19.2
113+
<SoftwareVersion versionType={"maj-min"}/> // e.g. 1.19
114+
<SoftwareVersion versionType={"maj"}/> // e.g. 1
115115

116-
// You can set the project name to be used for the versioning (defaults to paper):
117-
<SoftwareVersion versionType={"maj-min-pat"} project={"velocity"}/> // e.g. 3.3.0-SNAPSHOT
118-
```
116+
// You can set the project name to be used for the versioning (defaults to paper):
117+
<SoftwareVersion versionType={"maj-min-pat"} project={"velocity"}/> // e.g. 3.3.0-SNAPSHOT
118+
```
119119

120120
2. `Javadoc` component
121121

122-
This component is used to embed a link to the current version of the corresponding Javadoc. An example of this would be:
122+
This component is used to embed a link to the current version of the corresponding Javadoc. An example of this would be:
123123

124-
```jsx
125-
<Javadoc name={"org.bukkit.event.Event"}>here</Javadoc>
126-
// The project can also be set here, and defaults to Paper
127-
```
124+
```jsx
125+
<Javadoc name={"org.bukkit.event.Event"}>here</Javadoc>
126+
// The project can also be set here, and defaults to Paper
127+
```
128128

129129
3. `VersionFormattedCode` component
130130

131-
This component is used to embed a code block with the current version of the software. An example of this would be:
132-
133-
````jsx
134-
<VersionFormattedCode language={"yaml"}>
135-
```
136-
name: Paper-Test-Plugin
137-
version: '1.0'
138-
main: io.papermc.testplugin.TestPlugin
139-
description: Paper Test Plugin
140-
api-version: '%%_MAJ_MIN_PAT_MC_%%'
141-
bootstrapper: io.papermc.testplugin.TestPluginBootstrap
142-
loader: io.papermc.testplugin.TestPluginLoader
143-
```
144-
</VersionFormattedCode>
145-
146-
// The possible placeholders are:
147-
%%_MAJ_MIN_MC_%% - Major-Minor Paper Version (E.g. 1.20)
148-
%%_MAJ_MIN_PAT_MC_%% - Major-Minor-Patch Paper Version (E.g. 1.20.4)
149-
%%_MAJ_MIN_VEL_%% - Major Velocity Version (E.g. 3.1.0)
150-
%%_MAJ_MIN_PAT_VEL_%% - Major-Minor-Patch Velocity Version (E.g. 3.1.1-SNAPSHOT)
151-
````
131+
This component is used to embed a code block with the current version of the software. An example of this would be:
132+
133+
````jsx
134+
<VersionFormattedCode language={"yaml"}>
135+
```
136+
name: Paper-Test-Plugin
137+
version: '1.0'
138+
main: io.papermc.testplugin.TestPlugin
139+
description: Paper Test Plugin
140+
api-version: '%%_MAJ_MIN_PAT_MC_%%'
141+
bootstrapper: io.papermc.testplugin.TestPluginBootstrap
142+
loader: io.papermc.testplugin.TestPluginLoader
143+
```
144+
</VersionFormattedCode>
145+
146+
// The possible placeholders are:
147+
%%_MAJ_MIN_MC_%% - Major-Minor Paper Version (E.g. 1.20)
148+
%%_MAJ_MIN_PAT_MC_%% - Major-Minor-Patch Paper Version (E.g. 1.20.4)
149+
%%_MAJ_MIN_VEL_%% - Major Velocity Version (E.g. 3.1.0)
150+
%%_MAJ_MIN_PAT_VEL_%% - Major-Minor-Patch Velocity Version (E.g. 3.1.1-SNAPSHOT)
151+
````
152152

153153
When the major version of the software changes, the docs will still need to have a "snapshot" created to keep documentation
154154
for older versions. This is done by using Docusaurus's `version` command:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ How to get docs running on your local machine for development.
99

1010
### Prerequisites
1111

12-
- [node](https://nodejs.org)
13-
- [pnpm](https://pnpm.io/installation)
12+
- [node](https://nodejs.org)
13+
- [pnpm](https://pnpm.io/installation)
1414

1515
### Local Development
1616

docs/paper/dev/getting-started/project-setup.mdx

Lines changed: 62 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,69 @@ You will land into the `build.gradle.kts` file where you can add your dependenci
2727

2828
### Adding Paper as a dependency
2929

30-
To add Paper as a dependency, you will need to add the Paper repository to your `build.gradle.kts` file as well as the dependency itself.
30+
To add Paper as a dependency, you will need to add the Paper repository to your `build.gradle.kts` or `pom.xml` file as well as the dependency itself.
3131

32-
<VersionFormattedCode language={"kotlin"} title={"build.gradle.kts"}>
33-
```
34-
repositories {
35-
mavenCentral()
36-
maven("https://repo.papermc.io/repository/maven-public/")
37-
}
38-
39-
dependencies {
40-
compileOnly("io.papermc.paper:paper-api:%%_MAJ_MIN_PAT_MC_%%-R0.1-SNAPSHOT")
41-
}
42-
43-
java {
44-
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
45-
}
46-
```
47-
</VersionFormattedCode>
32+
<Tabs groupId="author-front-matter">
33+
<TabItem value="gradle-kotlin" label="Gradle Kotlin DSL" default>
34+
<VersionFormattedCode language={"kotlin"} title={"build.gradle.kts"}>
35+
```
36+
repositories {
37+
maven {
38+
name = "papermc"
39+
url = uri("https://repo.papermc.io/repository/maven-public/")
40+
}
41+
}
42+
43+
dependencies {
44+
compileOnly("io.papermc.paper:paper-api:%%_MAJ_MIN_PAT_MC_%%-R0.1-SNAPSHOT")
45+
}
46+
47+
java {
48+
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
49+
}
50+
```
51+
</VersionFormattedCode>
52+
</TabItem>
53+
<TabItem value="gradle-groovy" label="Gradle Groovy DSL">
54+
<VersionFormattedCode language={"groovy"} title={"build.gradle"}>
55+
```
56+
repositories {
57+
maven {
58+
name = 'papermc'
59+
url = 'https://repo.papermc.io/repository/maven-public/'
60+
}
61+
}
62+
63+
dependencies {
64+
compileOnly 'io.papermc.paper:paper-api:%%_MAJ_MIN_PAT_MC_%%-R0.1-SNAPSHOT'
65+
}
66+
```
67+
</VersionFormattedCode>
68+
</TabItem>
69+
<TabItem value="maven" label="Maven POM">
70+
<VersionFormattedCode language={"xml"} title={"pom.xml"}>
71+
```
72+
<project>
73+
<repositories>
74+
<repository>
75+
<id>papermc</id>
76+
<url>https://repo.papermc.io/repository/maven-public/</url>
77+
</repository>
78+
</repositories>
79+
80+
<dependencies>
81+
<dependency>
82+
<groupId>io.papermc.paper</groupId>
83+
<artifactId>paper-api</artifactId>
84+
<version>%%_MAJ_MIN_PAT_MC_%%-R0.1-SNAPSHOT</version>
85+
<scope>provided</scope>
86+
</dependency>
87+
</dependencies>
88+
</project>
89+
```
90+
</VersionFormattedCode>
91+
</TabItem>
92+
</Tabs>
4893

4994
### Setting up the `src` directory
5095

0 commit comments

Comments
 (0)