Solved Maven Building

Discussion in 'Plugin Development' started by thebiologist13, Feb 23, 2013.

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

    thebiologist13

    Hello All!

    I am very new to Maven, and I am trying to get my plugins to start using it. I converted my plugins project files in Eclipse to use Maven, created the pom.xml, and tried to install it. However, every time I try to run "clean install", "install", or "package", it spits out a bunch of errors about not being able to find the NMS classes I use in my plugin. Usually like "package net.minecraft.server.v1_4_R1 does not exist". I have the Bukkit Repo as a dependency.

    The pom.xml
    Code:xml
    1. <project xmlns="[URL]http://maven.apache.org/POM/4.0.0[/URL]" xmlns:xsi="[URL]http://www.w3.org/2001/XMLSchema-instance[/URL]"
    2. xsi:schemaLocation="[URL]http://maven.apache.org/POM/4.0.0[/URL] [URL]http://maven.apache.org/xsd/maven-4.0.0.xsd[/URL]">
    3. <modelVersion>4.0.0</modelVersion>
    4. <groupId>com.github.thebiologist13</groupId>
    5. <artifactId>CustomSpawners</artifactId>
    6. <version>0.3</version>
    7. <name>CustomSpawners</name>
    8. <url>[URL]http://dev.bukkit.org/server-mods/thebiologist13</url>[/URL]
    9.  
    10. <build>
    11. <resources>
    12. <resource>
    13. <directory>src/main/java</directory>
    14. <excludes>
    15. <exclude>**/*.java</exclude>
    16. <exclude>**/dependency-reduced-pom.xml</exclude>
    17. </excludes>
    18. <filtering>true</filtering>
    19. </resource>
    20. </resources>
    21. <plugins>
    22. <plugin>
    23. <artifactId>maven-compiler-plugin</artifactId>
    24. <version>2.3.2</version>
    25. <configuration>
    26. <source>1.6</source>
    27. <target>1.6</target>
    28. </configuration>
    29. </plugin>
    30. <plugin>
    31. <groupId>org.apache.maven.plugins</groupId>
    32. <artifactId>maven-shade-plugin</artifactId>
    33. <version>2.0</version>
    34. <executions>
    35. <execution>
    36. <phase>package</phase>
    37. <goals>
    38. <goal>shade</goal>
    39. </goals>
    40. </execution>
    41. </executions>
    42. <configuration>
    43. <artifactSet>
    44. <includes>
    45. <include>net.astesana:javaluator</include>
    46. </includes>
    47. </artifactSet>
    48. </configuration>
    49. </plugin>
    50. </plugins>
    51. </build>
    52.  
    53. <repositories>
    54. <repository>
    55. <id>bukkit-repo</id>
    56. <url>[URL]http://repo.bukkit.org/content/groups/public/</url>[/URL]
    57. </repository>
    58. </repositories>
    59.  
    60. <dependencies>
    61. <dependency>
    62. <groupId>org.bukkit</groupId>
    63. <artifactId>bukkit</artifactId>
    64. <version>1.4.7-R1.0</version>
    65. </dependency>
    66. <dependency>
    67. <groupId>net.astesana</groupId>
    68. <artifactId>javaluator</artifactId>
    69. <version>1.2.2</version>
    70. </dependency>
    71. <dependency>
    72. <groupId>com.sk89q</groupId>
    73. <artifactId>worldedit</artifactId>
    74. <version>5.5</version>
    75. <scope>system</scope>
    76. <systemPath>${project.basedir}/src/main/resources/worldedit-5.5.jar</systemPath>
    77. </dependency>
    78. <dependency>
    79. <groupId>com.sk89q</groupId>
    80. <artifactId>worldguard</artifactId>
    81. <version>5.7</version>
    82. <scope>system</scope>
    83. <systemPath>${project.basedir}/src/main/resources/worldguard-5.7.jar</systemPath>
    84. </dependency>
    85. </dependencies>
    86.  
    87. </project>

    Is there something I am missing in the POM? Or does NMS code need a separate dependency or something?

    Thanks! :D
    ~thebiologist13

    Whoops! Fixed my own bug. :p

    I fixed it by adding the Craftbukkit (not Bukkit) as a repository and dependency like so:
    Code:xml
    1. <repositories>
    2. <repository>
    3. <id>craftbukkit-repo</id>
    4. <url>[URL]https://github.com/Bukkit/CraftBukkit</url>[/URL]
    5. </repository>
    6. </repositories>
    7. <dependencies>
    8. <dependency>
    9. <groupId>org.bukkit</groupId>
    10. <artifactId>craftbukkit</artifactId>
    11. <version>1.4.7-R1.0</version>
    12. </dependency>
    13. </dependencies>
    14.  


    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 31, 2016
Thread Status:
Not open for further replies.

Share This Page