Comments (6)
-
You need to set the
loader
class in thepaper { ... }
block. -
I'm not sure. This part is a bit suspicious and looks like it would include classes from dependencies in your plugin JAR. Why do you need it? Same for the shadow plugin.
tasks.jar { val dependencies = configurations .runtimeClasspath .get() .map(::zipTree) from(dependencies) duplicatesStrategy = DuplicatesStrategy.EXCLUDE }
If you want to use the library mechanism you shouldn't need any of this.
It doesn't fully explain the problem though. kotlin-stdlib shouldn't actually end up in the
runtimeClasspath
, sincelibrary
should be acompileOnly
dependency. Maybe check./gradlew :dependencies
to get a list of dependencies and see if kotlin is actually on the runtimeClasspath and why.
from plugin-yml.
Thx for your quick response, the second issue has been solved. It seems like I copied the code snippet in at sometime and then just categorically overlooked it. Removing it solved the issue.
I've referenced my main class as loader in paper, the same class that is also named under paper.main
. But at plugin startup the server doesn't find the kspigot class:
[EntrypointUtil] net/axay/kspigot/main/KSpigot java.lang.NoClassDefFoundError: net/axay/kspigot/main/KSpigot
And it is also not downloaded in the libraries folder in the server directory. But it referenced in the paper-libraries.json in the jar.
from plugin-yml.
You need to create a custom PluginLoader
class, see https://github.com/Minecrell/plugin-yml#paper-1 ("Example PluginLoader").
In many cases it might be easier to declare a bukkit { ... }
plugin instead. In that case you don't need a PluginLoader
because Bukkit/Spigot plugins can declare libraries in plugin.yml
. You can still use most of the Paper-specific API from a good old Bukkit/Spigot plugin.
Personally I would suggest using a Paper plugin only if you are sure that you can benefit from the new/extra functionality offered by those.
from plugin-yml.
Okay, yes replacing pluginYml for Paper with the bukkit version solved the issue for me. Thx a whole lot!
But how can I add my own libraries that are not on maven central? I've tried to shade them into the plugin using shadow. But everytime I use shadow the kotlin libraries and a whole lot more get included again.
from plugin-yml.
But how can I add my own libraries that are not on maven central?
In this case you could either use a custom PluginLoader for a Paper plugin, which would let you configure additional Maven repositories (see resolver::addRepository
) in the example I linked.
I've tried to shade them into the plugin using shadow. But everytime I use shadow the kotlin libraries get included again.
Well, it's still not clear to me why you have kotlin on the runtimeClasspath
used by shadow (see my first comment). It would be good to figure out why that happens, but you could also explicitly include only the dependencies you want (see https://imperceptiblethoughts.com/shadow/configuration/dependencies/#filtering-dependencies).
from plugin-yml.
Thanks a lot for your help! I was able to shade the required dependency into the plugin using:
tasks.shadowJar {
dependencies {
include(<My Dependency>)
}
}
from plugin-yml.
Related Issues (20)
- "library" not adding dependencies to pom.xml for Maven publication HOT 3
- library() resulting in StackOverflowError when adding kotlin-stdlib HOT 2
- Update Plugin HOT 1
- A problem was found with the configuration of task ':generateBukkitPluginDescription' (type 'GeneratePluginDescription'). - In plugin 'net.minecrell.plugin-yml.bukkit' type 'net.minecrell.pluginyml.GeneratePluginDescription' property 'pluginDescription.main' doesn't have a configured value. HOT 1
- Add Support for paper-plugin.yml HOT 2
- Add compatibility with gradle configuration cache HOT 2
- No signature of method: build_cs1dxgpbzjvnqu203tc6dv6un.bukkit() is applicable for argument types: HOT 1
- Version bump HOT 4
- Support 1.20 HOT 1
- Can't import plugin HOT 1
- PaperMC api-version lower than 1.19 HOT 1
- paper-plugin.yml | How to do?
- Paper plugins dependencies format not woring HOT 1
- Libararies Feature from the Spigot plugin.yml HOT 1
- generateLibrariesJson doesn't respect dependency classifier/extension HOT 5
- Execution failed for task ':generateBukkitPluginDescription'. HOT 7
- Task generateBukkitPluginDescription fails HOT 4
- Repository change required on readme.md HOT 4
- Libraries file includes every single repository
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plugin-yml.