[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


    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.

  2. Offline

    Sagacious_Zed Bukkit Docs

  3. Offline


    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


    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 (Text):
    1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    2.   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    3.   <modelVersion>4.0.0</modelVersion>
    5.   <groupId>com.github.flash619</groupId>
    6.   <artifactId>MountUp</artifactId>
    7.   <version>0.2.2-SNAPSHOT</version>
    8.   <packaging>jar</packaging>
    10.   <name>MountUp</name>
    11.   <url>http://maven.apache.org</url>
    13.   <properties>
    14.     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    15.   </properties>
    16.     <repositories>
    17.     <repository>
    18.       <id>bukkit-repo</id>
    19.       <url>http://repo.bukkit.org/content/groups/public/</url>
    20.     </repository>
    21.   </repositories>
    22.     <dependencies>
    23.     <dependency>
    24.       <groupId>org.bukkit</groupId>
    25.       <artifactId>bukkit</artifactId>
    26.       <version>1.2.5-R2.0</version>
    27.       <scope>provided</scope>
    28.       </dependency>
    29.           <dependency>
    30.       <groupId>org.bukkit</groupId>
    31.       <artifactId>craftbukkit</artifactId>
    32.       <version>1.2.5-R2.0</version>
    33.       <scope>provided</scope>
    34.     </dependency>
    35.     <dependency>
    36.       <groupId>junit</groupId>
    37.       <artifactId>junit</artifactId>
    38.       <version>4.10</version>
    39.       <scope>test</scope>
    40.     </dependency>
    41.     </dependencies>
    42.     <build>
    43.     <sourceDirectory>${basedir}/src/main/java/</sourceDirectory>
    44.     <resources>
    45.       <resource>
    46.         <targetPath>.</targetPath>
    47.         <filtering>true</filtering>
    48.         <directory>${basedir}/src/main/resources</directory>
    49.         <includes>
    50.           <include>**/*.yml</include>
    51.         </includes>
    52.       </resource>
    53.     </resources>
    54.     <pluginManagement>
    55.         <plugins>
    56.             <plugin>
    57.         <groupId>org.apache.maven.plugins</groupId>
    58.         <artifactId>maven-jar-plugin</artifactId>
    59.         <version>2.3.1</version>
    60.         <configuration>
    61.           <archive>
    62.             <addMavenDescriptor>true</addMavenDescriptor>
    63.             <manifest>
    64.               <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
    65.               <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
    66.             </manifest>
    67.             <manifestEntries>
    68.             </manifestEntries>
    69.           </archive>
    70.         </configuration>
    71.       </plugin>
    72.         </plugins>
    73.     </pluginManagement>
    74.     </build>
    75. </project>
    An image of the build path

    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


    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 26, 2016 at 5:43 AM
  6. Offline

    Sagacious_Zed Bukkit Docs

    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


    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....


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


    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. 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


    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. OOH! Seems cool :D How can I get started using it with Bukkit?
  14. Offline


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

Share This Page