[SOLVED]Maven is finally getting to me. Unable to find artifacts.

Discussion in 'Plugin Development' started by Flash619, May 18, 2012.

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

    Flash619

    Today I noticed that there was a update to craftbukkit. So I decided to try to update my maven repository. Which eventually lead to Eclipse complaining on end that it could not find the new artifact. I had installed the file with the following details:
    Group ID: org.bukkit
    Artifact ID: craftbukkit
    Version: 1.2.5-R2.0

    I put it in Eclipse as:
    Group ID: org.bukkit
    Artifact ID: craftbukkit
    Version: 1.2.5-R2.0

    Yet eclipse complained that it could not find it, even though the maven install came out as a complete success. I had tried to reload dependencies, re saving and re loading the pom, restarting the linux machine, everything.

    It still would not find it.

    I had read up on it, and someone kept recommending to install the "bukkit repository" which ended up being another "rather huge wall of text error" that basically said, "Hey, it wont work."

    I really love the use of maven for keeping track of plugin versions, but at this point, I really don't know what to do to get the thing to work anymore. I never really liked maven that much, just because, it seemed way too much work for too little, but I was able to push aside these problems, because I wanted to make it easier for others when it came to github, and dependencies. But, at this point, I have just about given up on the whole idea all together.

    For this reason, and the fact that it seems no decent tutorials exist on the subject. I wanted to ask if anyone, could possible, make a simple guide to using this stuff.

    Thank you for your time.

    ~Flash619
     
  2. Offline

    Sagacious_Zed Bukkit Docs

  3. Offline

    Flash619

    Thats what I did.
     
  4. Offline

    Sagacious_Zed Bukkit Docs

    Then can you show us your pom.xml, because i don't see anything like that in what you posted.

    Also eclipse may not automatically realize the change you may need to right click on your project and go
    maven > update project configuration, and/or maven > update dependencies
     
  5. Offline

    Flash619

    I also did that too.

    I mean, I'll try it all again. But there is a fair chance that nothing will work.

    Ok so now I'm getting a:
    My POM is:
    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>com.github.flash619</groupId>
      <artifactId>MountUp</artifactId>
      <version>0.2.2-SNAPSHOT</version>
      <packaging>jar</packaging>
     
      <name>MountUp</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.2.5-R2.0</version>
          <scope>provided</scope>
          </dependency>
              <dependency>
          <groupId>org.bukkit</groupId>
          <artifactId>craftbukkit</artifactId>
          <version>1.2.5-R2.0</version>
          <scope>provided</scope>
        </dependency>
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>4.10</version>
          <scope>test</scope>
        </dependency>
        </dependencies>
        <build>
        <sourceDirectory>${basedir}/src/main/java/</sourceDirectory>
        <resources>
          <resource>
            <targetPath>.</targetPath>
            <filtering>true</filtering>
            <directory>${basedir}/src/main/resources</directory>
            <includes>
              <include>**/*.yml</include>
            </includes>
          </resource>
        </resources>
        <pluginManagement>
            <plugins>
                <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.3.1</version>
            <configuration>
              <archive>
                <addMavenDescriptor>true</addMavenDescriptor>
                <manifest>
                  <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                  <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                </manifest>
                <manifestEntries>
                </manifestEntries>
              </archive>
            </configuration>
          </plugin>
            </plugins>
        </pluginManagement>
        </build>
    </project>
    
    An image of the build path
    [​IMG]

    Seems like everything, except that, is working, and because of that, it wont build -_-

    So I added it into the libraries... but shouldn't it be able to automatically get that from Maven? o.0

    Sagacious_Zed

    kk Had a rather large build error.
    Any ideas?

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

    Sagacious_Zed Bukkit Docs

    Flash619
    If you are not using junit as a dependency right now, you can remove it as a dependency from the pom. IF not you can try deleting the junit jar in your local maven repository and let maven re download it.
     
  7. Offline

    Flash619

    Whats JUnit for anyway? I mean, I honestly don't know...
     
  8. Offline

    Sagacious_Zed Bukkit Docs

    One of your test classes failed to be executed properly, because it couldn't find a class....

    http://www.junit.org/

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

    Flash619

    Oh I see. Thats neat, but I don't really see any actual uses for it tho. I mean. Making test methods is cool but. Whats the point?

    Also it seems as if deleting everything and re downloading it all fixed it.
     
  10. Offline

    Sagacious_Zed Bukkit Docs

    Good to hear.
     
  11. Offline

    russjr08

    I know this is going to sound very stupid... but what's Maven? Is it a project repo sort of like Git/Svn?
     
  12. Offline

    AlbireoX

    Maven is a build automation tool. No more setting build paths. Just `mvn clean install`.

    And JUnit has some great uses. It makes sure your code works when you're not running your test server by making sure every method (unit) does exactly what it's supposed to do. However, with Java, unit testing sucks. Mocha for Coffeescript is the way to go :)
     
  13. Offline

    russjr08

    OOH! Seems cool :D How can I get started using it with Bukkit?
     
  14. Offline

    AlbireoX

    Best way is to look at other people's projects.
     
Thread Status:
Not open for further replies.

Share This Page