Compiling WorldGuard

Discussion in 'Plugin Development' started by SteppingHat, Jul 19, 2012.

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

    SteppingHat

    Hey there.

    So, I want to make a slight modification to worldguard. At the moment, I don't know what the hell I'm doing but the internet is so far helping me get through this :)

    So, I've installed Maven to do something to the thing to make all the errors go away in Eclipse. But this is the error I get in cmd.
    WorldGuard.png
    Chances are it's something really stupid that I'm missing but I don't even know what Maven does let alone how to use it. All I know is that it makes the errors go away :)

    So yeah. Any help is greatly appreciated.
    Thanks heaps awesome community!
     
  2. its says it cant find the POM project
     
  3. Offline

    SteppingHat

    I realised that but I have no idea what that means or what to do :p
     
  4. Offline

    ZeusAllMighty11

    Just telling you this: Decompiling a plugin and/or Java Project in Maven or another program, is only going to try and get as many sources back as possible. During the compilation process when the project was first created (by the original owner), contents can be compressed/deleted/etc. So there is no promise it'll work as wanted.

    Along with that, when you have to recompile after you edit what you wanted (IF you fixed all errors), it still might not work! So why not just suggest it to the devs of WorldGuard what you wanted, instead of going through their project and editing then posting about errors you get while decompiling/recompiling.

    Not sure if my reply was the most on-topic, and I know it wasn't too helpful, but I'd like you to keep that in mind.



    What are you doing anyway?
     
  5. Offline

    SteppingHat

    I'm just simply removing the "You are in a No-PvP area" message that comes up when someone hits another player.
    Since it was so simple I though I could do it myself. In fact, I already have. It's just a matter of recompiling the plugin and getting the resources that are needed to do so.
     
  6. Offline

    SteppingHat

    Does anyone have an idea on how to get the dependencies and compile the plugin?
     
  7. Offline

    np98765

    I commented on the WorldGuard BukkitDev page (again) about the "no-pvp" messages being toggleable, although I'm not expecting the get a response...
     
  8. Offline

    russjr08

    what directory are you in? It should contain a file called POM.xml

    The tree should look like
    Code:
    src
      java
        main
           package.name
             ClassesShouldBeHere
      resources
    target
    POM.xml(pom.xml possibly)
    
     
  9. Offline

    SteppingHat

    russjr08
    I have no clue.
    Basically what I've done is install maven and nothing more.
    I have no idea on what I was or am supposed to do next.
     
  10. Offline

    russjr08

    Find the directory that has a folder called src and a file called pom.xml then you can run mvn clean package
     
  11. Offline

    SteppingHat

    There was no file called pom.xml in the WorldGuard src file.
     
  12. Offline

    russjr08

    Then you're not suppose to compile using Maven.
     
  13. Offline

    SteppingHat

    Then why does it say on sk89q's worldguard github that you maven to compile it?
     
  14. Offline

    russjr08

    Well on his Github he has pom.xml. You need that file to compile with maven. It's necessary.
     
  15. Offline

    SteppingHat

    Where will I put the file anyway or what do I do with it when I find it?

    Ahh. Found it. It wasn't inside the src folder but just outside it.
    Derp.

    But Still. Now that I have it, what do I do with it?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 27, 2016
  16. Offline

    russjr08

    Go to that directory and run mvn clean package install
     
  17. Offline

    SteppingHat

    Thanks. It got rid of half of the errors but there are still heaps left :|

    After looking into it, they're Worldedit dependencies so I did the same thing with maven and worldedit but nothing happened :(

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 27, 2016
  18. Offline

    russjr08

    Hmm :// do you see any instructions anywhere?
     
  19. Offline

    SteppingHat

    I had to do some additional things for worldedit in Git but it gave me errors.
    Running the first command I'm told to do gives me this error,

    Code:
    'chcp' is not recognized as an internal or external command,
    operable program or batch file.
     
  20. Offline

    russjr08

    I've never heard that command before.. O.O
     
  21. Offline

    SteppingHat

    But I never typed in that commmd. This is not maven, it's git.
    The command I typed in was...
    Code:
    git clone -b master git://github.com/sk98q/worldedit.git C:\Dev
     
  22. Offline

    russjr08

    Do you have Git installed?
     
  23. Offline

    SteppingHat

    russjr08
    Yeah. I chose not to use the git program but patch itself into cmd adding the paths and all.
    Git works. If I type in
    Code:
    git
    a help screen comes up.

    Alright, I've managed to get all the dependencies downloaded, as far as git and maven are conserned.
    It's removed most of the errors but a few packages still contain numerous errors.

    This is now driving me nuts...

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 27, 2016
  24. SteppingHat: If you use eclipse do the following:
    1. Remove WorldGuard from your workspace.
    2. Right click at your workspace and choose "Import".
    3. Choose Maven -> Existing maven project.
    4. Browse to the directory containing the pom.xml
    5. Choose it in the projects list and click finish.
    6. Wait till it has everything setted up for you.
    7. Make your changes.
    8. Go to Run -> Run as -> 5 Maven build...
    6. Write "clean install" into "Goals" and click finish.

    You may need to install the maven eclipse plugin if not already done.
     
Thread Status:
Not open for further replies.

Share This Page