ビルドシステム

GradleMaven のようなビルドシステムはプロジェクトのビルド処理を管理するためのツールです。統合開発環境(IDE) から独立しており、SpongeAPIや他のプラグインとの依存関係管理や、あなたが開発したプラグインのビルド処理の簡略化を配布用に組み込むといった機能を提供します。

注釈

SpongeAPIでプラグインを作成する場合、ビルドシステムは必要とされ ません 。が、ビルドシステムを併用することを推奨します。 ビルドシステムなしでプラグインを作成 の項を除く、これらの文献はすべて依存関係管理を可能とするビルドシステムの併用を前提としています。

Generally, you can use any build system which supports Maven dependencies, which is a standard supported by the majority of build systems for Java projects. The following sections will focus on Gradle and Maven, which are the two most common choices as build systems. If you’re unsure which one to use we recommend using Gradle as it is also used for the Sponge projects and provides the best integration for Sponge plugins.

Gradle

Gradle uses Groovy or Kotlin based scripts for configuring projects. A Gradle project typically consists of a build.gradle file in your project’s root directory, which tells Gradle how to build the project.

ちなみに

Refer to the Gradle User Guide for the installation and a general introduction of concepts used in Gradle. If you’re only interested in how to use Gradle for a simple Java project, a good place to start would be the Gradle Java Quickstart.

Setup your workspace as explained in ワークスペースのセットアップ then follow Gradle の設定.

Maven

Maven uses a XML-based configuration called Project Object Model (or POM) for configuring projects. A Maven project typically contains a pom.xml file in the project root directory which tells Maven how to build the project.

ちなみに

Refer to the Maven Users Centre for the installation and a general introduction of concepts used in Maven. If you’re only interested in how to use Maven for a simple Java project, a good place to start would be Maven in 5 Minutes.

Setup your workspace as explained in ワークスペースのセットアップ then follow Maven の設定.

Creating a plugin without a build system

It is also possible to create Sponge plugins without the use of a build system, only with the included tools in your IDE.

警告

We strongly suggest against using SpongeAPI without a build system. In the long term using a build system will simplify the development process for you and other people wanting to contribute to your project. This method of developing plugins does not receive active testing by the Sponge team.

For developing plugins without a build system, you need to download the SpongeAPI dependency manually from the SpongeAPI Download Page. For developing without a build system, we provide the shaded artifact which bundles all dependencies that would normally be automatically downloaded by the build system.

After you have downloaded the shaded artifact and have added it to a project in your IDE, you can start developing your plugin. Continue at プラグイン ID for choosing an identifier for your project, then continue at 主要なプラグインのクラス.