Building WG

Discussion in 'Programming Help' started by vtr, Apr 14, 2017.

  1. vtr

    vtr New Member

    Hey, can someone help me with this?
    I am trying to build worldguard with gradle and getting this error

    FAILURE: Build failed with an exception.

    * What went wrong:
    A problem was found with the configuration of task ':worldguard-legacy:checkstyleMain'.
    > File 'D:\WorldGuard-master\worldguard-legacy\config\checkstyle\checkstyle.xml' specified for property 'configFile' does not exist.

    I really dont know how to use gradle, can someone please help me?
  2. wizjany

    wizjany Administrator Developer

    you need to build the root project, not the subproject; i.e. don't naviagate into the worldguard-legacy folder, stay at the top level.
  3. vtr

    vtr New Member

    Wich run options should i use? Im having this error on loading wg on server:
    org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: com/sk89q/squirrelid/cache/ProfileCache
  4. wizjany

    wizjany Administrator Developer

    you need to use the -dist.jar which has dependencies shaded
  5. vtr

    vtr New Member

  6. wizjany

    wizjany Administrator Developer

    No idea what your IDE is doing but I do it this way...

    /worldguard (master) $ ./gradlew build
    (build output)

    /worldguard (master) $ cp worldguard-legacy/build/libs/worldguard-legacy-6.2.1-SNAPSHOT-dist.jar /path/to/server/plugins/
  7. vtr

    vtr New Member

    I am using eclipse, should i use any other IDE? or prompt?
    I really dont know what is build output and how to use it..
  8. wizjany

    wizjany Administrator Developer

    Using the provided wrapper script guarantees consistency. I can't guarantee what your or any other IDE might run/output/whatever.
  9. vtr

    vtr New Member

  10. wizjany

    wizjany Administrator Developer

  11. vtr

    vtr New Member

    And where can i set the path to get the jar with all dependencies?
  12. wizjany

    wizjany Administrator Developer

  13. vtr

    vtr New Member

    I write this in where? prompt?
  14. vtr

    vtr New Member

    Oh, i think i got it, i have to use the dist jar, correct?
  15. vtr

    vtr New Member

    Now im getting this error:
    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':worldguard-legacy:checkstyleMain'.
    > Checkstyle rule violations were found. See the report at: file:///D:/WorldGuard-master/worldguard-legacy/build/reports/checkstyle/main.xml

    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

    BUILD FAILED
    does any1 knows how to solve it?
  16. wizjany

    wizjany Administrator Developer

    you either need to follow our code guidelines or skip the checkstyle task with "-x worldguard-legacy:checkstyleMain"
  17. vtr

    vtr New Member

    Where is your code guidelines?
  18. wizjany

    wizjany Administrator Developer

    go look at the report that the build process gave you, it'll tell you what's missing.
  19. vtr

    vtr New Member

    Man, could you please tell me what is causing this? I dont have any experience using gradle..
  20. wizjany

    wizjany Administrator Developer

    then just skip the test like i told you to. it's just there to prevent badly formatted code from making it back into our official repo.