- Create a pom.xml in your project root (base it on the one below if you so feel)
- Move your Java sources to
src/main/java
- Move your plugin.yml/whatever to
src/main/resources
- Use with Eclipse
- Use with IntelliJ IDEA
- You can export a jar with the
mvn package
command. You'll need command line maven installed. Goes intotarget
somewhere... I don't use Maven personally.
- Create a build.gradle in your project root (base it on the example if you want)
- Move your Java sources to
src/main/java
- Move your plugin.yml/whatever to
src/main/resources
- Delete the .idea/.iml files (the IDEA project metadata) in your project folder
- Reopen the project folder in IntelliJ
- IntelliJ will prompt you to import the gradle project, let it (On the import prompt, tell it to use an automatic gradle wrapper)
- No idea how to do it in Eclipse, YMMV
- You can generate a package jar with the command prompt/terminal, type
./gradlew jar
. This goes intobuild/libs
Nice stuff :D Gradle isn't hard but it's one of those things you never properly learn since you're coding in Java, not learning Gradle.
Since people here probably want to create plugins, this link will be very useful to get them started: https://bukkit.gamepedia.com/Plugin_Tutorial#Creating_the_Plugin.27s_Class (just skip the ugly Eclipse bits).