Why does Maven have to be such a pain?

Discussion in 'Plugin Development' started by amkeyte, Mar 6, 2011.

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

    amkeyte

    Ok really I just need to vent.

    I don't understand how everywhere I look on the web it talks about Maven "and its so great for adding dependencies!!! Just go to the POM editor and add it! Friggin WHAM you've got dependencies!" ... or not.

    So.... I'm using Eclipse, Git, and Maven for my project. After screwing around with all this crap for literally HOURS I am able to finally get other projects in my workspace to see each other via Maven POM (required since I want to make sure it all builds and whatnot, and because everyone else uses it, and if I want to have access to their source I need it.)

    So *most* of my setup works. Now I want to add Permissions to the mix, and I would be ok to reference a jar or dl the source into my own workspace. (Tried the source, but it wont work)

    So my questions are these... why is Permissions different then others? What is the best way to get access to this dependency in a) my intellesense and b) runtime classpath so that I wont get the stupid NoClassFoundException stuff I've been dealing with.

    Frankly, I know I'm just being a whiner, but I really fail to see any net benefit from using Maven at all, and wish it wasn't a de-facto requirement for writing bukkit plugins.
    /rant
     
  2. Offline

    Alex Nolan

    I write bukkit plugins using netbeans. I just sort of gave up on maven and eclipse. I just import the recommended build from http://ci.bukkit.org/job/dev-CraftBukkit/ every time I want to update. Seems to work for me.
     
  3. Offline

    amkeyte

    I'll tell ya what Alex... I came over from netbeans myself. After getting to learn my way around Eclipse I really like it, though I still find myself using netbeans shortcuts regularly - lol

    One of the main reasons I will pull source into my workspace is because of the debugging ability it gives me. I can step through craftbukkit code, Permissions Code, my own code, and any other code I happen to be "running" on my debug minecraft server. Its really cool, and super helpful when I get strange exceptions to be able to track them down to a source. (where exactly is that nullPointerException happening?)

    The Git I am mostly able to work with now, and I can see some value there, though I came from subversion on that too, which seemed much more "plug and play" especially on netbeans. If netbeans had decent support for either Git or Maven, I would probably still using it. Unfortunately they don't.

    My problem is that eventually I might get to where I want to make pull requests against bukkit or other plugins, or otherwise just want to work with others in a team setting. I'm guessing that this must be some kind of initiation.. lol.. "If you can't even figure out Maven, how are we supposed to trust you with writing code!!"

    sigh... ok I'll play. [​IMG]
     
  4. Offline

    NathanWolf

    Hi, amkeyte! :)

    So, I do this, and it is a bit tricky, but it works- here's what I do:

    Take a look here

    Go to the root of your project folder and use that command. I think this is about what I use:

    Code:
    mvn install:install-file -Dfile=lib/Permissions.jar -DgroupId=com.nijokun.Permissions.Permissions -DartifactId=Permissions -Dversion=SNAPSHOT-0.0.1 -Dpackaging=jar
    That was off the top of my head, I may have goofed nij's namespace, or the screwy snapshot version thing- but, honestly, I don't know that any of it matters.

    Once you do this- just make sure you type the same info into your POM editor as a new dependency (use "create", I think?), and of course make sure to use "provided".

    This will tell Maven to treat Permissions like a full-fledged dependency, but it will just use the jar in your local repo (the one you added with mvn:install).

    Hope that helps! :D
     
  5. Offline

    Nohup

    I have setup a maven repository for bukkit and craftbukkit releases, if you want to tie into it that is fine. I usually keep a RB out there, but if you want another version you just have to ping me. As far as Maven goes, it really is simple once you get used to it, but coming in new can seem daunting. I have a basic layout project here that Iuse as a starting point and just rename and uncomment as I need. If you download it, the pom has my repository configuration in it.
    [MERGETIME="1299604473"][/MERGETIME]
    Oh, and I rename the jars so that you know what version they are, in case you are looking at the pom and wondering. So it would be like bukkit-0.0.1-432.jar
     
  6. Offline

    amkeyte

    Thank you all for the responses. I'm opting out of Maven.. lol I've decided to manually add dependencies in Eclipse and just edit the classpath in the manifest as required. I'm still able to pull in updates using Git, so when I get to where I want to branch and submit pull requests I'll just cross that bridge when I get to it. (I'm guessing I'll just need to make sure only code changes are tracked by Git as opposed to the project properties)

    Anywho.. I've got it running in the debugger and all the plugins are talking nicely!
    Thanks again!
     
Thread Status:
Not open for further replies.

Share This Page