robocode-dev / tank-royale

Git repository for Robocode Tank Royale
Apache License 2.0
145 stars 29 forks source link

Cannot import Maven dependency dev.robocode.tankroyale:robocode-tankroyale-bot-api:0.10.0 #7

Closed beamer159 closed 2 years ago

beamer159 commented 2 years ago

Describe the bug Maven dependency dev.robocode.tankroyale:robocode-tankroyale-bot-api:0.10.0 cannot be imported into a Java project. It looks like groupId dev.robocode.tankroyale contains only one artifactId: robocode-tankroyale-bot-api. However, this artifact's pom depends on another artifact that should be in this group: dev.robocode.tankroyale:robocode-tankroyale-schema:0.10.0

To Reproduce Steps to reproduce the behavior (Intellij IDEA):

  1. Create a Gradle project
  2. In build.gradle, in the dependencies block, add implementation 'dev.robocode.tankroyale:robocode-tankroyale-bot-api:0.10.0'
  3. Load Gradle changes

Error info

GradleBot:main: Could not find dev.robocode.tankroyale:robocode-tankroyale-schema:0.10.0.
Searched in the following locations:
  - https://repo.maven.apache.org/maven2/dev/robocode/tankroyale/robocode-tankroyale-schema/0.10.0/robocode-tankroyale-schema-0.10.0.pom
If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
Required by:
    project : > dev.robocode.tankroyale:robocode-tankroyale-bot-api:0.10.0

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

Desktop (please complete the following information): Windows 11

Java info: Oracle v.17

flemming-n-larsen commented 2 years ago

I did a similar setup to reproduce the issue, and I can confirm that the Bot API cannot be downloaded from Maven. I will look into this.

flemming-n-larsen commented 2 years ago

With the new release 0.11.0 it should now be possible to use the Maven dependency dev.robocode.tankroyale:robocode-tankroyale-bot-api:0.11.0. I tested this locally against Maven Central.

For some reason, version 0.11.0 does not show up when searching for the artifact? I might need to do a new release to fix this, as OSSRH does not allow me to update version 0.11.0 when it has been released. I got the same issue for 0.10.0.

beamer159 commented 2 years ago

I am getting the same issue as last time:

Could not find dev.robocode.tankroyale:robocode-tankroyale-schema:0.11.0

Looking at the Maven repo for dev.robocode.tankroyale, this schema artifact is not there, only the api artifact is.

flemming-n-larsen commented 2 years ago

Hmm... something is definitely broken when the artifact is uploaded on Sonatype. I will need to find a good way to reproduce this issue locally so it can be solved once and for all.

The Bot API is a fat jar containing all the dependencies including the robocode-tankroyale-schema.

flemming-n-larsen commented 2 years ago

Quick update on the topic. I realised that I cannot put fat jars on Maven. At least it is bad practise. Hence, I will rework the way the artifacts are build and published in order to fix the real issues.

flemming-n-larsen commented 2 years ago

@beamer159 It seems to work with version 0.11.1 available at the Maven Repository here.

The issue was the pom.xml file that contained explicit dependencies, which it should not, as everything is contained within the jar file.

beamer159 commented 2 years ago

This seems to be resolved now. Thanks for fixing.