Closed BaronyCraft closed 5 years ago
No. This is the incorrect way to solve the problem you are having.
If you are picking up other dependencies in your final jar, it means those dependencies are incorrectly defined as compile (as you said) and should be changed to provided instead.
not going to push a bandaid for larger build issues.
The only thing we could do is "Is this your first time adding maven-shade-plugin? Be sure you have your other dependencies such as bukkit/spigot-api set to <scope>provided</scope>
"
PR's welcome for that
When a .pom file doesn't set a scope for a dependency, it seems like the scope defaults to
compile
, which in turn makes the maven shader include and shade all those dependencies. For people who aren't proficient in maven, and just want to add PaperLib to an existing project, this means that suddenly a lot of libraries get pulled into the final jar, without an apparent reason.Thus, I suggest expanding the maven example to
This will make projects that start using the shader plugin shade just PaperLib, which is probably what's intended, and projects which have already been using the shader can easily remove or amend the part.