Maven help.

Discussion in 'Spigot Plugin Development' started by avighnash, Jun 15, 2016.

  1. Hello everyone! I have always wanted to use maven, but never knew where to start. That's why, I am going to ask you guys to help me. I have looked at a lot of tutorials, and I feel like I would benefit even more if someone taught me. So, could you guys teach me how to set up and use maven from step one, getting the eclipse plugins? Thanks!
     
  2. The plugin is included in Eclipse Mars 2 I guess. I've installed Eclipse EE.
     
  3. www.spigotmc.org/wiki/spigot-maven

    Eclipse has a maven plugin https://eclipse.org/m2e/
     
  4. Really? How do I update my eclipse I have rn?
     
  5. you dont need to use your IDE for maven, it works fine without it.
    Its just nice for dependency mangement.

    I used to have m2e plugin when i still used eclipse.

    There are pelnty of maven tutorials out there!
    but the basics of it are:
    Copy someones pom.xml
    Change the source directory and name/dependencies
    run "mvn clean install" in cmd
     
  6. I checked if its there, it is.
     
  7. So, how do I create a maven project with this plugin?
     
  8. I need this urgently
     
  9. Create a pom.xml for your project. Then move all your sources to /src/main/java/ and your yml files to /src/main/resources/
     
  10. What p
    roject? A normal one? Or a maven one? If a maven one, how do I create a maven project?
     
  11. Yes, that plugin is m2e. You need it otherwise you wouldnt see Maven as an option in step 2 of the link I pasted.

    Literally what it says. I thought you had a previous project you wanted to mavenize.
     
  12. Yup, this is what I want. So I create a pom.xml, then what?
     
  13. Do this outside of your IDE. Then once in the IDE just open the project and refresh it. Should work fine.
     
  14. This is my project so far:
    re.png
     
  15. You didnt move your sources or yml files like I said....

    [​IMG]
     
  16. But where is the main and java folders in my project? Would the JRE PRoject folders be the java folder?