Eclipse のセットアップ
This article describes how to configure your Eclipse workspace for plugin development with SpongeAPI and a build system such as Maven or Gradle.
注釈
A tutorial by Mumfrey showing the setup of a Sponge workspace in Eclipse, using the new features in Buildship and ForgeGradle, can be viewed here.
Gradle
プロジェクトの作成
Eclipse で Gradle を使用する前に、 Gradle Integration Plugin をインストールする必要があります。これは最初にプロジェクトを作成する時にのみ必要です。
注釈
通常、このプラグインは Spring モジュールを必要としないため、インストール中にオフにすることができます。
Eclipse を開く
ヘルプ > Eclipse マーケットプレースをクリック。Gradle Integration Pluginで検索。Gradle Integration Plugin をインストール。
プロジェクトを作成する作業に進めるようになります。
ファイル > 新規 > その他をクリック。Gradle > Gradle Projectを選択。次へをクリック。プロジェクト名を入力し、
完了をクリック。
ビルドスクリプトの編集
ナビゲーターの
build.gradleを開きます。Edit the build script according to the instructions at Gradle の設定.
右クリックし、
Gradle > Refresh Dependenciesを選択。
プロジェクトのインポート
If you’ve already started with your project and want to import it again at a later point you need to import it instead of re-creating it inside your IDE:
File > ImportをクリックしますGradle > Gradle Projectを選択します。Navigate to the root folder of the project
Click Finish
Maven
プロジェクトの作成
Eclipse を開く
ファイル > 新規 > その他をクリック。ポップアップ中の左側で
Mavenを選択し、右側でMaven プロジェクトを選択します。次へをクリック。高度なセットアップを必要としない限り、
シンプルなプロジェクトの作成を選択します。Group ID, Artifact ID, Version, プロジェクト名, プロジェクトの説明を入力します。
Group ID は通常、 Java パッケージ名に対応すべきです。詳細は 主要なプラグインのクラス を参照してください。
Artifact ID は通常、
mypluginのように、先に選択した plugin ID に対応すべきです。Version を入力します。
完了をクリック。
ちなみに
Eclipse は、プロジェクトを作った後に、プロジェクトが開かないことがあります。もしそうなった場合は、Eclipse の Welcome スクリーンを閉じてみてください。その後ろにプロジェクトが開いていることがあります。
プロジェクト構成の編集
ナビゲーターの
pom.xmlを開きます。Edit the build configuration according to the instructions at Maven の設定.
Maven プロジェクトを更新します。
プロジェクトのインポート
If you’ve already started with your project and want to import it again at a later point you need to import it instead of re-creating it inside your IDE:
File > ImportをクリックしますSelect
Maven > Existing Maven ProjectsNavigate to the root folder of the project
Click Finish
Git Integration
Eclipse Foundation は Eclipse の EGit プラグインのドキュメントを提供しています: