GeyserMC / Floodgate

Hybrid mode plugin to allow for connections from Geyser to join online mode servers.
https://geysermc.org
MIT License
569 stars 169 forks source link

Deployed floodgate api maven artifact is fat jar/including all dependencies #495

Closed Phoenix616 closed 5 months ago

Phoenix616 commented 5 months ago

Right now floodgate api maven artifact with 2.2.2-SNAPSHOT version (iirc anything above 2.2.0) include all dependencies (a fat jar). That not only is not how one deploys artifacts to maven (as the pom will reference the dependencies and allow for maven to resolve them) but also leads to conflicts if one wants to use Gson (or one of the other libraries) and the version does not match with what the floodgate artifact forcefully includes. (A dependency could be ignored, you can't ignore individual classes in a jar)

image https://repo.opencollab.dev/maven-snapshots/org/geysermc/floodgate/api/2.2.2-SNAPSHOT/api-2.2.2-20240218.144048-23.jar

The only way to fix that for yourself is to deploy a jar with the wrong packages removes which is just extremely clunky so I would really appreciate if the jar deployed to the repo could be fixed...

nostalfinals commented 5 months ago

I also meet this issue. When I import both Floodgate API and Gson 2.10.1, my IDE use the JsonParser in Floodgate API jar, which is a old version (2.3.1).

onebeastchris commented 5 months ago

For now, you could try and get the dependency with the unshaded classifier, that should be the correct artifact until we make that the default one

For example: compileOnly('org.geysermc.floodgate:api:2.2.2-SNAPSHOT:unshaded')

Phoenix616 commented 5 months ago

Yeah, unshaded classifier seems to work for now although that's kinda annoying when using maven's dependencyManagement as the classifier isn't part of the version so needs to be declared twice :S

onebeastchris commented 5 months ago

Starting with 2.2.3, this should be resolved. Thanks for reporting!