Solved help with maven

Discussion in 'Plugin Development' started by raGan., Dec 30, 2012.

Thread Status:
Not open for further replies.
  1. Offline


    I would like to convert my plugin to maven, so I set up little sample project to test it before i actually do try to do it with quester. I set up project, set up repository, set up maven. It downloaded everything needed and succesfully built it.

    BUT it built nothing. Resulting jar contains only META-INF and no class files or aything else. What am I doing wrong here ? I use m2e, I tried to use various goals, but I think "compile package" should be enough to see some results.

    GitHub repo:
    If you are cuirious about how my project looks in eclipse, here it is:
    Show Spoiler

    I know I am failing very hard somewhere, but I can't seem to find the problem. I am asking here because many of you have been successfully using maven for a long time. Thanks for any help.

    Edit: also i don't know how to change JRE in project view, it keeps changing back to 1.5 (probably maven also does that)

    Edit2: log
  2. Offline


    Shouldn't it be a public void onEnable?
  3. Offline


    now it is, but this isn't the problem here
  4. Offline


    Netbeans natively supports Maven :p. No clue how it works with eclipse
  5. Offline


    Eclipse with m2e plugin should work just fine, problem is that I have no idea what I'm doing here.
  6. Offline


    By default, Maven expects to find your sources under src/main/java/<package-path>, which isn't how you have your project laid out.

    If you're using m2e, then creating a new Maven project should create the right directory hierarchy for you, but there's nothing to stop you creating those directories yourself.

    Also, your plugin.yml should be in src/main/resources. Your pom.xml is in the right place.

    Your JRE is indeed influenced by your pom.xml - see for an example - the maven-compiler-plugin definition can be used to define the Java version you want.
    raGan. likes this.
  7. Offline


    Thanks for clarification, but if I convert already existing project to maven project, it will create this folder structure. Is it OK to just change it to my maven's liking ? What about git repo, will it think it's completely different project when pushing changed folder structure ?
  8. Offline


    Git is fairly clever about spotting files that have been moved within a repo - that should work fine (but make a backup of your current project layout first!)
  9. Offline


    Thanks again for help.
    I had one more problem, but I managed to it solve myself.
Thread Status:
Not open for further replies.

Share This Page