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

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

  1. Offline

    Flash619

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
  3. Offline

    Flash619

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
  4. Offline

    Sagacious_Zed Bukkit Docs

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I also did that too.

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

    This post has been edited 1 time. It was last edited by Flash619 May 18, 2012.
  6. Offline

    Flash619

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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

    This post has been edited 3 times. It was last edited by Flash619 May 18, 2012.
  7. Offline

    Flash619

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    @Sagacious_Zed

    kk Had a rather large build error.
    Any ideas?
  8. Offline

    Sagacious_Zed Bukkit Docs

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    @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.
  9. Offline

    Flash619

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Whats JUnit for anyway? I mean, I honestly don't know...
  10. Offline

    Sagacious_Zed Bukkit Docs

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    One of your test classes failed to be executed properly, because it couldn't find a class....
  11. Offline

    Sagacious_Zed Bukkit Docs

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
  12. Offline

    Flash619

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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.
  13. Offline

    Sagacious_Zed Bukkit Docs

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Good to hear.
  14. Offline

    russjr08

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I know this is going to sound very stupid... but what's Maven? Is it a project repo sort of like Git/Svn?
  15. Offline

    AlbireoX

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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 :)
  16. Offline

    russjr08

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    OOH! Seems cool :D How can I get started using it with Bukkit?
  17. Offline

    AlbireoX

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Best way is to look at other people's projects.

Share This Page