#build-tooling-help
1 messages · Page 4 of 1
how do i do that
are you using maven or gradle
gradle
https://imperceptiblethoughts.com/shadow/
hero. Gradle Shadow Plugin. The library author's dependency toolkit. User Guide →. John Engelman - @johnrengelman. API Docs.
val dirPaths: List<String> = listOf(
"E:\\USER\\APPLICATION\\50 I HOST\\JARS",
"E:\\USER\\APPLICATION\\50 I HOST\\MCHost\\servers\\Flag\\plugins"
)
var validPaths: List<String> = getTheDir()
tasks.register("copyToAll") {
doLast {
validPaths.forEach { dest ->
copy {
from(tasks.shadowJar.flatMap { it.archiveFile })
into(dest)
rename { "$jarName.jar" }
}
}
}
}
tasks.register("Build") {
group = "{ FLAG }"
description = "Builds the Flag Jar"
dependsOn(tasks.shadowJar, tasks.getByName("copyToAll"))
doLast { validPaths.forEach { path -> println("Built in: $path") }; println("Completed.") }
}
fun getTheDir(): List<String> {
var validPaths: List<String> = emptyList()
dirPaths.forEach { dir -> if (file(dir).exists()) validPaths = validPaths.plus(dir) }
return validPaths
}
im trying to move the jar to multiple paths after its finished building using shadowjar is there a better way then this? this kinda works but im curious if theres a better way🙏
The paths wont always exist so thats why i check if they exist ^
have copyToAll depend on shadowJar, delete the "Build" task, and log those messages in the copyForAll loop instead
also don't call the method to filter the dirs until you're actually in the doLast block, so it won't run for builds where the task isn't run
and as far as that method pretty sure you can just return dirPaths.map { file(it) }.filter { it.exists() }
oooh i see i see thanks for the help
i changed it as you suggested its a lot cleaner now :D
I have there these tasks:
tasks.register('createProperties') {
doLast {
def details = versionDetails()
new File("$buildDir/resources/main/version.properties").withWriter { w ->
Properties p = new Properties()
p['version'] = project.version.toString()
p['gitLastTag'] = details.lastTag
p['gitCommitDistance'] = details.commitDistance.toString()
p['gitHash'] = details.gitHash.toString()
p['gitHashFull'] = details.gitHashFull.toString() // full 40-character Git commit hash
p['gitBranchName'] = details.branchName // is null if the repository in detached HEAD mode
p['gitIsCleanTag'] = details.isCleanTag.toString()
p.store w, null
}
// copy needed, otherwise the bean VersionController can't load the file at startup when running complete-app tests.
copy {
from "$buildDir/resources/main/version.properties"
into "bin/main/"
}
}
}
classes {
dependsOn createProperties
}
(versionDetails() is from gradle plugin id 'com.palantir.git-version' version '3.0.0')
How to make it run only on shadowJar/build? Because jitpack is screaming error at me
* What went wrong:
Execution failed for task ':createProperties'.
> java.io.FileNotFoundException: /home/jitpack/build/build/resources/main/version.properties (No such file or directory)
Can be found at https://jitpack.io/com/github/ExperiencePowered/StaffProtect/d7606a04ea/build.log
I mean
you made the classes task depend on that task
if you want that task to only run when shadowJar is run, then you'd make it depend on shadowJar
okay thanks
From the paperweight-userdev test plugin:
dependencies {
paperweight.paperDevBundle("1.20.1-R0.1-SNAPSHOT")
// paperweight.foliaDevBundle("1.20.1-R0.1-SNAPSHOT")
// paperweight.devBundle("com.example.paperfork", "1.20.1-R0.1-SNAPSHOT")
}
Can you depend on another project in a gradle multi-project setup?
what?
I have a monorepo which contains both my plugin and my custom paper fork
Basically, no
paperweight expects to ingest a dev bundle which is designed to be published
So, I have to build my fork, publish it to a repo and then use it in paperdev?
you could depend on the -server project if you're gonna run mojmap
but, otherwise, we expect published dev bundles, and I doubt that there is much of a way around that which isn't "deal with it yourself"
That unfortunately breaks many nms-dependent plugins
Anyone got an idea why I get this error? https://paste.helpch.at/uquyugifos.php
Compilation failure
Yes... I know, but it doesn't explain what actually is wrong
I'm not used to maven, just gradle, so not sure how to troubleshoot it
An old project from someone else
There's nothing, other than the error I sent
it might be in a different menu
Wdym?
Nothing there
This?
yeah so click on the different red menu items on the left
and then scroll in the window on the right
where the error is
probably if you click the bottom one "Compilation failure" you'll see something on the right
i wonder why tf you have a .iml if this is a maven project
Other than the error I sent
Not sure honestly
I might just convert it to gradle tbh
Maven is so bad imo
did you really scroll the entire output?
otherwise if you have the time and patience sure go ahead
Yes, only noticeable thing was a ton of [DEBUG] Stale source detected: and [INFO] Changes detected - recompiling the module! once
have you tried cleaning and trying again?
Yup
yeah idk män
Aight np, I'll just try and convert it ig
but this is also fishy
.iml is for intellij build system
which you shouldnt be using if its a maven or gradle project
Any idea why this doesn't work? compileOnly(files("AdvancedEnchantments:8.7.4.jar"))
Error: Cannot convert URL 'AdvancedEnchantments:8.7.4.jar' to a file.
because it expects a file name, not whatever you tried to do there
what's with this error? trying to add shadow plugin to my auto generated gradle project (gradle init) from maven
nvm think its a kotlin thing
using kotlin to generate the project means shadow plugin uses different syntax
Some stuff still only documents the groovy syntax
but most folk here kind moved away from groovy as it's a lot more, how to say, fragile
exact same as with groovy, just marginally different syntax, but these days you use the plugins block rather than buildscripts
advice in part is to look at other projects
like this maybe?
i couldn't find any using kotlin
I need to figure out how to relocate it too
or how to even run this task in the first place (i think gradlew shadowJar maybe?)
and how to copy the built jar to the plugins dir
tasks {
named<ShadowJar>("shadowJar") {
dependencies {
include("de.tr7zw:item-nbt-api-plugin:2.11.3")
}
relocate("de.tr7zw", "thirdparty")
}
}```
where does it build to by default so i can copy the file back out ?
I found some plugins using the kotlin build file but they all seem very different and complicated, they must be usin their own custom stuff
basically I want my gradle project to act the same, which is
- shade nbt api
- apache commons io is also a dependency, same with lombok (idk if it needs to be shaded but i did that previously)
- build and move the final jar into "E:\MINECRAFT TEST SERVER\plugins"
you'd run the shadowJar task directly, or basically tell assemble to depend on that task
you can also add a task to copy the final jar to somewhere
I'm asking chatgpt to write that copy task for me, then I'll make sure assemble depends on shadow
then, I use assemble to make my plugin
I fixed it! Got it all working
now I've fully moved over to gradle, how can I remove the maven project and have everything nicely set up for idea?
you should just be able to delete the pom files
I've generally had better luck in just deleting the .iml file and .idea folder, but it shouldn't technically be needed
ofc, thats where your project settigns exist, so...
jesus christ gradle is SO MUCH FASTER
I knew it would be faster but sweet lord it's instant
Every day I have to delete my papermc folder in m2 for maven so that it can resolve dependency.
I run 'clean install -U' and it doesnt force an update or something, Is their anything else I could try?
"resolve dependency" - er?
does anyone know why for when i run the command "java -jar BuildTools.jar" in git bash nothing happens and i get no output?
We don't provide support for spigots software
I found that changing lombok to be a compileOnly was the right call
Is this the most optimal way of copying the output jar?
register<Copy>("buildVald") {
dependsOn(shadowJar)
from(shadowJar)
into("C:\\Users\\Valdemar\\Desktop\\mc\\Advancius\\builds")
}
Idk if it's the most optimal way but there's a destionationDirectory field in the jar task (also in shadowJar task because of it)
So you could do ```kt
destinationDirectory = file("${System.getProperty("user.home")}\Desktop\mc\Advancius\builds")
Ahhh yeah, I could also base it of a propery in gradle.properties maybe
The path I mean
How you deal with the path string is up to you
Is gradle.properties generally ignore from git?
Because I'm creating a build task so different users can have different destination directories
I'm not sure, but you can just remove the part in your .gitignore that ignores the gradle.properties file if you want to keep it
The gitignore created by the minecraft dev plugin doesn't seem to include gradle.properties
Alright
I mean, because properties are generally shared with the project
You can also set properties in ~/.gradle/gradle.properties. but that's global and can modify/conflict with other projects
How do I get the properties from that file, is it also just the same method?
it's all injected in the exact same
w/ paperweight
looks like gradle doesnt even finish parsing. try running ./gradlew build in terminal (or gradlew.bat build on windows)
also maybe try renaming your project to not have "." in the name?
this is not a problem, my developer is getting it to run. Only I didn't, and I've already reloaded gradle, reinstalled, cleared cache... Only with the paperweight that doesn't compile
I mean, not much beyond, run with --info and provide the logs
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
Ehhh, what java version are you running ?
17
mb that was in the log 
what have they done with hastebin
yep 💀
how much memory do you have left ?
I have not encountered the error, no idea what causes it
also try doing it directly on G:
stack overflow suggests it might be memory missing
16gb
that should be plenty 
do you have wsl installed?
no, i think
by going to the top of the drive
yep, if I disable paperweight its ok
yes, 3 times
which one ? both the project local and system wide one ?
local and system (project and user/.gradle)
pretty out of ideas then, sorry. Is your developer also using the wrapper or are they using their local gradle install ?
could always certUtil -hashfile gradle\wrapper\gradle-wrapper.jar SHA256 to make sure your wrapper jar is intact
he's using the same repository as me so I guess it's the same thing
not exactly
this?
sometimes people end up using their systems installed version of gradle instead of the local wrapper
how can i know this? I need to fix this error ASAP... should I install gradle on my machine?
we are all using the same commands, but apparently only on my machine it is giving this problem
I don't deal with windows
some google suggestions suggest stopping the gradle daemon
some even suggest toasting the users .gradle if you have nothing in there that you care about
I've tried everything possible from google, clear cache, stop the daemon, I've already deleted the project and cloned it again
(can maybe just yeet the .gradle/whatever it was that had the gradle dists in
Can anyone send a good gradle beginner guide?
wdym with gradle beginner guide
They probably want to start using Gradle. So they ask if there is anything useful to help you with it.
@frozen berry A couple weeks ago, you posted a link to your repo to help with some Gradle configuring. I wanted to thank you again, I finally got a chance to revisit the problem, and your reference helped me in figuring out what I had done wrong.
Glad I could help 😄
So wholesome 😭😭😭
how do i convert from groovy projectile to kts
and set kts as default in the future
and set default gradle to 8.3
there is no "convert"
you'd basically need to rename the file and modify it so that it conforms to the correct syntax
you don't, basically
whenver i create a project
idk if theres maybe an environment variable to do it, but, you can specify the version and such on the cli when you create a project from there
how are you creating the project
idk about IJs UI, probs not in there outside of being able to set the buildscript lang when you create it
can’t change it to kts
not sure about version
or well you can change, but not set the default
how do you normally create a project?
why does it pick 8.1.1 tho
yea, that stuff doesn't support that, idk if it's on their todo list or not, etc
how should i create a project
because it hasnt been updated to use a newer version
you can either do it that way and upgrade the files
(like use the versions from the userdev test plugin)
but it would still give me groovy
because their templates are groovy
best you can do is just create a project manually
as said, idk if it's on their todo list or not
how do you create a project?
depends on how much I care
for the most part IJs wizard to create a gradle project is fine
otherwise you can do it on the CLI and then open it in IJ
what do you need to add for a gradle project?
gradle installed
do you need to make a resources/plugin.yml etc?
yeah
what more
and for the buildscript to copy it in etc
if you create a raw gradle project, you'll need to set all of the regular stuff up manually
i.e. adding the paper repo/dependency stuff, creating the metadata file and the main class
hm or do i convert groovy to kts
do i neeed to change all .gradle files to .gradle.kts
and replace '' with ""
if you want to use kotlin dsl yes
whats more?
plugins {
id("java")
id("io.papermc.paperweight.userdev") version "1.5.6-SNAPSHOT" // the latest version can be found on the Gradle Plugin Portal
}
group = "org.lividx"
version = "1.0"
repositories {
mavenCentral()
maven {
name = "papermc-repo"
url = "https://repo.papermc.io/repository/maven-public/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/groups/public/"
}
}
dependencies {
compileOnly "io.papermc.paper:paper-api:1.20-R0.1-SNAPSHOT"
paperweight.paperDevBundle("1.20.1-R0.1-SNAPSHOT")
}
def targetJavaVersion = 17
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}
tasks.withType(JavaCompile).configureEach {
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release = targetJavaVersion
}
}
tasks.assemble {
dependsOn(reobfJar)
}
processResources {
def props = [version: version]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('plugin.yml') {
expand props
}
}
e: file:///C:/Users/Username/IdeaProjects/TestPlugin/build.gradle.kts:22:17: Unexpected tokens (use ';' to separate expressions on the same line)
Another oddball question: Let's say I create a plugin that has at least one reference to an NMS class. This jar runs as an independent plugin, but also provides functionality as a dependency for other plugins. The output jar would get remapped to run on a paper server, but when implementing this plugin as a dependency in another, the obfuscation will still in place. Does the paperdev bundle provide any means for deobfuscating additional libraries with NMS code, or do I need to output two different jars, one that runs reobf and one that does not?
No, deobufscation of libraries would be gross as all heck
not to mention, the answer is simple, either you ensure that the nms stuff isn't exposed in the api artifact you publish
exposing nms stuff would pretty much be a sucky violation of exposing useful API
but, if you needed to, then you'd need consumers of your library to have userdev, in which case, you'd just publish the mojmap'd artifacts to a maven repo (i.e. the dev classifed jars that userdev already sets up as the outputs)
Hey! When adding the shadow plugin to my paperweight project I get the following gradle error, are they not compatible?
class io.papermc.paperweight.userdev.internal.setup.UserdevSetup$Inject cannot be cast to class io.papermc.paperweight.userdev.internal.setup.UserdevSetup (io.papermc.paperweight.userdev.internal.setup.UserdevSetup$Inject is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @6f8c5ec2; io.papermc.paperweight.userdev.internal.setup.UserdevSetup is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @1a744dc3) class io.papermc.paperweight.userdev.internal.setup.UserdevSetup$Inject cannot be cast to class io.papermc.paperweight.userdev.internal.setup.UserdevSetup (io.papermc.paperweight.userdev.internal.setup.UserdevSetup$Inject is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @6f8c5ec2; io.papermc.paperweight.userdev.internal.setup.UserdevSetup is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @1a744dc3)
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'java'
id("io.papermc.paperweight.userdev") version "1.5.5"
}
group = 'com.diverge'
version = '1.0.0'
repositories {
mavenCentral()
maven {
name = "papermc-repo"
url = "https://repo.papermc.io/repository/maven-public/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/groups/public/"
}
maven {
name = "nexus"
url = "https://mvn.lumine.io/repository/maven-public/"
}
maven { url "https://repo.dmulloy2.net/repository/public/" }
}
dependencies {
implementation 'org.mongodb:mongodb-driver-sync:4.10.2'
implementation "net.kyori:adventure-text-minimessage:4.14.0"
implementation "net.kyori:adventure-text-serializer-legacy:4.14.0"
compileOnly 'com.ticxo.modelengine:api:R3.1.8'
compileOnly 'net.luckperms:api:5.4'
compileOnly 'com.comphenix.protocol:ProtocolLib:5.1.0'
compileOnly 'org.projectlombok:lombok:1.18.28'
annotationProcessor 'org.projectlombok:lombok:1.18.28'
paperweight.paperDevBundle("1.20.1-R0.1-SNAPSHOT")
implementation project(":diverge-api")
}
def targetJavaVersion = 17
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}
tasks.withType(JavaCompile).configureEach {
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release = targetJavaVersion
}
}
tasks.assemble {
dependsOn(reobfJar)
}```
use a code block
Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to d...
see the note in the test plugin readme about multi project
Ok, that's what I thought, thanks. My atrocities are limited to an internal backend tool shared between a few projects, nothing public facing so-to-speak
Hi all, im currently getting a couple of issues when executing :generateDevelopmentBundle from the patcher. We have just updated our project from 1.19.4 to 1.20.1 and it no longer builds correctly. I get the following: (project name has been replaced by example)
What went wrong:
Could not determine the dependencies of task ':generateDevelopmentBundle'.
> Could not resolve all task dependencies for configuration ':serverRuntimeClasspath'.
> Could not resolve project :example-server.
Required by:
project :
> Failed to read upstream data.
``` It worked fine on 1.19.4 but has not worked for 1.20.1
Provide build file?
Failed to apply patches?
It builds ok and apply patches seams to work fine, I'll send the build script and properties later
so im experimenting with some nms while in the main paper repo: what does it mean when certain source files arnt in paper-server, but are in gradle caches (and thats where go-to-source takes me
.gradle/caches/paperweight/mc-dev-sources/net/minecraft/server/packs/repository/ServerPacksSource.java
only files touched by paper/spigot get added
right. say i wanted to make a patch to an untouched file, how would i start?
ah i didn open that file, just didnt scroll down enough, sorry
I'm unsure what I'm doing wrong here, I'm trying to separate my SQL code in to a separate common library that is hosted on Jitpack but when I pull my library down in StomKor, the SQLWrapper class doesn't seam to exist, would anyone have a clue why?
On compile, or when running on the server?
facker
In IntelliJ auto imports/IntelliSense in imports. This is a Minestom project fyi but the concepts should stay the same
does it work without an external repo and just installing into your local one?
because jitpack is weird sometimes
Does it work on compile? If it does, then it's an intellij issue - try invalidating caches, reloading the maven project, etc.
Can you set the paperweight artifact name?
It's RemapJar task (reobfJar closure) inherits setBaseName(), but that's deprecated and the shadowJar config obv. doesn't work for paperweight
something like archiveFileName?
atleast iirc thats the one shadow uses now
I know that shadow uses it but paperweight doesn't seem to have it

hmmm must've overlooked that
creates an extra JAR file but seems to work
if you get more jar files than before by changing the name that means your setup was broken before and had outputs overwriting each other
i have this code to set my language level:
var targetJavaVersion = 17
java {
val javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion.set(JavaLanguageVersion.of(targetJavaVersion))
}
withSourcesJar()
}
this should yet compilation still fails with (use -source 16 or higher to enable pattern matching in instanceof)
Only use the toolchain.
pretty sure i got all that
its my javadoc plugin failing btw idk if that helps
the rest seems to work fine
just the javadoc plugin is still under the impression that im using --release '8'
send your full build.gradle
its quite alot but here
root: https://pastebin.com/fe2s76id
plugin module: https://pastebin.com/iFFBrwKJ
it fail when making the javadocs btw
the rest seems to compile fine
check your java build version
also try w/o that lombok plugin
u mean this?
the gradle model auto sets language level to 8 btw
that aint me
rootProject.name = "HopperLevels"
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version("0.5.0")
}
include(":plugin")
include(":common")
include(":v1_19")
project(":v1_19").projectDir = file("nms/v1_19")
same result but slightly different paths in error
and the toolchain as well
where else should it be set
shoulnt gradle grab it from the toolchain? i though that was its purpose
I mean, the toolchain is the toolchain
or, wait, er
I mean, I have no idea, it's clearly upset that the source level is set to 8 for some reason
i'd just maybe see if you can set it on the javadoc task manually 
i tried looking at that but cant rlly find a way to do so on that task
if you're using indra set the target java with that
really you shouldn't be using indra if you can't be bothered to read it's docs or know gradle basics
it's conventions for kyori projects, any other use is a nice side effect
well that indeed fixed it. you make a good point though i probably shouln't be using it 
anyways, thanks so much
Yep, you’re right. I just left it for a few days and came back to it. Now it works
https://github.com/gradle/gradle/issues/24991
has anyone ran into this issue? been fighting it all day. going to try different gradle versions
basically the lock files dont get deleted so i have to manually close intellij, delete lock file, then open it in order to import a project that uses gradle
updating to 8.3 fixed it
did not fix it i am still having stuff get locked and not automatically deleted. gradle plz. trying progressively older gradle versions until it goes away
windows?
windows 11
tried adding it to the AV exclusions?
i clicked the little popup that happened when i imported the project. i also turned off real time protection but i guess it turned itself back on
lemme try that
yeah its building now. frustrating
part of the issue I'd imagine is that gradle probably doesn't really handle platform oddities, and so there are potential cases where you get like a parallel task which tries to do stuff in there which can cause issues, ik git has had issue with AV software basically causing stupid issues like delaying files from unlocking, etc
the entire thing is generally just kinda fragile, ngl
thankfully my antivirus protects me from building projects with gradle. thanks cat
assuming this is windows defender, turning it offis a PITA and gets worse every windows version
yes it is, only seemed to begin having this problem upon upgrading to w11. now i know how to avoid it
in theory you should just be able to tell it to ignore stuff like the .gradle folder
but, idk, as much as I hate myself, I don't do dev stuff on windows
i hate myself enough to do it. yeah there is an exclussion that i'll add to it and see how it goes becauses windows defender will just turn itself back on
1.20.1 is the paper 1.20.1 version
Could forks be broken with 1.5.6 paperweight?
% ./gradlew applyPatches
> Task :paper:applyServerPatches
error: Your local changes to the following files would be overwritten by merge:
src/main/java/net/minecraft/core/dispenser/DefaultDispenseItemBehavior.java
Please commit your changes or stash them before you merge.
and its a different file every time I run ./gradlew applyPatches
Tried clean'd, cleanCache, and deleted api/server directories.
EDIT: Nevermind, don't move the directory to iCloud Drive
@idle jacinth dev bundle gen requires gnu diff
and probably won't work on windows even with it
so yes use wsl
Yeah 1.5.6 patcher is broken
applyPatches works for me in 1.5.6 but createReobfPaperclipJar has dependency issues. Let's see if it get fixed till the ed of month.
what?
I mean, it's not gonna get fixed automatically
Sure, hopefully someone is addressing the issue till EOM.
The fact that I am trying to replicate this and get clapped at Reason: Task ':forktest-server:compileLog4jPluginsJava' uses this output of task ':clonePaperRepo' without declaring an explicit or implicit dependency. for createReobfPaperclipJar

