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

Preparing Gradle

참고

Gradle is automatically included in Eclipse starting from the Neon release (June 22, 2016) and later. These steps are only required for earlier versions.

You must first install the Gradle Integration Plugin before using Gradle in Eclipse. This only needs to be done upon the creation of your first project.

Typically, you do not need the optional Spring modules distributed with this plugin, so you can uncheck them during installation.

  • Open Eclipse.

  • Click Help > Eclipse Marketplace.

  • Search for Gradle Integration Plugin.

  • Install the Gradle Integration Plugin.

Creating your project

  • Open Eclipse.

  • Click File > New > Other.

  • Select Gradle > Gradle Project.

  • ``Next``를 클릭합니다.

  • Enter a project name, then click Finish.

Editing the build script

  • Open build.gradle in the navigator.

  • Edit the build script according to the instructions at Gradle 설치하기.

  • Right-click your project, and select Gradle > Refresh Gradle Project.

Importing your project

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:

  • Click File > Import

  • Select Gradle > Gradle Project

  • Navigate to the root folder of the project

  • Click Finish

Maven

Creating your project

  • Open Eclipse.

  • Click File > New > Other.

  • Select Maven on the left side of the popup, and select Maven Project on the right side.

  • ``Next``를 클릭합니다.

  • Select Create a simple project, unless you require a more advanced setup.

  • Enter your Group ID, Artifact ID, Version, project name, and project description.

    • Your Group ID should usually correspond to your Java package name. See 메인 플러그인 클래스 for details.

    • Your Artifact ID should usually correspond to your plugin ID you chose earlier, e.g. myplugin.

    • **Version**은 자신이 알맞게 설정하시면 됨니다.

  • Finish를 누른다.

Eclipse often does not open new projects after creating them. If this happens, try closing the Eclipse welcome screen; your project should be open behind it.

Editing the project configuration

  • 탐색기에서 ``pom.xml``를 여세요.

  • Edit the build configuration according to the instructions at Maven 설치하기.

  • Refresh your Maven project.

Importing your project

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:

  • Click File > Import

  • Select Maven > Existing Maven Projects

  • Navigate to the root folder of the project

  • Click Finish

Git에 병합하기

The Eclipse Foundation offers documentation on using Eclipse’s EGit plugin:

https://www.eclipse.org/egit/documentation/