Having issues with plugin dependencies

Discussion in 'Plugin Development' started by minepress, Aug 11, 2014.

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

    minepress

    Hi all,

    Been trying to get any of the diguise APIs out there working with my project.
    Everytime I add a dependency inside plugin.yml and then try and add the import, I run into errors.

    I am using Eclipse.
    This is the API I'm trying to use: http://dev.bukkit.org/bukkit-plugins/disguisecraft/pages/developer-api/

    However, I did use iDisguise and that had a similar error.

    Example:

    Plugin.yml:

    Code:
    name: Minevolve
    main: io.github.bradly_spicer.minevolve.Minevolve
    version: 0.0.3
    Author: BradlySpicer
     
    depend: [DisguiseCraft]
     
    commands:
      join:
          description: Join Arena.
          usage: /join
          permission: minevolve.join
          permission-message: You don't have <permission>
      joinmonster:
          description: Join as monster.
          usage: /joinmonster
          permission: minevolve.joinmonster
          permission-message: You don't have <permission>
      joinhuman:
          description: Join as human.
          usage: /joinhuman
          permission: minevolve.joinhuman
          permission-message: You don't have <permission>
    Main.java does include:
    Code:java
    1.  
    2. DisguiseCraftAPI dcAPI;
    3. public void setupDisguiseCraft() {
    4. dcAPI = DisguiseCraft.getAPI();
    5. }


    Basically tried this with a few different plugins and I always get the beginning part of the import underlined in red. (Where bukkit would normally have org.)

    [​IMG]
     
  2. Offline

    Gater12

    minepress
    Did you reference the .jar as an external dependency?
     
    minepress likes this.
  3. Offline

    minepress


    Hey Gater,

    I have not. I assume I should download the Jar and do that. I was unaware! :) For some reason, I thought it would pick up the import from a domain or something :p
     
  4. Offline

    frostalf

    Not sure sure how your project is setup, but somewhere in your project you need to point to where the DisguiseCraft jar is located so that your IDE can import it into the project and can build correctly. If you use maven, it is as simple as adding the dependency to the pom. Also, adding a dependency to plugin.yml doesn't automatically mean your IDE knows where it is at. All it does in the plugin.yml is tells bukkit your plugin relies on that plugin and it won't enable and causes an error to be displayed in console, if the dependency is missing on the server your plugin is trying to be ran on.
     
    minepress likes this.
  5. Offline

    minepress


    Hey frostalf, thanks for that explanation :)

    I have downloaded the jar file and I am indeed using Maven. Will do a google now and have a look around into how to add it as a dependency.

    Thanks again
     
  6. Offline

    Gater12

    minepress likes this.
  7. Offline

    frostalf

    minepress and Gater12 like this.
  8. Offline

    minepress

    Thanks to both Gater12 and frostalf, you guys are being stars :)

    I actually found that link! I've been reading it and trying to piece together what goes where!
    Here is what I have so far (I'm guessing atm with the <dependency> part).

    Code:
      <repositories>
          <repository>
              <id>bukkit-repo</id>
              <url>http://repo.bukkit.org/content/groups/public/</url>
          </repository>
          <repository>
                  <id>disguisecraft</id>
                  <url>http://build.yu8.me:8080/plugin/repository/everything/</url>
            </repository>
      </repositories>
      <dependencies>
          <dependency>
              <groupId>org.bukkit</groupId>
              <artifactId>bukkit</artifactId>
              <version>1.7.9-R0.2</version>
              <type>jar</type>
              <scope>provided</scope>
          </dependency>
          <dependency>
              <groupId>pgDev</groupId>
              <artifactId>bukkit</artifactId>
              <version>1.7.9-R0.2</version>
              <type>jar</type>
              <scope>provided</scope>
          </dependency>
      </dependencies>
    [​IMG]
     
  9. Offline

    Gater12

    minepress
    Complaining there is no artifact called bukkit in pgDev. If you look into pgDev in the maven repo, there is DisguiseCraft and that is the correct artifactId. You can also click further to see all the versions and find which one you want and specify it (with <version></version>)
     
  10. Offline

    minepress

    Just for confirmation, is this the maven repo? http://build.yu8.me:8080/job/DisguiseCraft/ws/javadocs/index.html
     
  11. Offline

    frostalf

    minepress

    <dependency>
    <groupId>pgDev</groupId>
    <artifactId>DisguiseCraft</artifactId>
    <version>5.1</version>
    <type>jar</type>
    <scope>provided</scope>
    </dependency>

    the repositor url you have for disguise craft is correct in what you posted earlier that you have in your pom
     
    minepress likes this.
Thread Status:
Not open for further replies.

Share This Page