Skip to content

Commit

Permalink
add maven dependency info
Browse files Browse the repository at this point in the history
  • Loading branch information
powercasgamer committed Oct 2, 2024
1 parent a96a6ef commit b6dd18d
Showing 1 changed file with 64 additions and 15 deletions.
79 changes: 64 additions & 15 deletions docs/paper/dev/getting-started/project-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,73 @@ You will land into the `build.gradle.kts` file where you can add your dependenci

### Adding Paper as a dependency

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.
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.

<VersionFormattedCode language={"kotlin"} title={"build.gradle.kts"}>
```
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
}
<Tabs groupId="author-front-matter">

dependencies {
compileOnly("io.papermc.paper:paper-api:%%_MAJ_MIN_PAT_MC_%%-R0.1-SNAPSHOT")
}
<TabItem value="gradle-kotlin" label="Gradle Kotlin DSL" default>

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
```
</VersionFormattedCode>
<VersionFormattedCode language={"kotlin"} title={"build.gradle.kts"}>
```
repositories {
maven {
name = "papermc"
url = uri("https://repo.papermc.io/repository/maven-public/")
}
}
dependencies {
compileOnly("io.papermc.paper:paper-api:%%_MAJ_MIN_PAT_MC_%%")
}
```
</VersionFormattedCode>

</TabItem>
<TabItem value="gradle-groovy" label="Gradle Groovy DSL">

<VersionFormattedCode language={"groovy"} title={"build.gradle"}>
```
repositories {
maven {
name = 'papermc'
url = 'https://repo.papermc.io/repository/maven-public/'
}
}
dependencies {
compileOnly 'io.papermc.paper:paper-api:%%_MAJ_MIN_PAT_MC_%%'
}
```
</VersionFormattedCode>

</TabItem>

<TabItem value="maven" label="Maven POM">

<VersionFormattedCode language={"xml"} title={"pom.xml"}>
```
<project>
<repositories>
<repository>
<id>papermc</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>%%_MAJ_MIN_PAT_MC_%%</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
```
</VersionFormattedCode>

</TabItem>
</Tabs>

### Setting up the `src` directory

Expand Down

0 comments on commit b6dd18d

Please sign in to comment.