[Tutorial] How to configure Nukkit development environment using Maven (part)

augesrob

Resource Mod
use Maven allows us to more easily develop environment Nukkit plug-ins. This article describes the main part of the configuration of Maven Nukkit development environment pom.xml part for your reference. This article is for readers who already know something about Maven and Java development.

==== The beginning of the body ====

1. Find the pom.xml file In IDEA, the pom.xml file is in the root directory of the created Maven project. As shown:




If you are using other IDEs, refer to your IDE for documentation on Maven. Under normal circumstances, will be in the root directory of the project where the module.
Now let's open this pom.xml file and start editing some of it.

2. Add warehouse repository

, or Chinese to say "warehouse", is Nukkit Maven application as a place to save. We need to add the repository where Nukkit resides to pom.xml for Maven to read.
Look for your repositories in your pom.xml tag, if not, add one like this: (skip this section if you have one)

After finding the repositories tag, add the following to <repositories> ... </ repositories>
Code:
<repositories>
    <repository>
        <id>potestas-repo</id>
        <url>https://repo.potestas.xyz/main/</url>
    </repository>
</repositories>
Copy the codeHere, we use the Maven repository provided by ZXDA. ZXDA server set up in China, many domestic developers should be able to quickly load the contents of the warehouse. For non-domestic developers, we have several mirror addresses that are available in other countries and regions and will be mentioned later.
When done, the entire repositories will look something like this (if you have not added another repository):

So far, the warehouse has been added.

3. Adding Nukkit Dependencies After

adding the repository, we also need to add dependencies to enable Maven to read and download Nukkit. The process of adding a dependency is similar to adding a repository.
First need to find the dependencies tag. If not, you can add repositories according to the method of adding one, not repeat them here.
Once found, add a dependency to <dependencies> ... </ dependencies>
Code:
<dependency>
    <groupId>cn.nukkit</groupId>
    <artifactId>nukkit</artifactId>
    <version>1.0-SNAPSHOT</version>
</dependency>
Copy the code
Here, we read the 1.0-SNAPSHOT version of Nukkit.
The code will look like this (if no other dependencies):

At this point, the addition of the dependency has been completed. It should be noted that the dependency added for each mirror is the same, no matter which country you are using the mirror, add dependencies are like this.

After adding, we can smoothly carry out the development of the Nukkit plug-in.

And so on, there is something almost forgot to say ...

Extra Foreign I. Mirror list

using the mirror method:

Mirroring List: (All images provided by our developers, Nukkit does not guarantee real-time availability)
Provider Server location url

In addition, here for the convenience of everyone, to make some convenient Maven POM template.

Extra II. Maven POM xml Template

replacement inside the groupId, artifactId and version can be used.
 
Last edited by a moderator:
Top