PaperMC / PaperLib

Plugin Library for interfacing with Paper Specific API's with graceful fallback that maintains Spigot Compatibility, such as Async Chunk Loading.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suggestion: add an <artifactSet><includes> section to <configuration> in the maven example

BaronyCraft opened this issue · comments

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

...
<configuration>
        <artifactSet>
                <includes>
                    <include>io.papermc:paperlib:jar:*</include>
                </includes>
        </artifactSet>
        <dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
        <relocations>
...

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.

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