User:Sagacious Zed/Maven Plugin Tutorial/Eclipse

From BukkitWiki
Jump to: navigation, search

Creating a Maven Project

In eclipse you can create a new project by selecting File > New > Project... from the toolbar.


It will open a New Project dialog. Select the Maven Project wizard and continue.


It will open a New Maven Project dialog. We will check Create a simple project (skip archetype selection) and continue


The New Maven Project dialog will continue to configuring the project. Fill in the group id, artifact id, version, name, and description. Finish the wizard.

Lightbulb.png Note: By convention the group id and artifact id should combine to form your base package name.


Creating a New Package

You can create a new package in eclipse by right clicking on the src/main/java folder and selecting New %gt; Package from the context menu.


Package Names

By convention package names should be the reverse of fully qualified domain names. If you owned your packages will start with com.example.

If you don't have a domain, here are some common conventions

    1. Create an account on a source control site such as github or sourceforge
      • For github, follow the instructions here and you will have a sub-domain, so your package would be com.github.<username>
    2. Use your email. Ex: <username> would be<username>
    3. This is the least preferred method. Simply use any unique package naming, again, use this as your last resort.

There are several things that your package must not begin with and those are:

  • org.bukkit
  • net.bukkit
  • com.bukkit
  • net.minecraft

After getting the base package name, by convention the next name is the plugin name. If you owned and was making the plugin HelloWord, the classes would be located in com.example.helloworld