Konfigurowanie Eclipse

This article describes how to configure your Eclipse workspace for plugin development with SpongeAPI and a build system such as Maven or Gradle.

Informacja

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

Przygotowywanie Gradle

Informacja

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.

Wskazówka

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

  • Open Eclipse.

  • Kliknij Help > Eclipse Marketplace.

  • Szukaj «» Gradle integrację wtyczki «».

  • Zainstaluj Gradle Integration Plugin.

Tworzenie twojego projektu

  • Open Eclipse.

  • Kliknij File > New > Other.

  • Wybierz Gradle > Gradle Project.

  • Kliknij Next.

  • Wprowadź nazwę projektu, a następnie kliknij Finish.

Editing the build script

  • Open build.gradle in the navigator.

  • Edytuj skrypt kompilacji zgodnie z instrukcjami podanymi w Konfigurowanie Gradle.

  • Kliknij prawym przyciskiem myszy na projekt i wybierz Gradle > Refresh Gradle Project.

Importowanie twojego projektu

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:

  • Kliknij File > Import

  • Wybierz Gradle > Gradle Project

  • Przejdź do folderu głównego projektu

  • Kliknij Zakończ

Maven

Tworzenie twojego projektu

  • Open Eclipse.

  • Kliknij File > New > Other.

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

  • Kliknij 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 Główna Klasa Pluginu for details.

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

    • Twoja Wersja zależy do Ciebie.

  • Kliknij Finish.

Wskazówka

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.

Edytowanie konfiguracji projektu

  • Otwórz pom.xml w nawigatorze.

  • Edit the build configuration according to the instructions at Konfigurowanie Maven.

  • Refresh your Maven project.

Importowanie twojego projektu

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:

  • Kliknij File > Import

  • Wybierz Maven > Existing Maven Projects

  • Przejdź do folderu głównego projektu

  • Kliknij Zakończ

Integracja Git

Fundacja Eclipse oferuje dokumentacje do użycia Eclipse EGit plugin:

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