Solved Problems with Maven using WorldEdit and WorldGuard

Discussion in 'Plugin Development' started by Vilsol, Oct 8, 2013.

Thread Status:
Not open for further replies.
  1. So I have run in a bit of a problem, where for some reason my Maven doesn't load dependencies from the repositories, saying that they don't exist, even though they do.

    Here is the pom.xml:
    Show Spoiler
    Code:
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
     
        <groupId>consolescript</groupId>
        <artifactId>ConsoleScript</artifactId>
        <version>1.0</version>
        <packaging>jar</packaging>
     
        <name>ConsoleScript</name>
        <url>https://github.com/Vilsol/ConsoleScript</url>
     
        <repositories>
            <repository>
                <id>sk89q-repo-wg</id>
                <url>http://maven.sk89q.com/artifactory/repo/com/sk89q/worldguard/</url>
            </repository>
            <repository>
                <id>sk89q-repo-we</id>
                <url>http://maven.sk89q.com/artifactory/repo/com/sk89q/worldedit/</url>
            </repository>
            <repository>
                <id>bukkit-repo</id>
                <url>http://repo.bukkit.org/content/groups/public</url>
            </repository>
        </repositories>
     
        <dependencies>
            <dependency>
                <groupId>org.bukkit</groupId>
                <artifactId>bukkit</artifactId>
                <version>1.6.4-R0.1-SNAPSHOT</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.8.2</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.sk89q</groupId>
                <artifactId>worldedit</artifactId>
                <version>5.5.8</version>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>com.sk89q</groupId>
                <artifactId>worldguard</artifactId>
                <version>5.8-SNAPSHOT</version>
                <scope>compile</scope>
            </dependency>
        </dependencies>
     
        <build>
            <resources>
                <resource>
                    <directory>src/main/java</directory>
                    <filtering>true</filtering>
                    <includes>
                        <include>plugin.yml</include>
                    </includes>
                </resource>
            </resources>
     
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.3.2</version>
                    <configuration>
                        <source>1.6</source>
                        <target>1.6</target>
                    </configuration>
                </plugin>
     
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>1.7.1</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                            <configuration>
                                <artifactSet>
                                    <includes>
                                        <include>*</include>
                                    </includes>
                                    <excludes>
                                        <exclude>org.bukkit:bukkit</exclude>
                                    </excludes>
                                </artifactSet>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </project>

    And this is the generated output:
    Show Spoiler
    Code:
    [INFO] Scanning for projects...
    [INFO]
    [INFO] ------------------------------------------------------------------------
    [INFO] Building ConsoleScript 1.0
    [INFO] ------------------------------------------------------------------------
    [WARNING] The POM for com.sk89q:worldedit:jar:5.5.8 is missing, no dependency information available
    [WARNING] The POM for com.sk89q:worldguard:jar:5.8-SNAPSHOT is missing, no dependency information available
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 0.313s
    [INFO] Finished at: Tue Oct 08 10:41:40 BST 2013
    [INFO] Final Memory: 6M/243M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal on project ConsoleScript: Could not resolve dependencies for project consolescript:ConsoleScript:jar:1.0: The following artifacts could not be resolved: com.sk89q:worlde dit:jar:5.5.8, com.sk89q:worldguard:jar:5.8-SNAPSHOT: Failure to find com.sk89q:worldedit:jar:5.5.8 in http://maven.sk89q.com/artifactory/repo/com/sk89q/worldguard/ was cached in the local repository, resolution will not be reattempted until the update interval of sk89q-repo-wg has elapsed or updates are forced -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException


    I have already read their help article and tried forcing the repo update, nothing works.
     
  2. Offline

    LaughNgamez

    Hopefully someone helps you here!
     
  3. Offline

    BillyGalbreath

    You only need the repository once, not twice. And use the correct location: http://maven.sk89q.com/artifactory/repo/

    Both WG and WE will be found from there using the group and artifact ids (com/sk89q/worldedit)

    However...

    I've had issues with their repo in the past. What I did to get around it was include the .jar in my project in a /lib directory then in pom did this:

    Code:
    <dependency>
        <groupId>com.sk89q</groupId>
        <artifactId>worldedit</artifactId>
        <version>5.5.8</version>
        <scope>system</scope>
        <systemPath>${basedir}/lib/WorldEdit.jar</systemPath>
    </dependency>
    
    Remove the repository from the pom, too. If you want your Jenkins to compile, be sure you include the /lib directory to your github.
     
  4. This is my working pom.xml. It has WorldGuard dependency.
    See this, and this.
     
  5. Thank you, both of you, but my problem is that I want to use the 1.6.4 version of both plugins, while in the main repo I can only get the 5.7.3 version of it.

    I might download it and put it in a lib folder, but I would really want to avoid it.
     
  6. Nevermind! Fixed everything. Solved!
     
Thread Status:
Not open for further replies.

Share This Page