Maven issues

Discussion in 'Plugin Development' started by Zarkopafilis, May 30, 2014.

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

    Zarkopafilis

    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>Name</groupId>
      <artifactId>Name</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <packaging>jar</packaging>
     
      <name>Name</name>
      <url>http://maven.apache.org</url>
     
      <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      </properties>
     
      <repositories>
            <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.7.9-R0.2</version>
                <scope>provided</scope>
            </dependency>
      </dependencies>
     
      <build>
        <finalName>Name</finalName>
        <sourceDirectory>src/main/java</sourceDirectory>
        <resources>
            <resource>
                <targetPath>.</targetPath>
                <filtering>true</filtering>
                <directory>${basedir}/src/main/resources/</directory>
                <includes>
                    <include>plugin.yml</include>
                </includes>
            </resource>
        </resources>
       
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                        <source>1.6</source>
                        <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
     
    </project>
    Error:
    [​IMG]

    I tried building and updation and cleaning and unchecking the "Do not automatically update dependencies from remote repositories"
     
  2. Offline

    Europia79

    Zarkopafilis

    Did you run the command
    Code:
    mvn dependency:resolve
    or
    mvn dependency:get -Dartifact=org.bukkit:bukkit:1.7.9-R0.2
    I know I've had my share of maven issues... so I wish you the best of luck. Sometimes Maven can be a headache. lol

    Hopefully one of those maven commands can resolve this issue.
     
  3. Offline

    Zarkopafilis

    Im running maven embeded in eclipse
     
  4. Offline

    xize

    Zarkopafilis

    the pom looks fine but I'm not sure about that <scope>provided</scope> thing though I don't use it in my own pom though.

    however if you want to be 100% sure its downloaded you could check your .m2 folder in %userprofile%\.m2\

    this always happends to me when my internet random disconnects when I'm building something with maven, what worked for me is removing the bukkit files from the .m2 folder.

    a other problem could also be that the dependency version maybe doesn't exist.
     
    Europia79 likes this.
  5. Offline

    Europia79

    Zarkopafilis

    I don't actually use Eclipse.

    The maven documentation is pretty horrible, but the maven installation was easy... Can you download maven and run those commands ? To see if that fixes the problem.

    The only thing it would do is download bukkit.jar from the remote repository and put it in your local repository. Then, Eclipse would see it in your local repository.

    I understand that you want to use the IDE (i would too in your situation), but just consider this a (hopefully) temporary fix until you figure out how to do it inside Eclipse.

    Also, i think i've read in other threads that people have modified the classpath file to make Eclipse work with Maven (if i remember correctly).
     
  6. Offline

    Zarkopafilis

    http://prntscr.com/3o433c
     
  7. Offline

    xize

    Zarkopafilis
    no jar files?, then you may need to remove that package restart eclipse and run a build it should download the jar files to.
     
  8. Offline

    Europia79


    http://repo.bukkit.org/content/groups/public/org/bukkit/bukkit/

    good call xize. Nope, doesn't look like it exists.

    To prevent this type of situation from happening in the future, I think Eclipse has a short-cut that is CONTROL + SPACEBAR

    HTML:
    <version>|</version>
    Put your cursor inbetween the version tags and press Control+Spacebar, then the code completion should pop-up for the available versions.

    You could use
    1.7.9-R0.1
    or
    1.7.9-R0.2-SNAPSHOT

    Hopefully this is the issue.
     
    Zarkopafilis likes this.
  9. Offline

    Zarkopafilis

    http://prntscr.com/3o45hk Thanks!
     
Thread Status:
Not open for further replies.

Share This Page