Plugin integration: Maven dependency error
Hello and thank you for your work on this and other plugins!
I am trying to integrate FMM to my plugin, but I get dependency error
[ERROR] Failed to execute goal on project BCPlugin: Could not resolve dependencies for project ing.bananacraft:BCPlugin:jar:1.0-SNAPSHOT: Failed to collect dependencies at com.magmaguy:FreeMinecraftModels:jar:1.1.2-SNAPSHOT -> com.magmaguy:EasyMinecraftGoals-dist:jar:1.7.0: Failed to read artifact descriptor for com.magmaguy:EasyMinecraftGoals-dist:jar:1.7.0: The following artifacts could not be resolved: com.magmaguy:EasyMinecraftGoals-manager:pom:1.7.0 (absent): Could not find artifact com.magmaguy:EasyMinecraftGoals-manager:pom:1.7.0 in ossrh-releases (https://s01.oss.sonatype.org/content/repositories/releases/)
in my pom.xml I added
<dependency>
<groupId>com.magmaguy</groupId>
<artifactId>FreeMinecraftModels</artifactId>
<version>1.1.2-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
and also figured out to add this
<repository>
<id>ossrh-releases</id>
<url>https://s01.oss.sonatype.org/content/repositories/releases/</url>
</repository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
without these, maven was looking for the dependencies in ...spigotmc.org/nexus...
As I see, it tries to resolve EasyMinecraftGoals-manager dependency, but there is no manager on sonatype.
Please help me to integrate this with my plugin, I am really excited to test it out 😊
P.S.
Maven also tries to download other dependencies of FMM, like net/kyori and so on. It that correct? And should I provide additional repositories for that or is there a way to skip all these additional dependencies?
Ah, this is my bad, as of .1 or .2 you will also need to add in EasyMinecraftGoals because that is being used for handling the hitboxes now and in the future it may also be used for specifying movement patterns via the FMM API (though you can do it right now just using the EMG API).
The page for EasyMinecraftGoals is here https://github.com/MagmaGuy/EasyMinecraftGoals
And the dependency is
<dependency>
<groupId>com.magmaguy</groupId>
<artifactId>EasyMinecraftGoals</artifactId>
<version>1.7.0</version>
</dependency>
I honestly am not sure if having or not having kyori and the other command-related dependencies is a problem here, I guess try it out?
Thank you for the quick reply 😊
Sadly I still have the same error, I feel stupid. I am new to Maven but I tried a lot to fix this, clean install, removed the m2 folder content. Changed the pom.xml Repo to
<repository>
<id>ossrh-public</id>
<url>https://s01.oss.sonatype.org/content/groups/public/</url>
</repository>
but as soon as I add
<dependency>
<groupId>com.magmaguy</groupId>
<artifactId>EasyMinecraftGoals</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>com.magmaguy</groupId>
<artifactId>FreeMinecraftModels</artifactId>
<version>1.1.2-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
I always get
[ERROR] Failed to execute goal on project BCPlugin: Could not resolve dependencies for project ing.bananacraft:BCPlugin:jar:1.0-SNAPSHOT: Failed to collect dependencies at com.magmaguy:FreeMinecraftModels:jar:1.1.2-SNAPSHOT -> com.magmaguy:EasyMinecraftGoals-dist:jar:1.7.0: Failed to read artifact descriptor for com.magmaguy:EasyMinecraftGoals-dist:jar:1.7.0: The following artifacts could not be resolved: com.magmaguy:EasyMinecraftGoals-manager:pom:1.7.0 (absent): Could not find artifact com.magmaguy:EasyMinecraftGoals-manager:pom:1.7.0 in ossrh-public (https://s01.oss.sonatype.org/content/groups/public/) -> [Help 1]
and if I only add this to check out only EasyMinecraftGoals
<dependency>
<groupId>com.magmaguy</groupId>
<artifactId>EasyMinecraftGoals</artifactId>
<version>1.7.0</version>
</dependency>
the editor highlights it in red and says
Missing artifact com.magmaguy:EasyMinecraftGoals:jar:1.7.0Java(0)
but when I change <artifactId>EasyMinecraftGoals</artifactId> to <artifactId>EasyMinecraftGoals-dist</artifactId> the error highlight disappears.
Is it possible that EasyMinecraftGoals-dist requires com.magmaguy:EasyMinecraftGoals-manager but it is not released? Because there is a EasyMinecraftGoals-dist repo, but there is no com.magmaguy:EasyMinecraftGoals-manager repo
Ok so let's try this instead. I've uploaded everything to the snapshots repo instead, don't use the non-snapshots side of sonatype. I accidentally started mixing the two at some point and it was certainly not helping anyone.
https://s01.oss.sonatype.org/content/repositories/snapshots/com/magmaguy/
Note this change:
<repository>
<id>ossrh-public</id>
<url>https://s01.oss.sonatype.org/content/groups/snapshots/</url>
</repository>
<dependency>
<groupId>com.magmaguy</groupId>
<artifactId>EasyMinecraftGoals</artifactId>
<version>1.7.1-SNAPSHOT</version>
</dependency>
Snapshots instead of central, and I'm using 1.7.1 to differentiate it.