Solved help with maven

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

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

    raGan.

    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: https://github.com/raGan262/mavenplugin
    If you are cuirious about how my project looks in eclipse, here it is:
    Show Spoiler
    mvn.JPG

    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

    chasechocolate

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

    raGan.

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

    fireblast709

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

    raGan.

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

    desht

    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 https://github.com/desht/ScrollingMenuSign/blob/master/pom.xml for an example - the maven-compiler-plugin definition can be used to define the Java version you want.
     
    raGan. likes this.
  7. Offline

    raGan.

    desht
    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

    desht

    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

    raGan.

    desht
    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