Well, that's also a valid replication ^^

That's the error I had. 👍
I can't wait for the day when our tooling becomes more simple again
Yea we are all suffering 

yeah, its something in pw 1.5.6, but idk what it is. not really a gradle whiz
so I still have the issue with lock files not being cleaned up when building with gradle. i have the entire directory in my exclusions as well as the project directory. the only way i can get around this is by disabling windows defender, but it turns itself back on after about a week. anyone dealt with and resolved this?
it's not even reliably resolved by disabling windows defender, so i don't really know what the cause could be
are apiCoordinates and mojangApiCoordinates generated by paperweight locally, or downloaded from the repo?
(for paperweight dev bundle, for userdev)
if you are on Windows 11, try a dev drive.
Ran gradle init on my maven project, did some minor changes and it seems to be throwing a weird error now
It's still only in dev circle, no?
The whole file https://pastecord.com/jexarodura.mk
try restarting intellij and building via cli
How do you build via cli... this is from me reloading gradle btw
On restarting ij, its the same error
I mean... the error makes no sense its right there in the screenshot that there is a parenthesis there
Line 12 misses a closing bracket
Well, not really
The compiler can't possibly know where you want to close
(else we wouldn't need brackets)
Yeah true ig
So it tells you where the first unexpected thing happened and you gotta trace back
not really sure if this belongs here, just asking for a mate. Is there a way to make your servers multiplayer? He's a streamer and would like to have me on but i'm unable to figure out a way to join (fanks xx)
you will need to forward your ports in your router and stuff if you host at home
but if its a public server you prolly should do that
join that channel and explain your problem and people will help
am I able to invite my friend to the server and have him sit in aswell?
sure!
Please send large files/logs to a pastebin
A sensible, modern pastebin. Share text and source code snippets with no hassle.
Please send large files/logs to a pastebin
A sensible, modern pastebin. Share text and source code snippets with no hassle.
Please send large files/logs to a pastebin
A sensible, modern pastebin. Share text and source code snippets with no hassle.
click the elephant
dw I already fixe everything
except
the reobfJar
I don't get where I'm supposed to get that
the wiki says the shadow plugin
but I already have that
fixed
lastlyu
how do I know if my jar is obfuscated?
by not using the jar that ends with -dev
alr thanks
how about -dev-all?
just use the one with no -dev
right?
dev-all is still a dev jar.
FAILURE: Build failed with an exception.
- What went wrong:
A problem was found with the configuration of task ':forktest-server:compileLog4jPluginsJava' (type 'JavaCompile').-
Gradle detected a problem with the following location: 'C:\Users\steli\IdeaProjects\paper-1.20.1.gradle\caches\paperweight\upstreams\paper.gradle\caches\paperweight\taskCache\minecraft.jar'.
Reason: Task ':forktest-server:compileLog4jPluginsJava' uses this output of task ':clonePaperRepo' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
Possible solutions:
- Declare task ':clonePaperRepo' as an input of ':forktest-server:compileLog4jPluginsJava'.
- Declare an explicit dependency on ':clonePaperRepo' from ':forktest-server:compileLog4jPluginsJava' using Task#dependsOn.
- Declare an explicit dependency on ':clonePaperRepo' from ':forktest-server:compileLog4jPluginsJava' using Task#mustRunAfter.
-
i updated paperweight from 1.4.0 to 1.5.6 and i now get this error
already known. #build-tooling-help message
well who broke it >:|
Basically, use 1.5.5 and jump back a few paper refs or basically you'd need to revert the change which requires that
I mean, basically, either .6 somehow broke it in a weird manner
or, it already existed and somehow became more likely to fire
afaik they're more betting on the latter; welcome to the joys of tooling doing horrible, horrible things
well i suppose it'll get a lot more attention and quick once 1.20.2 drops
well since nobody with a fork can update paper
I mean, it's on the todo list
It's just literally anything typical of open source efforts, nobody is able to sit around for hours tryna work out how it's gone sideways and to patch it
PRs welcome, etc
Sure, I just figure whoever updated paperweight to .6 is probably the person to know the most about what's going on
well I can't build either with 1.5.5 or any other version
They already looked over it, basically; they have theories on what borked it, but, yea...
send error
Script compilation errors:
Line 210: classpath(tasks.filterProjectDir.flatMap { it.outputJar })
^ Unresolved reference: filterProjectDir
Line 210: classpath(tasks.filterProjectDir.flatMap { it.outputJar })
^ Unresolved reference: it
2 errors```
or if in IJ just revert that gradle build file to before
and go back to before this commit i think https://github.com/PaperMC/Paper/commit/eb60bffa98aa21591b81007ff913674a0e5bf858
nah, it's probs because they updated PW and still have an old dangling set of configs around as the base
cleanCache probably too
already have like 3 times 😫
did you delete the API and Server folder?
have you updated the paper ref to something recent?
yes to both
Okay, and so what's the output of applyPatches?
patches are applied just fine, that error pops up after i run createReobfBundlerJar
also here's the paper ref i'm using: 1b1c23010ac55e610e3a36f4e5b93a8198cff69c
yeah you need to rollback to probably about 29d1c7b60244bb002d29a5dcfc9c995019f550ab
e: file:///C:/Users/steli/IdeaProjects/paper-1.20.1/forktest-server/build.gradle.kts:210:21: Unresolved reference: filterProjectDir
e: file:///C:/Users/steli/IdeaProjects/paper-1.20.1/forktest-server/build.gradle.kts:210:48: Unresolved reference: it
still broken
make sure you're not using paperweight 1.5.6
use 1.5.5
well your shit is megabroke then :/
Machine already looked and didn't understand it
It's Gradle magic
check the differences between your fork's various build.gradle.kt files vs paper's
// In general, keep this version in sync with upstream. Sometimes a newer version than upstream might work, but an older version is extremely likely to break.
id("io.papermc.paperweight.patcher") version "1.5.5"```
none
i haven't touched this fork at all yet
just can't build it
have you done a cleanCache?
i've invalidated caches numerous times, and quite funnily the same error pops up now with any gradle command
that is not what cleanCache is
./gradlew cleanCache
run that, then applyPatches then try your reobf
Also I was wrong about this, you need evaluate against NOT paper's latest (that's what's broke), evaluate against the version of it at/before the commit hash version you're using
Welp, slow because macbook air
updated gradle
updated the paper ref to the one cryptite showed
updated pw to 1.5.5
updated the patch so that it would apply, and it's currently compiling
I mean, tldr, https://github.com/PaperMC/paperweight/pull/198 fucks it 
prior we just guessed that its there, which worked well enough but obviously wasn't correct
Why the configurations that now have a proper Provider as a dependency don't properly define that as a dependency on the getPaperUPstream task, I have no idea
So, I switched to paperweight.paperDevBundle("1.20.1-R0.1-SNAPSHOT") as my dependency for Paper recently. Since then, I am getting three .jar files everytime I build the plugin.
I get:
<plugin-name>-<version>.jar<plugin-name>-<version>-dev.jar<plugin-name>-version>-dev-all.jar
Since the second option is the smallest, I assume this is just the plugin without any shaded dependencies.
As for the other two, I have no idea what these are since they appear to contain the same content when opening them but the -dev-all.jar version is about 100 KB smaller than just the .jar.
Is anyone able to clarify for me if it's intentional that I get three builds and what the difference between the first and third version is?
the -dev ones are mojang mapped ones (not remapped)
the top one is the one you want to use
the 2nd one is not remapped and not shaded
3rd is a fat jar without remapping
1st fat jar remapped
Context: #velocity-dev message
After I changed something in the @Plugin Annotation, the build fails with this exception:
https://gist.github.com/notstevy/3c2ce255832df9d03a3b2b9c67d6a2e4
I mean, that screams that ther eis a bug in the kotlin stuff
first google result
Is there documentation on how to build folia from source?
#folia-help and see the pins
The documentation page for the development guid is just empty https://docs.papermc.io/folia/dev
apparently that's not pinned, anyway see Paper's README and do the same on Folia's repo
Yeah using the papermc commands worked. Thanks!
does paper want a pr for mache updating to 1.20.2, or is it too manual (since you need to create a branch on github to pr to it)
i could pr against 1.20.2-pre2 and change base once the branch is made
We need to create a branch, etc
ill create the pr, it can be changed / closed as you want
Don't, since we are experimenting with VF 1.10 and your work will be useless
We already have rc2 which is code wise the same
Could someone explain the difference between implementation and shadow in gradle?
I was previously using shadow but was suggested to use implementation but don't quite understand how to make use of it (if i should be using it)
I am using the shadowJar task and am using the jar that is output to my plugin folder:
shadowJar {
relocate("space.arim", "me.dave.activityrewarder.libraries.paperlib")
relocate("com.github.CoolDCB", "me.dave.activityrewarder.libraries.chatcolor")
minimize()
configurations = listOf(project.configurations.shadow.get())
val folder = System.getenv("pluginFolder_1-20")
if (folder != null) destinationDirectory.set(file(folder))
archiveFileName.set("${project.name}-${project.version}.jar")
}
Appears like when moving to implementation that the destinationDirectory is no longer the correct jar though?
I mean
piss in the wind
but
- maybe the configurations, but i thought shadow would derive from implementation
- minimize is sometimes evil
piss in the wind? lol
ahh i can give that a go
is it best to avoid?
generally yes
maven shadows minimize jar is at least a bit more smart than shadows
I tried switching out configurations.shadow.. to .implementation but didn't have much luck should I be doing something else regarding that?
I mean removing that line in general and seeing what it picks up
The file is now 0kb LOL
Take a break I'm sure someone else will have some input!
remove the destination sir and try again
with or without configurations = listOf(project.configurations.shadow.get())?
without
I did that and it outputted a 75,000 kb jar in my build/libs, do i also need to change the first line of this?
java {
configurations.shadow.get().dependencies.remove(dependencies.gradleApi())
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
gotcha
removed that and it's still 75,000 kb
plugins {
java
`kotlin-dsl`
`maven-publish`
id("com.github.johnrengelman.shadow") version("7.1.2")
}
group = "me.dave"
version = "2.0.3-BETA"
repositories {
mavenCentral()
mavenLocal()
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/") }
maven { url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") }
maven { url = uri("https://mvn-repo.arim.space/lesser-gpl3/") }
maven { url = uri("https://repo.extendedclip.com/content/repositories/placeholderapi/")}
maven { url = uri("https://repo.dmulloy2.net/repository/public/") }
maven { url = uri("https://jitpack.io") }
}
dependencies {
compileOnly("org.spigotmc:spigot:1.20-R0.1-SNAPSHOT")
compileOnly("org.geysermc.floodgate:api:2.0-SNAPSHOT")
compileOnly("me.clip:placeholderapi:2.11.2")
implementation("space.arim.morepaperlib:morepaperlib:0.4.2")
implementation(files("libs/EnchantedStorage-2.0.0.jar"))
implementation("com.github.CoolDCB:ChatColorHandler:v2.1.4")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
tasks {
withType<JavaCompile> {
options.encoding = "UTF-8"
}
shadowJar {
relocate("space.arim", "me.dave.activityrewarder.libraries.paperlib")
relocate("com.github.CoolDCB", "me.dave.activityrewarder.libraries.chatcolor")
archiveFileName.set("${project.name}-${project.version}.jar")
}
processResources{
expand(project.properties)
inputs.property("version", rootProject.version)
filesMatching("plugin.yml") {
expand("version" to rootProject.version)
}
}
}
This is what I currently have
It previously came to about 198kb
EnchantedStorage is what handles my data storage
can you check what’s in the enchanted storage one
since it shouldn’t include gradle either
yeah it's just 2 classes an IOHandler and a Storage interface
weird
i'm just messing around with adding/removing lines to see what changes now
could it be the version of shadow i am using?
hmm not having much luck
try grabbing a dependency tree? with the jar file in hand you can also probably just rename it from .jar to .zip and check directory sizes?
(i think? winrar will show directory sizes if you open the jar with that too but its been a while)
yeahh i was having a look, the biggest thing i saw was gradle
previously was removing it with the first line of this
i just updated to gradle 8 and i think it might've fixed it?
you shouldn't have to be removing it in the first place lol
clean and rebuild and hope?
what task are you using to build
shadowJar
can you send your build script again
plugins {
java
`kotlin-dsl`
`maven-publish`
id("com.github.johnrengelman.shadow") version("8.1.1")
}
group = "me.dave"
version = "2.0.3-BETA"
repositories {
mavenCentral()
mavenLocal()
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/") }
maven { url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") }
maven { url = uri("https://mvn-repo.arim.space/lesser-gpl3/") }
maven { url = uri("https://repo.extendedclip.com/content/repositories/placeholderapi/")}
maven { url = uri("https://repo.dmulloy2.net/repository/public/") }
maven { url = uri("https://jitpack.io") }
}
dependencies {
compileOnly("org.spigotmc:spigot:1.20-R0.1-SNAPSHOT")
compileOnly("org.geysermc.floodgate:api:2.0-SNAPSHOT")
compileOnly("me.clip:placeholderapi:2.11.2")
implementation("space.arim.morepaperlib:morepaperlib:0.4.2")
implementation(files("libs/EnchantedStorage-2.0.0.jar"))
implementation("com.github.CoolDCB:ChatColorHandler:v2.1.4")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
tasks {
withType<JavaCompile> {
options.encoding = "UTF-8"
}
shadowJar {
relocate("space.arim", "me.dave.activityrewarder.libraries.paperlib")
relocate("org.enchantedskies", "me.dave.activityrewarder.libraries.enchantedskies")
relocate("me.dave.chatcolorhandler", "me.dave.activityrewarder.libraries.chatcolor")
}
processResources{
expand(project.properties)
inputs.property("version", rootProject.version)
filesMatching("plugin.yml") {
expand("version" to rootProject.version)
}
}
}
any thoughts? 😅
are you building with ./gradlew shadowJar and using the -all jar?
I am building with shadowJar yep but am not using the -all jar
-all is the one with everything shaded
that one is currently building at 79000 kb when the final build should be 200kb max
Yeahh we were talking about that one earlier but it resolved at one point, it's got pretty much everything in it, gradle and a ton of libs that are packaged within spigot
run ./gradlew dependencies and check the dependency tree of implementation
you might need to exclude some transitive deps
which part of the output is the part I should be paying notice to
the tree for implementation
implementation - Implementation only dependencies for compilation 'main' (target (jvm)). (n)
+--- space.arim.morepaperlib:morepaperlib:0.4.2 (n)
+--- unspecified (n)
\--- com.github.CoolDCB:ChatColorHandler:v2.1.4 (n)
check runtimeClasspath too
runtimeClasspath - Runtime classpath of compilation 'main' (target (jvm)).
+--- space.arim.morepaperlib:morepaperlib:0.4.2
\--- com.github.CoolDCB:ChatColorHandler:v2.1.4
\--- org.jetbrains:annotations:23.0.0
it all appears correct
that seems more like it :o
let me have a peak
yeah that seems to have sorted it!
thank you!
that plugin is for writing gradle plugins
adds a bunch of stuff to the class path for that
not sure why it didn’t show in dependencies
i seeee
i honestly had no clue - when i initially started using gradle my friend sent me a build script to start off with and hadn't really had any issues until trying to change stuff
do i need to package jetbrains/intellij annotations in the jar or is that something i can exclude
it depends if you need to read the annotations at runtime
but also I think paper includes it anyways
That Screenshot is useless, lol
shit
giood point
I should stop being lazy
It does run the reobf task
But I get this
sentry logs
Also, do you actually run the reobfusctated jar?
if you click on the images, Dumcord uncrops it. Dumcord's gallery implementation sucks.
ServerPlayer player = ((CraftPlayer)p).getHandle();
Thats what that line looks like in the compiled ver
That's not the obfuscated jar then
This ismy build.gradle.kts
and then I include it like this
implementation(project(":paper:nms:nms-core"))
implementation(project(":paper:nms:nms-v1_20_R1"))
What does build in the 1.20 folder produce?
I would guess you depend on the wrong jar or something of the subproject
Its producing this
So I am kind of lost
I'm not sure why its not reObuscating when it does say it is running that task
even when I just run the build task I just get the unobuscated version even if it says
I even tried with this as my gradle and it produces the same output
Your lib folder has multiple jars, no?
Is there any way to remove it from a specicic project? Its applied to every sub project
Why do you apply to to every subproject?
Surely you only want it on core
Not on the impl modules
you raise a good point man
is there any way to temp remove shadowjar from this sub module while I wait for my team to get back to me
Just remove it from all and only add it where needed, lol
I've done that but unfortunate I face the same issue
Actually after looking further it is getting obuscated
nut maybe not obuscating the handle thing? Im not sure whats going on with that
By the way, you should upgrade to MorePaperLib 0.4.3; when Paper transplanted the Folia APIs to itself, we had to update the Folia API detection.
any gradle pros in the chat? can I run tasks in afterEvaluate?
(I have a task that produces a file as output and I need that file in afterEvaluate to setup dependencies)
I have many gradle cons /s
project() takes args
one of them being the configuration
you'd wanna pass in reobfJar or might be reobf
no
see the pins
ended up just doing the work in afterEvaluate without using tasks
So paperweight 1.5.7 incoming?
paperweight 1.5.7-SNAPSHOT already exists 
It'll be ready for the release of 1.20.2 I'd hope yea
I am looking into a potentially nicer solution today, its been a wild ride
otherwise I guess we are stuck with the hack for a bit
you should probably use a dependency resolution hook instead
like what paperweight userdev does
will look at that another day
just want to get mache to run at all inside paperweight
we need to do a hell lot of cleanup anyways because am copy pasting so much code over
> Task :paper:applyPatches
> Task :paper:lineMapJar
> Task :paper:prepareForDownstream
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
7 actionable tasks: 7 executed
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':Scissors-Server:compileLog4jPluginsJava'.
> Could not resolve all files for configuration ':Scissors-Server:log4jPluginsCompileClasspath'.
> Failed to read upstream data.
* 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 3m 45s
1:52:36 PM: Execution finished 'createReobfPaperclipJar'.
i get this error when trying to run createReobfPaperclipJar on a fork from paperweight (forktest)
i dont know how to fix this
paperweight is on 1.5.6
Try to use 1.5.7-SNAPSHOT
dependencies {
remapper("net.fabricmc:tiny-remapper:0.8.8:fat")
decompiler("net.minecraftforge:forgeflower:2.0.629.1")
paperclip("io.papermc:paperclip:3.0.4-SNAPSHOT")
}
i updated these block of dependencies too and gradle to 8.3 to see if what would change anything
i'll try 1.5.7-SNAPSHOT
The other solution is to use 1.5.5 and add that patch to sour servers patch folder. https://github.com/WeepingMC/Weeper/blob/main/patches/server/0014-revert-stuff-until-paperweight-1.5.6-is-functional.patch
ah didnt know 1.5.6 had issues
thought it was just me
i thought it was a network connection / DNS issue on my end
Was reported here https://github.com/PaperMC/paperweight/issues/209 and resolved in snapshot 1.5.7
I'll update to 1.5.7-SNAPSHOT myself and report back.
looks like it worked
Yeah seems so. Perfect, then I can drop the workaround.
guys im trying to setup a paperweight plugin. i cloned paperweight-test-plugin and opened it with intellij idea and when gradle starts doing its thing i get an error saying that it was unable to get the mappings.
===
There was a failure while executing work items
A failure occurred while executing io.papermc.paperweight.tasks.GenerateMappings$GenerateMappingsAction
Unable to resolve class data binding for 'jdk/jfr/Event' which is listed as the super class for 'net/minecraft/util/profiling/jfr/event/NetworkSummaryEvent'
can someone help me please
Which vendor of the jdk do you use?
Cursed
IBM stuff doesn't ship jfr it seems
Use a supported distribution like from Microsoft or Amazon or something
Temurin
i just recently switched from maven to gradle and i have been including external dependencies with the gradle shadow plugin. What is the recommended way of including external dependencies?
With the shadow plugin
so what i am already using is the recommended way?

alright thanks!
Hi I'm going insane and hoping someone with more gradle experience than me can help me out here,
I'm trying to setup a plugin that depends on multiple NMS modules
my dependency setup looks like
dependencies {
implementation project(path: ':bukkit:core', configuration: 'shadow')
implementation project(path: ':nms:base', configuration: 'shadow')
implementation project(path: ':nms:v1_19_R1', configuration: 'shadow')
implementation project(path: ':nms:v1_19_R3', configuration: 'shadow')
}
I saw [In the pinned comment](#build-tooling-help message) the solution is meant to be to change my configuration from shadow to "reobf" but when I made that change to the nms modules they weren't included in the jar.
I've confirmed that the reobf jar is actually building and in the build folder it's just not being used for the full project jar.
this is what my build.gradle looks like in one of the NMS modules
plugins {
id 'com.github.johnrengelman.shadow'
id 'io.papermc.paperweight.userdev'
}
dependencies {
compileOnly project(':nms:base')
paperweightDevelopmentBundle 'io.papermc.paper:dev-bundle:1.19.2-R0.1-SNAPSHOT'
}
tasks {
assemble {
dependsOn(reobfJar)
}
}
artifacts {
archives shadowJar
}
I'm just using the version that was in use when I setup the project originally as a single nms version plugin
ill update it, figured it was fine to keep the version consistent to the version of MC it related to
I have updated to 1.5.6 and am still facing the same issue unfortunately
if anyone is able to assist with this, please ping me if I miss your response as id love to find a way to resolve this! thank you!
Heyo i previously used intellij and gradle it all worked perfectly fine (still does on windows) but i reacently switched to linux and im getting this error, i have no idea how to fix it please help 🙏
i stalked some post on https://slack-chats.kotlinlang.org/c/gradle that said they fixed it by deleting ~/.gradle, i tried deleting that as well as the .gradle and gradle inside of my project but that didnt seem to fix it 
idk?
its just a normal gradle using kotlin
@lament scarab sorry for the ping but do you want me to send the screenshot of the gradle file?
no - ping.
Ping anyway
When you ping cat it literally makes it impossible for them to read your message
I mean, now that my eye is fully gone, it's not that bad anymore
but, i just generally walk out when they pull the "sorry for the ping" thing
Based
Eye is fully gone? Jeez like fr?
I mean, I'll take the sorry for the ping if it was a reply ping. Forgetting to turn that off can happen.
It's another story if they use a ping within a message. That has nothing to do with a mistake.
yeah cat is blind
Heya! I'm writing an API and I've tried putting it on Jitpack with the following code: https://github.com/Artillex-Studios/AxAPI/blob/e8f80954a230a30484b5fc528864f33d09f6824b/build.gradle#L66-L75
I've tried putting the publishing part literally everywhere, yet it doesn't want to work.
This is what I have in the other project: (yes, I do have the Jitpack repo in that project)
implementation 'com.github.artillex-studios.AxAPi:AxAPI:e8f80954a2:all'
And I get the following error:
Could not find v1_20_R1-e8f80954a2.jar (com.github.artillex-studios.AxAPi:v1_20_R1:e8f80954a2).
Searched in the following locations:
https://jitpack.io/com/github/artillex-studios/AxAPi/v1_20_R1/e8f80954a2/v1_20_R1-e8f80954a2.jar
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
What's really interesting, is that if I change implementation to compileOnly, gradle doesn't yell at me (however I want to shade this API, so compileOnly won't really work)
(I hope this is the appropriate channel for this)
Checked jitpack logs?
Most likely the build failed
Which is why jitpack shouldn't be used, it's not stable
You can't rely on it
I am trying to compile my Velocity branch with the up to date upstream version. I am getting the following build system error:
'```* What went wrong:
An exception occurred applying plugin request [id: 'org.gradle.toolchains.foojay-resolver-convention', version: '0.4.0']
Failed to apply plugin class 'org.gradle.toolchains.foojay.FoojayToolchainsPlugin'.
Could not create plugin of type 'FoojayToolchainsPlugin'.
Could not generate a decorated class for type FoojayToolchainsPlugin.
org/gradle/jvm/toolchain/JavaToolchainResolverRegistry```
what do you mean by "compile my Velocity branch with the up to date upstream version"?
that sounds like you have an outdated version of gradle or something
I have a branch of Velocity with minimal code changes and I merged the 1.20.2 branch.
It used to compile fine back with 1.19.4. There should be no changes to the build files.
I used TortoiseGit. There was a merge conflict but only in 2 source files.
Does Velocity need a bleeding edge Gradle version?
as a troubleshooting step I would git diff against upstream and make sure only the intended differences are there
yes
Only 2 source files are changed and one file added.
I will try updating Gradle.
It is the same version that used to work fine before.
the current build should work
it's passing ci
might just need to nuke gradle caches, updating gradle/foojay conventions could acomplish the same thing
you can try to switch to the current build and validate upstream is compiling to make sure it's not caused by your changes
I think after deleting Gradle and downloading the newest version it is working now 😒
Thank you so much for you help though. It's the kind of things that are difficult to find as a Java toolchain noob.
😄
Sorry I am back with new problems.
It generates a ~1KB jar file 😒
I am calling "Gradle.bat build". It builds a lot of things.
Yeah
there is a single file "velocity-3.2.0-SNAPSHOT.jar"
It has 1KB and obviously can't run.
delete the build directories from the submodules and try to build it again.
oh wait, you're looking in the wrong directory
proxy/build/libs is not build/libs
Oh yes.
Is there a recommended way to run any Gradle tasks on a Paper fork while offline? Most tasks fail on the upstream data tasks which fail without internet
there’s —offline but I have no idea if that would work
why does the run paper server plugin generate a new world every time it starts?
It doesn't?
I was spawned into a completely new world when I re-ran the run server task initially but then it stopped... that was weird
either that or it teleported me elsewhere and loading chunks is extremely slow., which is likely
oh thats a shame
stopping/rerunning when using the old method did a safe stop
is there a way to configure it to safely stop?
gradle doesn't give you control over how the kill signal is passed to the child process
so not really
when i try to run runDev i get this error https://pastes.dev/qxoNYPai9X
this is my current project layout, for some reason the build.gradle in ebiclib-nms refuses to pickup the spigot-v1_20-R1 subproject, its registered but no combination of ebiclib-nms and spigot-v1_20_R1 with colons works
sir this is paper
altho I don't know if anyone can help without your build.gradle
or whatever you are using
fixed by for looping the deps
I have a completely clean Paper fork with nothing except the default build changes
I try and run applyPatches and then build and this test fails
Targeting the latest 1.20.2 paper commit (c4ba28a21a923a99c8ef9a9e42b66862c04743f5)
looks like an encoding issue
Not exactly sure how to fix this
Because there are zero patches except the build changes
from ForkTest
Hi, I'm trying to build paperclip jar in my fork but I have this error:
PS D:\Intellij Projects\TestFork> ./gradlew createReobfPaperclipJar
> Task :testfork-server:compileLog4jPluginsJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':testfork-server:compileLog4jPluginsJava' (type 'JavaCompile').
- Gradle detected a problem with the following location: 'D:\Intellij Projects\TestFork\.gradle\caches\paperweight\upstreams\paper\.gradle\caches\paperweight\taskCache\minecraft.jar'.
Reason: Task ':testfork-server:compileLog4jPluginsJava' uses this output of task ':clonePaperRepo' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
Possible solutions:
1. Declare task ':clonePaperRepo' as an input of ':testfork-server:compileLog4jPluginsJava'.
2. Declare an explicit dependency on ':clonePaperRepo' from ':testfork-server:compileLog4jPluginsJava' using Task#dependsOn.
3. Declare an explicit dependency on ':clonePaperRepo' from ':testfork-server:compileLog4jPluginsJava' using Task#mustRunAfter.
nvm, fixed
yes, 1.5.7-SNAPSHOT
when i try to run runDev i get this error https://pastes.dev/qxoNYPai9X. my JAVA_HOME is set to "C:\Program Files\Eclipse Adoptium\jdk-17.0.8.101-hotspot". Can someone help me?
Hello.
I added paperweight dependencies to my project and everything was fine, but when I needed to compile the code, I used shadowJar. But the newly obfuscated NMS code was compiled into a separate .jar, and not into a .jar with the main code.
I read the description, but still couldn't find where to look for information.
Can someone tell me how to make shadowJar immediately include the obfuscated NMS code in the same .jar?
You don’t, reobfJar needs the input from shadow jar to run
Best advice if you want the allusion of a single jar would be to move the output folder of shadow jar, but, don’t, that jar is still useful for devs wanting to test stuff
Can you also tell me how to configure the output directory and .jar file name in reobfJar?
see the test plugin
Sorry, I didn't see this...
outputJar.set(layout.buildDirectory.file("libs/PaperweightTestPlugin-${project.version}.jar"))
I got this error when trying to make my plugin publish to the gradle plugin portal, it is erroring when it tries to build and it seems to have to do with paperweight:
Run ./gradlew build
Downloading https://services.gradle.org/distributions/gradle-8.3-bin.zip
............10%............20%.............30%............40%.............50%............60%.............70%............80%.............90%............100%
Welcome to Gradle 8.3!
Here are the highlights of this release:
- Faster Java compilation
- Reduced memory usage
- Support for running on Java 20
For more details see https://docs.gradle.org/8.3/release-notes.html
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file '/home/runner/work/GenesisMC/GenesisMC/mainPlugin/build.gradle' line: 27
* What went wrong:
A problem occurred evaluating project ':mainPlugin'.
> Could not find method pluginBundle() for arguments [build_kdmfo4j5b7rjmii5e6udjk03$_run_closure3@7d3addf8] on project ':mainPlugin' of type org.gradle.api.Project.
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':mainPlugin'.
> Failed to notify project evaluation listener.
> paperweight requires a development bundle to be added to the 'paperweightDevelopmentBundle' configuration, as well as a repository to resolve it from in order to function. Use the paperweightDevBundle extension function to do this easily.
* Try:
> Run with --stacktrace option to get the stack trace.
send build script(s)
K one sec
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
This is the script I changed(one of 3), which is the one I want to publish to the gradle plugin portal
I mean
you're applying the userdev plugin
and so it expects for the userdev stuff to be setup
then again, your pluginBundle thing blew up, so I'd guess maybe it janked up and failed to get that far
How could I fix it?
work out why it blew up tryna call something
iirc, generally make sure that gradle is updated along with your plugins
No idea why you're tryna pull in plugin-publish though
that project looks all forms of janked up
Yeah I'm not that good with gradle lol
I mean, your paper plugin is generally not going to be a gradle plugin
idk why that would ever be the case
if you actually have a gradle plugin, seperate it out
It's a paper plugin. Is the plugin portal only for gradle plugins?(still kinda new to gradle stuff lol, don't rly work with it much)
yes
💀
Alright well I found the issue now XD
Didn't read that it was meant for gradle plugins
What repository would you recommend for a paper plugin?
on what respect?
if you just mean a place to publish your plugin for others to use, hangar, modrinth
No, for its api. I already have it on Spigot, modrinth, and the hangar(which is rly cool btw)
codemc is pretty much the only "central" mc repo, outside of maven central
Oki doki, ty :)
Just double checking, this means I can use code mc repository for an external library/dependency for gradle and/or maven?
Tysm
What does paper use for it to host its build artifacts for the api and userdev? I heard it uses the maven central repository but it made no sense bc they have a notice on their setup page saying that you can't modify/delete published artifacts
How do u update ur builds for the api/userdev?
paper has its own maven repo
the userdev gradle plugin is published to the gradle plugin portal, but the API/devbundle artifacts are hosted on paper's maven repo
Does anybody has a workaround for the not responding https://javadoc.io website? I can't compile velocity / paper fully without that.
remove the javadoc io stuff
We are considering to rehost that stuff
For now https://javadocs.dev/ might be a temporary alternative?
who hosts that?
it's not like you can't easily host those on github pages 👀
but javadocs.dev seems like a nifty tool (even though there is like zero info about it lol)
ah, apparently it's a google developer: https://github.com/jamesward according to https://twitter.com/_JamesWard/status/1650989632589291520
Kotlin Product Manager. jamesward has 651 repositories available. Follow their code on GitHub.
Finally migrated https://t.co/Lm57AfzpOO from Scala 2 + http4s to Scala 3 + ZIO 2 with ZIO Direct & ZIO HTTP. GraalVM Native Image static binary = 14MB container. Running on Google Cloud Run, globally load balanced across 37 regions.
112
and here's the repo https://github.com/jamesward/javadoccentral
Bonus points: It's open source
Have you tried doing a fresh clone and then trying again?
yep multiple times. doesn't work on the master branch nor any of the patch branches
probably a weird windows issue
yeah i tried on wsl there it works
theres only like 1 person on the team who uses windows though, so
do you guys in the team use wsl or directly linux
most of us use macOS or linux
alright thanks!
what linux os do you recommend
for desktop?
i think i will be using wsl
alright thank you
https://github.com/PaperMC/paperweight/pull/214 will fix it, we will get that merged into paperweight and a release build later today
Thank you! what exactly was the cause for this?
filterProjectDirs didnt consider windows line separators, so runDev was compiling against a jar that contained the unpatched vanilla classes
as a bainaid fix, it seems like changing the order of the classPath for the runDev task in Paper-Servers build script (last lines) works
cc @hard dome since you ran into this too
better bandaid is just bumping pw to 1.5.7-SNAPSHOT until the release
or that since jmp just merged the PR
:p
oh awesome, that'll save me having to use a VM
(just use wsl)
tried wsl but it just kept crashing intelliJ
heh
My suggestion would be to get a mac
with what money
I'm too dizzy to come up with an answer which isn't "find a sugar daddy"
When I run "gradlew build" of https://github.com/Paul19988/Velocity/tree/dev/1.20.2 and failed:Execution failed for task ':buildSrc:compileKotlin'.
Error while evaluating property 'compilerOptions.jvmTarget' of task ':buildSrc:compileKotlin'.
Failed to calculate the value of property 'jvmTarget'.
Unknown Kotlin JVM target: 20
Compile using java 17
Where am I using the idea to set it up
Set the project SDK
Hi, what's wrong?
com.intellij.openapi.externalSystem.model.ExternalSystemException: Failed to apply dev bundle patches. See the log file at 'D:\Intellij Projects\RoxyItems\.gradle\caches\paperweight\setupCache\patchedSourcesJar.log' for more details. Usually, the issue is with the dev bundle itself, and not the userdev project.
Failed to apply dev bundle patches. See the log file at 'D:\Intellij Projects\RoxyItems\.gradle\caches\paperweight\setupCache\patchedSourcesJar.log' for more details. Usually, the issue is with the dev bundle itself, and not the userdev project.
Operation has non zero exit code: 1
patchedSourcesJar.log by @sharp trellis: https://pastes.dev/hZv5b6E6eX
actually having that exact same problem and log after trying to update the dev bundle from 1.20.1 to 1.20.2
this issue only occures on dev bundle 1.20.2
1.20.1 works
when is Velocity getting updated?
Even after updating paperweight to 1.5.8, I'm still getting issues with patching.
I've ran clean, cleanCache and cleanAllPaperweightUserdevCaches
Is there something else I need to manually clean?
did you read my response to your deleted comment
Got it, thank you very much
Sorry about the deleted comment, I thought it was working after cleanCache but it turns out it wasn't 😅
I probably should have been a bit more detailed in the closing message anyways
message.txt by @cold hedge: https://pastes.dev/O5a3BUKC8D
I get this error specifically when trying to use paperweight userdev with 1.20.2
So ./gradlew reobfJar --refresh-dependencies should work?
yes
Let me try deleting some caches...
1.20.2-R0.1-20231010.011415-29 is latest
Ah, so -SNAPSHOT doesn't work?
it does
that would explain why Jenkins built it and I couldn't
but sometimes your machine doesn't pull latest
Jenkins uses --refresh-dependnecies in my script
it was published like 20 mins ago
Ah yes, seems like it wasn't pulling latest. Specifying 20231010.011415-29 worked. Thank you so much for your help
anyone can help?
crash-2023-10-10_10.42.24-server.txt by @lethal canyon: https://pastes.dev/jO9EYh8w6c
like powercas_game said, this is something not related to the gradle build tool, but with paper directly, so #paper-help is more appropriate for this.
More people with paper knowledge tend to look there, so please ask your question again over there.
message.txt by @pearl swallow: https://pastes.dev/mqDIQCBdpv
The second dependency is the spigot server jar, including craftbukkit and nms classes
Won't/shouldn't be on a public repo
Do you need server internals or just the api?
I need nms
Thanks
🚨 1.8
1.8 💀
☝️🤓
banned for life
Hi for some odd reason, the task applyPatches fails when trying to run it? but it seams to work locally?
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':paperfork-server:compileLog4jPluginsJava' (type 'JavaCompile').
- Gradle detected a problem with the following location: '/var/jenkins_home/jobs/paperfork/jobs/paperfork/workspace/obsidian-api/build/classes/java/main'.
``` Anyone know if this is like a issue with jenkins or like something we can fix in the build config?
is there any way to get paperweight to not use the internet after the upstream repos have been cloned in .gradle/caches/paperweight/upstreams?
using gradles offline mode should work
ive already tried it, it still tries to connect
./gradlew --offline applyPatches
yeah for the first applyPatches you will need an internet connection because it downloads some mojang stuff too
yeah but it also tries to access the internet the second time i run applyPatches
Hello,
i want to bind my coreapi to my bedwars plugin with gradle but it doesn't work. Can anyone help me please?
Core-API: https://pastes.dev/M1x1rJQdo0
Bedwars: https://pastes.dev/BCYMaTeqhU
Hi there,
At this moment I have a Maven project where it builds the .jar but I would like to have a way where it outomatically upload the .jar created in the target folder to my testserver on my VPS (in my dedicated server).
And after that reload the server to get the new jar enabled.
How would I do this?
probably use some maven plugin to run scp after the build finishes
would be better situated in your IDEs run configuratin thatn in maven tbh
Yea but how would I do it?
Both the rcon to reload the server and deploy it to the server as there is no option in Intellij idea for both these things
you'd use run tasks
I mean, on linux I used to just basically ssh to rm the og plugin jar, scp over the new one, and then just poll something to send a signal over to the server to run a reload of that plugin
worth noting, that was a dev server, and I spent stupid amounts of time to make it as safe as possible in the territory of unsafe shit
not really paper related, but at this point im starting to be pretty desperate in this. ive got a shadowjar plugin setup for my project with following configuration, whenever i want to apply it to my test project i get this weird error, since the library should be downloaded automatically(gson is avaialable on mvncentral), any ideas? ive tried reading through docs but found nothing + nobody knows what could be casuing this
show the entire stacktrace
Is there an article on how to make a custom paper fork?
no article, but an example repo: https://github.com/PaperMC/paperweight-examples
you're just missing gson, is that a transitive dep from the ones you have included?
shadow doesn't filter transitives iirc
or wait, err
thats weird, adding gson fixes it, but shouldnt gradle download it automatically?
no
shadow doesn't filter entire transitive trees
only the explicitly defined dependencies are included
is there any way to allow it?
ive tried making the dependencnies transitive using api configuration but that doesnt change anything
no
it's outlined in the shadow documentation
https://imperceptiblethoughts.com/shadow/configuration/dependencies/#filtering-dependencies
While not being able to filter entire transitive dependency graphs might seem like an oversight, it is necessary because it would not be possible to intelligently determine the build author's intended results when there is a common dependency between two 1st level dependencies when one is excluded and the other is not.
Is it possible to make s paper fork for removing Minecraft features I don’t want?
sure
As an example, can I just remove fall damage completely?
a fork for just that seems a bit unnecessary, considering thats one event to cancel and thats it
but you can, sure
public void onDamage(EntityDamageEvent e) {
e.setCancelled(true);
}
👍🏼
it’s remove all damage…
you can check whether this damage is from falling or not, if so, then use setCancelled
like
if(e.getType().equals(DamageTypes.Falling) {
e.setCancelled(true)
}
but do not copy this code, I wrote on the phone, it may be incorrect
wrong channel
Actually a better solution is /gamerule fallDamage false 😹
Was in the reply of the fork question.
maybe, i’m don’t use new version
Altho, the code is wrong, the anwser itself isn't.
I know, it was just an example
Following the conversation from #paper-dev - I'm developing a plugin in Kotlin that's meant to be used as a dependency in other plugins. It has the following dependencies:
implementation(kotlin("stdlib-jdk8"))
implementation("net.objecthunter", "exp4j","0.4.8")
implementation("org.apache.commons:commons-math3:3.6.1")
Am I doing the relocation correctly? Should kotlin be relocated?
shadowJar {
fun reloc(pkg: String) = relocate(pkg, "${project.group}.${project.name}.dependency.$pkg")
reloc("kotlin")
reloc("net.objecthunter")
reloc("org.apache.commons")
}
yeah you're kinda fucked, its a problem i've also come across
afaik the client plugin needs to explicitly relocate the package in the same way
then it could work
alternatively the client shades and relocates it separately
but I haven't found a way yet to relocate transitively
if you find something let me know, it would interest me
Basically, best advice is, write your API in java
otherwise, unless you're using paper plugins, there is some potential classloader headaches if you don't relocate
I am using paper :P
paper plugins in a specific plugin format
it is highly experimental tho
general suggest I guess would just be, implement the API separately from your impl in plugin B.
Write the API of plugin B in java, write the impl in whatever you want
I see, thanks! I will do that for my next plugin. For now I'll try to figure out how to relocate the package in the same way

Could you clarify what "relocating the package in the same way" means? I'm not sure I understand what you meant
So If I use this plugin as a dependency (com.github.gameoholic:partigon:1.0.6) how and what should I relocate?
you would have the exact same relocation
if plugin a relocates io.kotlin to my.mystical.plugin.io.kotlin, then your dependencies also need to have that exact same relocation
Oooo I think this must be my issue too ! Did you find a solution??...
This is the relocation for my main plugin: relocate("kotlin", "com.github.gameoholic.partigon.dependency.kotlin")
It depends on partigon, which has the following relocations:
relocate("kotlin", "com.github.gameoholic.partigon.dependency.kotlin")
reloc("net.objecthunter")
reloc("org.apache.commons")
But it still doesn't work, what did I do wrong?
I reloated kotlin the same way, didn't I?
Found my issue lol.... feel a little silly now too.
Depends on the error you’re getting, you’d need to make sure it lines up (relocations)
Not feeling good so lying down
This channel is for support with build tooling
mb
get some good rest!
You still not good 😦 it's been days now !! ...
you need to get some rest/sleep. Its the turn it off and on again for us humans!!...
(The error is:
Caused by: java.lang.LinkageError: loader constraint violation: loader 'partigon-1.0.7.jar' @69787019 wants to load class com.github.gameoholic.partigon.dependency.kotlin.Pair. A different class with the same name was previously loaded by 'HubInteractions-0.1.1.jar' @4d62bdb7. (com.github.gameoholic.partigon.dependency.kotlin.Pair is in unnamed module of loader 'HubInteractions-0.1.1.jar' @4d62bdb7, parent loader java.net.URLClassLoader @66cd51c3)
Which I don't really understand since it's the same package? 🤔
plugin A cannot also ship kotlin
you relocate your usage but don't shade it pretty much
and use plugin Bs kotlin stdlib
otherwise, yea, plugin A is gonna try to load a class called Pair from its jar but plugin B, sharing a classloader with plugin A already has the same class loaded; plugin A explodes
ahh gotcha! How would I relocate the usage without shading and shipping it?
I'm still getting the same error, after making kotlin compileOnly. And plugin B's kotlin stdlib is relocated to the same place ("com.github.gameoholic.partigon.dependency.kotlin")
https://pastebin.com/iz1nQHUz
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
iirc the kotlin plugin automatically adds it as a implementation dependency?
Hmm, possibly? How would I make it not do that :P
you’d have to google that
Yeah reading the docs it does say it's automatic, I found how to disable it
edit: so according to the docs, you disable it by adding kotlin.stdlib.default.dependency=false to gradle.properties but it doesn't change anything.. sigh
hi, whats the problem again?
Trying to use a plugin as a dependency in another plugin, both are written in Kotlin.
I'm trying to make it so the main plugin doesn't ship kotlin, and uses the dependency's stdlib instead.
Even if I make the stdlib compileOnly, the kotlin plugin automatically adds it as an implementation regardless
white background and no syntax highlight. This mf opened build.gradle.kts with notepad
We can make suggestions on better software to use to view the code bites but let’s keep the unhelpful comment from help chat. Thank you 
Im experiencing gradle sync issues today, i have never seen this before:
Didn't change anything in the gradle file
Is this just a repo downtime?
looks like it
damn it
was too lazy to open idea sorry bro
or github
don't worry lmao, it was meant as a joke
ye that was obvious haha
okay so it seems that im the only one with this issue
other people confirmed that it works for them
