minecrell / plugin-yml Goto Github PK
View Code? Open in Web Editor NEWA Gradle plugin that generates plugin.yml for Bukkit/Paper/BungeeCord/Nukkit plugins based on the Gradle project
License: MIT License
A Gradle plugin that generates plugin.yml for Bukkit/Paper/BungeeCord/Nukkit plugins based on the Gradle project
License: MIT License
When I try to build my project I receive the following error:
Execution failed for task 'Project:generateBukkitPluginDescription'.
> 'com.fasterxml.jackson.core.io.ContentReference com.fasterxml.jackson.dataformat.yaml.YAMLFactory._createContentReference(java.lang.Object)'
bukkit {
main = "main"
version = pluginVersion
}
paper {
website = "content"
version = pluginVersion
description = "content"
authors = listOf("content")
main = "main"
foliaSupported = false
apiVersion = "1.20"
}
When importing the plugin using id 'net.minecrell.plugin-yml.paper' version '0.6.0-SNAPSHOT'
(groovy) I get this error:
org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'net.minecrell.plugin-yml.paper', version: '0.6.0-SNAPSHOT'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'net.minecrell.plugin-yml.paper:net.minecrell.plugin-yml.paper.gradle.plugin:0.6.0-SNAPSHOT')
Searched in the following repositories:
Gradle Central Plugin Repository
maven(https://papermc.io/repo/repository/maven-public/)
https://docs.papermc.io/paper/dev/getting-started/paper-plugins
The format has changed, but you still use the old one (it changed even in the 1.19.4)
When trying to use the plugin-yml in combination with com.github.johnrengelman.shadow (often used to shadow dependencies into the jar) library dependencies are shadowed into the jar.
Library dependencies should be compileOnly in this context.
Could you please publish an update so I can use the fix for #20?
A problem occurred evaluating root project 'Hordes-1.8'.
> No signature of method: build_cs1dxgpbzjvnqu203tc6dv6un.bukkit() is applicable for argument types: (build_cs1dxgpbzjvnqu203tc6dv6un$_run_closure6) values: [build_cs1dxgpbzjvnqu203tc6dv6un$_run_closure6@4ad59117]
Possible solutions: wait(), wait(long), mkdir(java.lang.Object), uri(java.lang.Object), split(groovy.lang.Closure)
When I add depend = asList('WorldGuard', 'PlaceholderAPI')
to the bukkit task. been stuck on this for a bit. gradle version: 7.5.1
Add support for libraries
in a Spigot plugin description file.
Hey,
How am I'm supposed to create a bootloader for a plugin which will automatically load the dependencies from the 'paper-libraries.json'(? not sure if this name is correct, it is very poorly documented).
When using the 'paperLibrary(depencency)' keyword it will not load the dependency in the plugin.
Hi, I am unsure if this is an issue with the project or if I am just using it wrong. But I've tried it for 5 sessions now without success and I am a bit frustrated so I thought I would just ask.
I have 2 main questions:
I am using the libs.versions.toml for the dependency versions. I am using kSpigot to have better Kotlin support while developing my plugin. I have added it to my dependencies via library(), even tough I have configured paper to generate the libraries.json the dependency does not get downloaded and the plugin does not load because it is missing it. Is that because kSpigot changes something about how plugins are loaded or am I doing something wrong?
I have added the kotlin stdlib as a library() dependency but my compiled jar still contains "kotlin" and "kotlinx" and other kotlin related stuff. What am I doing wrong there?
Thx for your help!
Snippet from build.gradle.kts:
dependencies {
library(kotlin("stdlib"))
library(libs.adventureApi)
library(libs.adventureMiniMessage)
library(libs.kSpigot)
paperweight.paperDevBundle("1.20.1-R0.1-SNAPSHOT")
}
paper {
website = "Website.de"
version = pluginVersion
description = "..."
authors = listOf("Author1", "Author2")
main = "<My main class>"
foliaSupported = false
apiVersion = "1.20"
generateLibrariesJson = true
}
val repoUsername: String by project
val repoPassword: String by project
val langTestServerLocation: String by project
plugins {
alias(libs.plugins.kotlinJvm)
alias(libs.plugins.paperweight)
alias(libs.plugins.pluginYmlPaper)
alias(libs.plugins.shadow)
`maven-publish`
}
val serverTestVersion = setOf("1.20")
val pluginVersion = "1.1.0"
repositories {
mavenCentral()
maven {
url = uri("<my-repo>")
credentials {
username = repoUsername
password = repoPassword
}
}
maven("https://repo.cloudnetservice.eu/repository/releases/")
}
dependencies {
library(kotlin("stdlib"))
library(libs.adventureApi)
library(libs.adventureMiniMessage)
library(libs.kSpigot)
paperweight.paperDevBundle("1.20.1-R0.1-SNAPSHOT")
}
paper {
website = "Website.de"
version = pluginVersion
description = "..."
authors = listOf("Author1", "Author2")
main = "<My main class>"
foliaSupported = false
apiVersion = "1.20"
generateLibrariesJson = true
}
publishing {
repositories {
maven {
name = "repoPrivate"
url = uri("<my-repo>>")
credentials {
username = repoUsername
password = repoPassword
}
}
}
publications {
create<MavenPublication>("maven") {
groupId = "<class>"
artifactId = "<name>"
version = pluginVersion
from(components["java"])
}
}
}
tasks.jar {
val dependencies = configurations
.runtimeClasspath
.get()
.map(::zipTree)
from(dependencies)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
tasks {
build {
dependsOn(reobfJar)
}
compileJava {
options.encoding = "UTF-8"
options.release.set(17)
}
compileKotlin {
kotlinOptions.jvmTarget = "17"
}
}
tasks.register("deploy") {
group = "deploy"
description = "Deploys the plugin to the server"
dependsOn(tasks.shadowJar)
doLast {
for (serverTestVersion in serverTestVersion) {
val serverDirectory = File(langTestServerLocation, serverTestVersion)
val pluginDirectory = File(serverDirectory, "plugins")
val pluginFile = File(pluginDirectory, "${project.name}.jar")
if (pluginFile.exists()) {
pluginFile.delete()
}
pluginFile.createNewFile()
pluginFile.writeBytes(tasks.shadowJar.get().archiveFile.get().asFile.readBytes())
}
}
}
- Task `:generatePaperPluginDescription` of type `net.minecrell.pluginyml.GeneratePluginDescription`: invocation of 'Task.project' at execution time is unsupported.
Recently Paper introduced a new concept of Paper-exclusive plugins, and this brings with it a new file to declare those plugins, called paper-plugin.yml
It would be nice to add support for this file
When trying to use this plugin with configuration cache we have these issues, would be glad if you'll be able to add this compatibility
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':script-host:generateBukkitPluginDescription'.
> Cannot fingerprint input property 'librariesConfiguration': value 'configuration ':script-host:bukkitLibrary'' cannot be serialized.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Configuration cache problems found in this build.
3 problems were found storing the configuration cache, 2 of which seem unique.
- Task `:script-host:generateBukkitPluginDescription` of type `net.minecrell.pluginyml.GeneratePluginDescription`: cannot serialize object of type 'org.gradle.api.internal.artifacts.configurations.DefaultConfiguration', a subtype of 'org.gradle.api.artifacts.Configuration', as these are not supported with the configuration cache.
See https://docs.gradle.org/8.0.2/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:script-host:generateBukkitPluginDescription` of type `net.minecrell.pluginyml.GeneratePluginDescription`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.
See https://docs.gradle.org/8.0.2/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
See the complete report at [generated file](https://github.com/Minecrell/plugin-yml/files/11211022/configuration-cache-report.zip)
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
Configuration cache entry discarded with 3 problems.
please ❤️
The children of permissions are currently a List<String>
; the description files require a map between String
and Boolean
.
When trying to build my project, the following error occurs:
Execution failed for task ':generateBukkitPluginDescription'.
> Cannot fingerprint input property 'librariesConfiguration': value 'configuration ':bukkitLibrary'' cannot be serialized.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 11s
2 actionable tasks: 2 executed
my config:
bukkit {
main = "rocks.clanattack.impl.entry.Boot"
version = "0.0.0"
apiVersion = "1.20"
name = "ClanAttack Rocks (Core-API)"
authors = listOf("CheeseTastisch")
libraries = listOf(
"com.fasterxml.jackson.core:jackson-databind:2.15.2",
"com.fasterxml.jackson.module:jackson-module-kotlin:2.15.2",
"com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.15.2",
"org.jetbrains.kotlin:kotlin-reflect:1.7.22",
"org.reflections:reflections:0.9.12"
)
}
Hey!
Firstly, thank you very much for the Gradle plugin! This helps me a lot in my Projects!
Would it be possible to add the libraries feature to the plugin? (https://www.spigotmc.org/wiki/plugin-yml #libraries)
I need to use an external resource, but want Spigot to download and manage it, to keep the plugin small.
This would be a great improvement!
The version found at plugins.gradle.org is still 0.4.0. It does not contain support for libraries.
I would love to make use of this feature without having to add the plugin manually to the classpath.
Exported dependency coords do not include classifiers and extensions. This leads to some bugs, e.g. server trying to download jar
artifact for pom
dependency (with PluginLoader
implementation presented in README)
My personal workaround atm is exporting artifacts instead of dependencies, but you may not like it because of increased JSON file size.
apiVersion = "1.20" is resulting in the plugin.yml having: api-version: 1.20, which yml interprets as 1.2.
When I try to create a new command, then Gradle throws an exception and mentions something about "Command with name 'creategame' not found.". Here's the stacktrace: https://paste.wut.ee/avecocenoz.cs
I guess that something changed in Gradle API? 🤔
It works in 4.8 perfectly. I tried both 0.2.1 and 0.3.0 plugin versions.
I have this in my build.gradle.kts
:
bukkit {
name = "x"
description = "y"
authors = listOf("mikroskeem")
main = "z"
commands {
"creategame" {
description = "Creates a new game"
}
}
}
Current workaround is to use this:
bukkit {
// ...
commands.create("creategame") {
description = "Creates a new game"
}
}
Attempting to do this results in a java.lang.StackOverflowError
without any error message.
A basic configuration showcasing this issue is avalible here: https://github.com/Peter-Crawley/PluginYmlBug
When you enable generation of the libraries file, the file includes all repositories that you have set in the entire gradle project, this isn't a big issue but it causes server to keep looking around repositories.
Hello,
I don't quite understand why the api-version
field has to be set to at least 1.19
.
As far as I know this property was already present in 1.16 versions and I want to indicate that my plugin is compatible with any version since 1.16.
Am I missing something that explains this?
Cheers.
The README.md specifies the maven repository as "https://papermc.io/repo/repository/maven-public/"
The plugin is actually available at "https://plugins.gradle.org/m2/"
So whenever I add something to my plugin as a library, it works fine. However, there's one problem. It won't add them to the pom.xml used for publishing.
To reproduce:
generatePomFileForMavenPublication
taskIf you're interested, my build.gradle file is here: https://github.com/plexusorg/Plex/blob/master/build.gradle
You'll see that it won't add it to the pom.xml. Any idea if we can get a fix for this?
PS: this plugin doesn't work on Gradle 7.4+
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.