#build-tooling-help
1 messages · Page 6 of 1
yes, because the all artifact is the one which actually has everything inside if it
You can set the archive classifier in shadowjar if u absolutely don’t wanna use the runpaper plugin
i set it to automatically export to the plugin folder, thats why i forgot about it
don't break gradle
yes thank you
I still hate that when I run a debug with run-paper the console doesn't allow me to do things like press the up arrow for the previous input
is there a way to fix that or no
No
Any ideas?
message.txt by @bronze willow: https://pastes.dev/e5B8R2ZhIY
exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 64
I'm going to guess
unsupported java version
I just was tweaking around with my git project, it worked 10minutes before
Okay
Like, you can take in what I've said, or you can play the "just" card, your perogative
Okay then im going to investigate what i broke with my java version
What's the "best" java version for gradle?
depends on the version of gradle that you're using
generally, you use whatever version that expects, and make sure that you're using the wrapper
weird question but how do i use the wrapper?
Gradle wrapper?
On intellij i think it’s in settings and under gradle u can choose gradle wrapper
Settings or project structure
Is that default or do i have to do it manually?
default
Thats what i thought
but IJ uses its own gradle copy when creating a project which last I knew as kinda old
the version is selectable now in the new project wizard
has been since like forever
wtf is this now??
message.txt by @bronze willow: https://pastes.dev/Q3sAsP8cOW
ehm, im using groovy
rootProject.name = 'pluginname' <- this it my settings.gradle
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '8.0.0'
}
and the java plugin is there
no
?
https://github.com/PaperMC/Paper/blob/931781c220b98dde0159c9a3c8dce06c3b2b1e13/settings.gradle.kts#L11 add this plugin
to your settings.gradle
the whole file, or just the one line?
the line
message.txt by @bronze willow: https://pastes.dev/IWz3PFNJw2
in the plugins block
do note that they're using groovy
message.txt by @bronze willow: https://pastes.dev/ETGwubRumc
the syntax should work
and are allergic to reading
send your file here
yeah i think its working if i swap some lines
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
}
rootProject.name = 'plugin'
Thats working
I swapped plugins with rootProject
"Cannot resolve resource filtering of MatchingCopyAction. IDEA may fail to build project. Consider using delegated build (enabled by default)."
What does that mean?
Does anyone know how to use something like secrets on github on private repositories without paying for GitHub premium or whatever it is
secrets work just fine on github private repos?
add them on the repo itself
Is that free?
yes
It's a private repository inside a organization
yes
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<mergeManifestMode>mergewithoutmain</mergeManifestMode>
<archive>
<manifest>
<mainClass>
com.example.Main
</mainClass>
<addClasspath>true</addClasspath>
<addExtensions>false</addExtensions>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
So I found this Maven assembly plugin configuration
Is there any Gradle equivalent of <mergeManifestMode>mergewithoutmain</mergeManifestMode> (line 12)?
I think shadow has a transformer that can merge manifests
Believe it or not I understood nothing from the sentence you just typed
why are there two decompile tasks in paperweight if the remapped output of spigotDecompileJar is already used in the final Something-Server sources?
Because spigots patches need the spigot decompiler
for stuff we only touch, we use a better decompiler
hi so when i try to build my plugin it fails
this is the error
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.
heres my settings.gradle.kts
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.
and my build.gradle
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.
Caused by: io.papermc.paperweight.PaperweightException: Failed to resolve dev bundle
yes
well, you don't have the paper repo added, but, I think that the paperweight plugin will inject that for you, I don't remember
things also java 17, so might be an issue there
outside of that, may just need to tell gradle to refresh dependencies so it retries
ok thanks
got an unusual question...
is there any way to get around this without using a VPN when building Velocity? 💀
it's just that I'm in Russia and, well 💀
@ jmp:
For the gradle run-tasks thing is it possible to run a moj-mapped server without userdev present? I currently have a project where module A (run-tasks) depends on module B (userdev)'s reobf'ed artifact. Is it possible for module A to have a runMojangMappedServer task without userdev present?
I think your government should have some type of free DNS which bypasses restrictions by spoofing their destination, try doing more research. There's one in iran so called "shecan"
Working in Iran is more cancerous, because you have to bypass both US restrictions and internet censorship
that won't work, that error is coming from Oracle because my IP is russian
I'm looking for a way to prevent it from fetching that url
well, considering that specific error is for javadoc generation, maybe you can get away with it by disabling any javadoc tasks?
you can use the --no-platform-links javadoc tool option to disable platform linking entirely or supply alternate URLs via --link-platform-properties
if you don't care about javadoc at all can just -x javadoc for the gradle incovation
not currently
noted
That should, read more about DNS spoofing
Iran eg. https://shecan.ir/
I will include the floodgate api in a grandel plugi how can i do this i have made the instructions what the site said to me but it doesnt work
Bild
Bild
oh and sorry for my bad english
what isn’t working
can I separate chunks of my build.gradle.kts into multiple files? e.g. if i want to build with the web frontend that introduces new tasks and dependencies, and so does publishing to mod sites, and this can make the file messy
I cant use the floodgate api
I cant import it ore use it
oh sorry for the ping
How are you trying to use it? @elfin salmon
I have copied fro the floodgate api website the code in my main file and have tried to include the api
@olive current
?paste
Please send large files/logs to a pastebin
A sensible, modern pastebin. Share text and source code snippets with no hassle.
It works now, I just had to restart the program. Nobody is writing that anywhere
thx for your help
You have to sync gradle
when you make changes to the build.gradle(.kts) there is a small reload button with an elephant in the top right of the window... press it and the imports from new dependencies will work
Hello. I tried to make what said paper developer in this issue. https://github.com/PaperMC/paperweight/issues/230 What I should provide to remapClasspath to make it work?
the jar
thanks
I published the paper-api to my own sonatype nexus instance, but for some reason my project can't find it:
> Task :anvil-paper:compileKotlin FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':anvil-paper:compileKotlin'.
> Could not resolve all files for configuration ':anvil-paper:compileClasspath'.
> Could not find io.papermc.paper:paper-api:1.20.2-R0.1-SNAPSHOT.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/io/papermc/paper/paper-api/1.20.2-R0.1-SNAPSHOT/maven-metadata.xml
- https://repo.maven.apache.org/maven2/io/papermc/paper/paper-api/1.20.2-R0.1-SNAPSHOT/paper-api-1.20.2-R0.1-SNAPSHOT.pom
- https://oss.sonatype.org/content/repositories/snapshots/io/papermc/paper/paper-api/1.20.2-R0.1-SNAPSHOT/maven-metadata.xml
- https://oss.sonatype.org/content/repositories/snapshots/io/papermc/paper/paper-api/1.20.2-R0.1-SNAPSHOT/paper-api-1.20.2-R0.1-SNAPSHOT.pom
- https://libraries.minecraft.net/io/papermc/paper/paper-api/1.20.2-R0.1-SNAPSHOT/maven-metadata.xml
- https://libraries.minecraft.net/io/papermc/paper/paper-api/1.20.2-R0.1-SNAPSHOT/paper-api-1.20.2-R0.1-SNAPSHOT.pom
- https://nexus.anvilpowered.org/repository/maven-public/io/papermc/paper/paper-api/1.20.2-R0.1-SNAPSHOT/maven-metadata.xml
- https://nexus.anvilpowered.org/repository/maven-public/io/papermc/paper/paper-api/1.20.2-R0.1-SNAPSHOT/paper-api-1.20.2-R0.1-20231209.201841-1.pom
- https://repo.spongepowered.org/repository/maven-public/io/papermc/paper/paper-api/1.20.2-R0.1-SNAPSHOT/maven-metadata.xml
- https://repo.spongepowered.org/repository/maven-public/io/papermc/paper/paper-api/1.20.2-R0.1-SNAPSHOT/paper-api-1.20.2-R0.1-SNAPSHOT.pom
Required by:
project :anvil-paper
Its searching in the correct location https://nexus.anvilpowered.org/repository/maven-public/io/papermc/paper/paper-api/1.20.2-R0.1-SNAPSHOT/maven-metadata.xml
If I click that myself I get the xml, so I'm not sure whats wrong.
I published the paper-api with ./gradlew applyPatches and then ./gradlew publish (after chaning the target URL)
okay i'm realizing now that it only published the xml files... wtf
I... don't even know. It worked after I published the api a second time
you probably don't want to run publish in the root project
that is going to publish mostly useless and legally questionable server jars
also not sure why you wouldn't just mirror paper-snapshots instead
because I need the brig PR
gradlew module:publish
afaik you guys don't publish PR apis
yeah thats what I ended up doing when I ran it the second time
I'm thinking of setting up an action that auto-mirrors select PRs and publishes them...
maybe another day
you should change the version to something that gradle and maven won't select over an actual build
or change the group id
thats probably not a bad idea
for now I've just moved the repository declaration up to the top
that's exactly the issue, if someone has your repo at the top they will unintentionally get your builds
if I end up doing this with more experimental features i'll probably do custom versions for each
hm yeah
i see
i'll add the PR number to the version
the only annoying thing is that it seems the PR is force-pushed, so its difficult to auto update my fork
gitpatcher moment?

you can see quiet-loom on my github for an example use with workflows
all the things I should do if I had the time 😂
if I end up doing this alpha-publish more often I will look into that
for now its just because the brig PR is coming "soonish" and I want to go back to work without failing builds
Sorry for spam, this relates to something I asked in #general :
I want to be able to hot-swap code but I also require shadow
plugins {
`java-library`
`maven-publish`
id("java")
id("com.github.johnrengelman.shadow") version "8.+"
id("io.papermc.paperweight.userdev") version "1.+"
id("xyz.jpenilla.run-paper") version "2.+" // Adds runServer and runMojangMappedServer tasks for testing
id("io.freefair.lombok") version "8.+"
}
repositories {
mavenCentral()
google()
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://oss.sonatype.org/content/groups/public/")
maven("https://repo.unnamed.team/repository/unnamed-public/")
}
dependencies {
paperweight.paperDevBundle("1.20.4-R0.1-SNAPSHOT")
api("commons-io:commons-io:2.+")
compileOnly("io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT")
// Resource pack API
implementation("team.unnamed:creative-api:1.+")
// Serializer for Minecraft format (ZIP / Folder)
implementation("team.unnamed:creative-serializer-minecraft:1.+")
// Javalin backend with JSON to object mapping support
implementation("io.javalin:javalin:5.+")
implementation("org.slf4j:slf4j-simple:2.+")
//implementation("com.fasterxml.jackson.core:jackson-databind:2.+")
}
group = "io.github"
version = "1.0-SNAPSHOT"
description = "Origami"
java.sourceCompatibility = JavaVersion.VERSION_17
tasks {
assemble {
dependsOn(reobfJar)
dependsOn(shadowJar)
}
runServer {
dependsOn(assemble)
minecraftVersion("1.20.4")
}
processResources {
filteringCharset = Charsets.UTF_8.name() // We want UTF-8 for everything
val props = mapOf(
"version" to project.version
)
inputs.properties(props)
filesMatching("plugin.yml") {
expand(props)
}
}
}
there is some stuff there for the web api which i havent even started yet basically, so I commented out one line, but things like creative api are necessary for it to function
if anyone can help with hotreload i kinda really need it, restarting takes forever and is getting on my nerves a lot
ideally a way that doesn't break the web server is needed so I can get to work on the web ui
Just develop the UI outside of the plugin? Lol
oh I will, but for debugging the backend i will need to reload a LOt
I was just doing an ingame UI and reloading was a pain in the arse
I'll probably use vscode and its debug features for the vue stuff
the buildfile is also getting quite messy so if im able to modularise it a bit that would be great
I’ve never had hot reload fail just because of dependencies existing, but, like, you’re gonna need to clarify what issue you’re actually having
Hey, yesterday after commit b42a1da8737895f4fcacfae9b4d49a96b1445972, our CI freaked out with weird script compiling errors coming from upstream (paper), do you guys have any thoughts on this? The gradle log: https://pastebin.com/wMDYFJnA
The errors seem to have nothing to do with the commit, but it freaks out since then
(The CI is teamcity)
are you using gradle 8.5 ?
Nope, 8.1.1, should we bump to 8.5?
Yea 👍
That seems to have worked, I have no idea why it stopped working right now. But tysm
we bumped to gradle 8.5 and our build script now uses features that became stable in 8.4
gradle 8.1 hence fails
ah ok
I found that because I need to use shadow in this configuration that I can't hot reload code without it causing an error, I'll try again to get the exact one when I'm on PC but I was told there simply wasn't a fix and that's how it worked last time I posted said error
shadow works fine in my experience
the only issue was if you had relocations configured in shadow, as generally hot reloading uses the IDEs compiler stuff which doesn't understand relocations
I didn't go out of my way to disable any relocation stuff so maybe I need to do that? or maybe one of my dependencies is doing it
although I will need to copy files into the resources of the jar when i get round to making the web stuff
Are there any fixes to this besides shortening the file path length
Command finished with 128 exit code: git -c commit.gpgsign=false -c core.safecrlf=false clone --no-hardlinks
you on windows?
you can try working in the wsl environment, I think that fixes that issue?
or enable long paths
i think there is also a git config option you need to change after enabling them
but wsl is recommended
I'm currently trying to setup using GitHub secrets for reposilite read-only user but I still get this error at release workflow
Could not determine the dependencies of task ':shadowJar'.
> The following Gradle properties are missing for 'summitPrivate' credentials:
- blahUsername
- blahPassword
I don't want to use the properties though, I want to use the tokens which are specified here
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_NAME: ${{ secrets.MAVEN_NAME }}
MAVEN_SECRET: ${{ secrets.MAVEN_SECRET }}
Anyone got an idea what to do?
I use this authentication for the repo
maven {
name = "blahPrivate"
url = uri("https://blah.bllaah.blah/private")
credentials(PasswordCredentials::class)
authentication {
create<BasicAuthentication>("basic")
}
}
You need to create a gradle.properties file in ~/.gradle/ containing the username and password.
That's what I want to avoid doing though
you can also inject them as env variables iirc, you just need to use the correct convention
To use the secrets instead of the properties
Otherwise it would be useless to use the secrets
Can't I just use the GitHub secrets? Not sure how they work
Never said not to use.
Use placeholders for the values. It should automatically inject on build.
I mean
it doesn't magically know wht the fuck MAVEN_SECRET is
you have to follow the convention that it expects them to be in
Yeah lol makes sense, was confused how to define it
This only shows how to use the properties or environment variables though
..
what do you thing an "env" is setting
Basically I want to have two different profiles for the maven repository, a personal one which admin will have that can publish new versions to the maven repository. But also a read-only user for the maven repository that everyone should automatically be able to access, so the plugin can be built
.
gradle.properties kinda works for automatically having access to the read-only user, but then the personal user cannot be used without adding it to the git
.
So I wanted to have the personal user in gradle.properties and the read-only user in the github secret
given you seem to fail to read the gradle docs, you'd have to define the env variables
ORG_GRADLE_PROJECT_blahUsername
ORG_GRADLE_PROJECT_blahPassword
in your env block in the github workflow
(for that example)
Oh... I thought it was local environment variables... That's why it didnt make sense to me
Thank you
local?
As in windows environment variables
i mean
it can also be that
but that is on your PC
you can rn go into your windows environment variable
Yeah that's what I wanna avoid
set ORG_GRADLE_PROJECT_blahUsername and the other one
and now your local gradle runs would pull from there
Is it litterally ORG_GRADLE_PROJECT?
what
ORG_GRADLE_PROJECT_blahUsername
literally this but instead of blah your repo
literally
So I would set it up like this
env:
ORG_GRADLE_PROJECT_blahUsername: "MAVEN_NAME"
ORG_GRADLE_PROJECT_blahPassword: "MAVEN_SECRET"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_NAME: ${{ secrets.MAVEN_NAME }}
MAVEN_SECRET: ${{ secrets.MAVEN_SECRET }}
And the repository is setup like this
maven {
name = "blah"
url = uri("https://blah.blah.blah/private")
credentials(PasswordCredentials::class)
authentication {
create<BasicAuthentication>("basic")
}
}
Ah alright nice
Nvm doesnt work
I mean
obviously you didn't literally run that
right ?
ORG_GRADLE_PROJECT_blahUsername: "MAVEN_NAME"
like
Everything except blah yeah
OHHHH
So ```
env:
MAVEN_NAME: ${{ secrets.MAVEN_NAME }}
MAVEN_SECRET: ${{ secrets.MAVEN_SECRET }}
ORG_GRADLE_PROJECT_summitPrivateUsername: MAVEN_NAME
ORG_GRADLE_PROJECT_summitPrivatePassword: MAVEN_SECRET
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Using the variables defined
I mean this is the same as
ORG_GRADLE_PROJECT_summitPrivateUsername: ${{ secrets.MAVEN_NAME }}
ORG_GRADLE_PROJECT_summitPrivatePassword: ${{ secrets.MAVEN_SECRET }}
it fucking isn't
Huh? Why not? It references the variables defined above
I thought it worked like this lol
String mavenSecret = ${{ secrets.MAVEN_NAME }}
ORG_GRADLE_PROJECT_summitPrivateUsername: mavenSecret
mb
Yea no, you are in a completely different language
no worries
Lmao I appreciate the help
Okay well I'm kinda hopeless tho lol
* What went wrong:
Could not determine the dependencies of task ':shadowJar'.
> The following Gradle properties are missing for 'blah' credentials:
- blahUsername
- blahPassword
With this environment:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_summitPrivateUsername: ${{ secrets.MAVEN_NAME }}
ORG_GRADLE_PROJECT_summitPrivatePassword: ${{ secrets.MAVEN_SECRET }}
And this repository:
maven {
name = "blah"
url = uri("blahUrl")
credentials(PasswordCredentials::class)
authentication {
create<BasicAuthentication>("basic")
}
}
Anyone got an idea what's wrong?
Omfg
I stored the env the wrong place
# Builds the jar and uploads it as an artifact
name: Build commit
on:
push:
tags:
- "v*.*"
permissions:
contents: write
env:
// WORKS HERE
jobs:
build:
runs-on: ubuntu-latest
steps:
whatever:
env:
// TRIED HERE
also had the wrong env names
it’s looking for blahUsername and you have summitPrivatre whatever
so I used mache and edited some nms code, ngl I dont even know what a patch is so are the tasks needed to generate a runnable jar ```
- rebuildPatches
- applyPatches```? or do I need to actually generate a patch after modifying the code or sumthin
mache solely exists to generate a clean set of compilable sources from the vanilla server
wait thats fine for my use case tho
it's not intented for anything outside of that, that would be on you to provide, essentially
i just want to get the source for the vanilla server and modify it
Yes, but it's not exactly intended for that
There is no hooks for "generate a runnable jar", that is something you'd need to solve yourself
lol, the runServer task doesn't even work
trolled
to be fair i havent tried runServer, as i wasnt sure if it applied my changes or not
currently 17 hours into applyPatches
not sure what will happen from there
idk anybody who really has tooling to go from something like mache to a runnable jar
that's basically somewhere on the list of next steps for paper
well what da hell do they use mache for then just staring at nms code 😭 🙏
i mean if there's any easier way to simply edit nms code that works
it’s not used yet
We're not using it yet
the entire point however behind mache is that rather than decompiling the vanilla server jar and patching it directly, we can do that in mache, and import in a clean set
i.e. paper would have the entire servers source code in tree, rather than only the classes we modify, as well as having 1/2 of the classes touched by decompile patches with the full tree vs just what spigot touches
huh interesting
in my test for mache client side, i got a client jar i could import into prism launcher
which was quite nice
yea, it dumps out a jar which can run if you have the classpath setup for it
mojang uses a bootstapper for that which bundles all the libraries with it, that's the part you're effectively missing with mache > runnable jar
For servers right? Since the launcher does the class path for client
Not sure why im getting this error. the repo and plugin is there.
i moved the dependencies block and it worked 
did you forget to click the lil gradlephant reload button?
build.gradle.kts:1:1: error: unresolved reference: plugins
plugins {
java
`maven-publish`
// Nothing special about this, just keep it up to date
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
// 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.11"
}```
I am not sure what to do here...
running what ?
mostly screams you are not using gradle
what are you even trying to do
I am not sure i think it is build or smt
Running the IntelliJ build thing
I am new to Gradle (Started today a hour ago lol)
And what project is this ? I presume just paperweight-examples ?
Does your intellij have the project linked as gradle
e.g is there the gradle tab on the right side of your intellij
I mean, that looks good in your intellij ?
just run the task applyPatches
in the task folder
paperweight/applyPatches?
ye
Its running
Give it some time 👍
I'll let you know when it finishes
corrupt patch at line 61
could not build fake ancestor
Execution failed for task ':applyServerPatches'.
io.papermc.paperweight.PaperweightException: Failed to apply patches
make sure you are using the correct decompiler in that project then
using paperweight user-dev i cant use the dev jar right
how do i get a normal one?
oh its the reobfjar task right
correct
well, the relocation didn't run
so, all one can guess is that you didn't build it with maven properly
I mean, on the surface, that just looks like you used the IDEs build artifacts thing
which is not maven
and will not use mavens config outside of some basic configuration aspects
use the maven tool window
So I have my own fork of paper on a maven repo and when I try to access it via the devbundle I have to manually pass in the PasswordCredentials into the url or else I end up with a null token being sent. Any idea why this would be?
Because you need to tell it what task to run in the list
yes
i have no idea what you're looking at
you literally just expand the thing and find the packge task in there somewhere
or just create a manual goal and tell it to run clean package or whatever
Well
considering that build artifact doesn't care about the maven config properly
I mean, it's saying that it failed to create the artifact which is actually shaded
so, yea, maybe you should care about it
maven moment
it should work, you're probably missing something
but most of use gradle, so idk
I can't help with maven
- The shadow version is outdated -> 8.1.1 or something is the latest
- Shadow doesn't support Java 21 currently
Hello, what do I run to get the server JAR
createReobfPaperclipJar
Thanks! you are really helpful.
Just got hit with a bunch of errors
Please send large files/logs to a pastebin
A sensible, modern pastebin. Share text and source code snippets with no hassle.
These are warnings
Well, a lot of API stuff is deprecated
but the server has to call them
so plugins don't sob
Ah alr alr
lol
Okay the createReobfPaperclipJar is finished running
I can't find the JAR tho 💀
$projectRoot/build/libs/
👍
Is there a way to modify file names? like the paper.yml etc
Also if I could change what it shows when we run /version
Well, yes
sure
This channel is for support with the build tooling, however
when modifying the server software, there is generally the expectation that you know what you're doing
yeh I know
my bad
how do i make it that when i compile my plugin with gradle it puts it in the plugins folder of my server?
Pins
shadowJar is a task, it has to be prefixed or inside a tasks block
yep
you want to do me.plugin.libs.dev.dejvokep.boostedyaml to just move the whole package into a package specific to you
pretty common to use a list and forEach it so you aren't repeating yourself with the package names
You are not using the Paper API, unless you are using the Paper API from some other module or something like that (but in that case you should not get that error)
.
anyone have any idea as to how the gradle publish task succeeds in my CI but no artifacts are published? If I run gradle publish locally it is also successful and the artifacts are also visible on sonatype
I have a publishing build in teamcity which was working perfectly until recently
Okay... I updated teamcity and its the same result
but it still only shows the artifact from yesterday
if I publish locally, it works properly
it was working in the CI a few days ago
I ran publish locally in the same exact repo and it works immediately:
So as posted in #paper-dev (but as quoted, I moved here), I am new to shadowing a jar. As I have to use Commodore (Brigader "fork" by Lucko (who made LuckPerms)), I also have to shadow the jar, but a shadowed jar generates this error (in the paste), and will disable to the plugin. Have I mistyped anything or is something wrong from somewhere else?
Paste: https://pastes.dev/7lkBwTPaVy
I also have checked the shadowed jar file, and it contains the Events.java as Events.class, so it exists...
Why do you relocate to eu.*******.? Package names shouldn't contain *
Package names are censored. ;-;
Is the Events class in the same gradle module as the plugin class?
You mean when building or something? I suppose they are..?
It is in package.necessity, while Core is the plugin class...
(or I simply don't understand what you mean by "same gradle module")
Then it should work fine... do you use /reload or PlugMan or smth like that?
Yea, I just made sure it's not some reload bug
Huh, then I'm sure I probably have messed something up. O.o
If it should work fine, and it doesn't then it definietly is the fault of the "issue creator" (aka me in this case).
I don't see an obvious issue, especially since the events class is in the same place as the plugin main class. Could be some shadowJar bug.
Can you send the whole build.gradle file?
You don't need to set it, gradle will create the output in build/libs/
If you are using IntelliJ, you can use the "Minecraft Development" plugin. It will help you set things up in maybe 1 or 2 minutes. And as Joo200 stated, you don't have to worry about the output path.
The output will be here...
You can add a CopyTask to copy the file.
in build/libs/
Or just... Y'know manually copy and paste it..
Or upload directly if using a VPS
Maybe some missing build.dependsOn shadowJar. Or some weird jdk version
don't bother with commodore when using cloud on modern versions
declaration: package: cloud.commandframework.bukkit, enum: CloudBukkitCapabilities
Cloud is not being used, it just remained in the gradle build script.
Tho I thought we removed it (I mean either me or the other dev)
heh
Alright I somehow fixed it. Now onto having other issues with Commodore. YUPIEEE
Execution failed for task ':patchSpigotApi'.
io.papermc.paperweight.PaperweightException: Failed to apply patches
I ran applyPatches it should work right 💀
can you send the entire log?
Hello, having some trouble with the userdev plugin if anyone has run into or heard of this before:
Gradle: 8.4
paperweight: 1.5.11, paperDevBundle("1.18.2-R0.1-SNAPSHOT")
Java 21
Failed to apply dev bundle patches. See the log file at '<...>\patchedSourcesJar.log'
[DEBUG] Patching: net/minecraft/server/commands/WorldBorderCommand.java
<...>
[WARN] Hunk 1: FAILURE: @@ -16,128 +17,138 @@
<...>
[DEBUG] Patching: net/minecraft/world/level/border/WorldBorder.java
<...>
[WARN] Hunk 1: FAILURE: @@ -15,6 +16,7 @@
[WARN] Hunk 2: FAILURE: @@ -27,13 +29,28 @@
I've tried running gradle with --refresh-dependencies, and running cleanAllPaperweightUserdevCaches and cleanCache, but can't seem to figure out what I'm doing wrong. Any help would be appreciated
I do seem to get a different error when run in CI, java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid'
If it helps at all I have this all up for my plugin here, the version of paperweight is a little odd though since it's being pulled in by our own gradle plugin: https://github.com/CivMC/CivModCore/pull/100
Locally, I get
Caused by: io.papermc.paperweight.PaperweightException: Failed to apply dev bundle patches. See the log file at 'P:\AngrySoundTech\CivModCore\paper\.gradle\caches\paperweight\setupCache\patchedSourcesJar.log' for more details. Usually, the issue is with the dev bundle itself, and not the userdev project.
at io.papermc.paperweight.userdev.internal.setup.step.ApplyDevBundlePatches.run(ApplyDevBundlePatches.kt:78)
at io.papermc.paperweight.userdev.internal.setup.step.StepExecutor.executeStep(steps.kt:90)
at io.papermc.paperweight.userdev.internal.setup.step.StepExecutor.executeSteps(steps.kt:77)
at io.papermc.paperweight.userdev.internal.setup.SetupHandlerImpl.generateSources(SetupHandlerImpl.kt:109)
at io.papermc.paperweight.userdev.internal.setup.SetupHandlerImpl.createOrUpdateIvyRepositoryDirect(SetupHandlerImpl.kt:160)
at io.papermc.paperweight.userdev.internal.setup.SetupHandlerImpl.access$createOrUpdateIvyRepositoryDirect(SetupHandlerImpl.kt:35)
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingConfigurationResolver.resolveBuildDependencies(ErrorHandlingConfigurationResolver.java:63)
... 157 more
I'm not gonna get into the lombok disagreement we had lmao
idk about locally, need to look at the patchedSourcesJar
while I dont remember it, I think I have won now 😛
it wouldn't be that hard to remove from that codebase
according to github search it only uses lombok.utilityclass
and a bit of lombok.extensionmethod oh no
There was a bit more last I checked but
yeah
Thank you @bronze ember, I appreciate the sanity check greatly and this'll finally give the push to rip lombok out lol
a tad confused here, for some reason my plugin started Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:3.3.0:resources failed: newPosition < 0: (-1 < 0) haven't messed with pom, so kind of unsure where that came from. updated the intelliJ minecraft "api" plugin thing.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.30</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>```
define not readable
what patch file are you talking about ?
that is a binary patch
obviously useless
you're not suposed to be able to read it
what fork are you using that isn't open source 
sounds like a rather pesonal issue then 
go back to what
from a binary patch ?
no
inb4 trying to decompile pufferfishplus
best you'd do is decompile the patched server
GPL3 complient 
if you are planning on sueing the maintainer for it
sure
but yea, if you really wanna force it
decompile patched server jar
diff against decompiled patched paper server
hi guys
is there a way to automatically download latest build of a certain velocity version with paper api?
idk if this is the right channel since the question is about paper api but it's velocity related
Poll the API and find the latest build number for that version
are there docs somewhere?
oh found it thanks
Execution failed for task ':patchSpigotApi'.
io.papermc.paperweight.PaperweightException: Failed to apply patches
I ran applyPatches it should work right 💀
that is only the server jar
it is missing all the dependencies, the API, all the other deps
yes
but, like I said, its missing all the other stuff
like if you tried to just java -jar it, its gonna not work
what are you changing?
strings where?
where in that jar?
like what exactly are you changing?
new code? its all compiled.
Why not add a patch that changes the strings
or you could use mixins via ignite
Or something to change them at runtime
or just don't run paperclip
.
no one here is going to help you with that
also pretty sure you have the right to request the full source code anyways
adding DRM to an open source software seems tumb af
*dumb
well call your lawyer? wat
they are literally not honoring the contract they signed with you
no one here is going to help you try to bypass something
Calling lawyer or quick fixing with code. One is easier than the other 😂
No, paperclip has no mecahsnim to say not to patch the jar given that that is not a normal usecase of which makes any sense for 99.999999% of users of our software
I mean, one of those option is legal and not against Discord ToS ;)
assisting in circumventing of copyright protection is illegal and thus not allowed on this server.
Oh absolutely.
everything is copyrighted (unless an AI created it Kappa)
in which file do we define the name of those folders?
Paper-API
Paper-Server
should be in the root build.gradle file
I tried this but it didn't seem to work
for (name in listOf("Example-API", "Example-Server", "Example-MojangAPI")) {
val projName = name.lowercase(Locale.ENGLISH)
include(projName)
findProject(":$projName")!!.projectDir = file(name)
}```
oh for some reason, I thought you meant the patch folders
that is in the settings.gradle file, where you configure module
you can look at how paper does it
I am a bit clueless as to where to look?
in paper's settings.gradle file
there is also a paperweight-examples repo for a demo of making a fork
oh didn't think of that
Can you set the paperweight artifact name?
this one
oh, thank you
I can't find the file name setting, I've been trying to figure this out for a while without success
oh god, didnt see the commented code... thanks
No command package found, did you mean:
Command jpackage in package openjdk-17
Starting org.bukkit.craftbukkit.Main
Unsupported Java detected (17-internal). You are running an unsupported, non official, version. Only general availability versions of Java are supported. Please update your Java version. See https://docs.papermc.io/paper/faq#unsupported-java-detected-what-do-i-do for more information.
don't run on an unsupported version of java
17-internal is not meant for public use
if you're trying to run java on a mobile device, don't
Why
this is also the wrong channel, move to #paper-help
hi, how can I change dev classifier to mojmap in maven publication?
whats your build file?
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
artifact(tasks.reobfJar)
artifact(tasks.jar)
}
}
}
to build and publish I run ./gradlew reobfJar publishToMavenLocal
nvm, fixed
publishing {
publications {
create<MavenPublication>("maven") {
artifact(tasks.reobfJar)
artifact(tasks.jar).classifier = "mojmap"
}
}
}
im using run-task gradle plugin, how to let runFolia can use downloadPlugins feature 🙂
Hi, I am trying to publish builds of my plugin to Hangar automatically using GitHub actions, but I am getting this error:
Run ./gradlew build publishPluginPublicationToHangar --stacktrace
Downloading https://services.gradle.org/distributions/gradle-8.1-bin.zip
...........10%............20%............30%............40%............50%............60%............70%............80%...........90%............100%
Welcome to Gradle 8.1!
Here are the highlights of this release:
- Stable configuration cache
- Experimental Kotlin DSL assignment syntax
- Building with Java 20
For more details see https://docs.gradle.org/8.1/release-notes.html
Starting a Gradle Daemon (subsequent builds will be faster)
Note: Some input files use or override a deprecated API.
> Task :compileJava
Note: Recompile with -Xlint:deprecation for details.
> Task :processResources
> Task :classes
> Task :jar
> Task :assemble
> Task :compileTestJava NO-SOURCE
> Task :processTestResources NO-SOURCE
> Task :testClasses UP-TO-DATE
> Task :test NO-SOURCE
> Task :check UP-TO-DATE
> Task :build
Error uploading version, returned 400: Bad Request
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':publishPluginPublicationToHangar'.
> Error uploading version
* Try:
> Task :publishPluginPublicationToHangar FAILED
4 actionable tasks: 4 executed
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
This is my a part of my build.gradle:
plugins {
id 'java'
id "io.papermc.hangar-publish-plugin" version "0.1.0"
}
hangarPublish {
publications.register('plugin') {
version = project.version as String // use project version as publication version
id = 'iplogin'
channel = 'Snapshot'
changelog = 'Test' // optional
apiKey = System.getenv("HANGAR_API_TOKEN")
platforms {
paper {
jar = tasks.jar.archiveFile
platformVersions = ['1.20.2']
dependencies {
}
}
}
}
}
This is my publish.yml file:
name: Publish to Hangar
on:
push:
branches:
- rewrite
jobs:
publish:
if: github.repository_owner == 'TheOnlySD12'
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Publish
env:
HANGAR_API_TOKEN: ${{ secrets.HANGAR_API_TOKEN }}
run: ./gradlew build publishPluginPublicationToHangar --stacktrace
Any help is appreciated, if any more details or files are needed please tell me.
can you run with --info
ok running now
should I put it in a gist and send it or do you want a certain part of it?
Found this:
Resolve mutations for :publishPluginPublicationToHangar (Thread[Execution worker,5,main]) started.
:publishPluginPublicationToHangar (Thread[Execution worker,5,main]) started.
> Task :publishPluginPublicationToHangar FAILED
Caching disabled for task ':publishPluginPublicationToHangar' because:
Error uploading version, returned 400: Bad Request
Build cache is disabled
Task ':publishPluginPublicationToHangar' is not up-to-date because:
Task state is not tracked.
FAILURE: Build failed with an exception.
@sleek siren
here
the structure is a mess which could be my problem but: https://github.com/Outspending/BiomesAPI
oh wait you cant access the build.log
mb
oop, i think my friend found a way
This felt like a more appropriate channel.
How much time does paperweight-test-plugin generally take to be compiled ?
depends entirely on your machine and setup
I am sitting here for 1 hr 53 minutes
Are you using WSL and crossing FS boundaries ?
I am not using wsl
Compiling it on powershell
Let's just say I've been trying to get it running for like the past two months
I tried some different solutions, trying different IDEs etc. Nothing worked
Nah not connected to one drive
I mean, you can always run gradle in debug mode to see if it gets stuck anywhere
:executing 'decompile transformed minecraft server jar'
how much memory do you have available ?
4 GB, DDR3
for the entire system ??
Yes
So do I have alternatives for this
decompiling the full server jar eats a chunk of memory
I've ran it on 4G on a mac and it works, but it is pushing it
I tried compiling fabric and quilt templates it worked tho
which likely aren't setting the memory requirement as high as we do or something
Hmm
So about this...
So I would have to use normal paper API
if you don't have an environment with the resources for paperweight to work, then yea, that's pretty much the only supported option you've got
Okay, thanks for the help!
is the java plugin necessary when using kotlin?
such as?
right, thanks
so for mache on 23w51b, looks like 9 more patches are needed for the client vs the server
ill see if i can pr 23w51a and 23w51b to the main repo, but currently it has my git history of making it work for client distrobutions
ok, got 23w51b up, skipping 23w51a
Trying to get a dependency but I'm getting this error
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find ecobits-1.8.3.jar (com.willfp:ecobits:1.8.3).
Searched in the following locations:
maven-repo
Note: maven-repo is the actual link to the repository and I've checked multiple times, it's correct
Going to the link in maven-repo downloads the correct jar
We can't really provide advice around random stuff on the internet
It's a repository I hosted, just can't share the link
it would generally imply that there is something wrong with the repo or something
We can't debug that for you
So yeah this is an issue with the repository?
generally, yes
Weird thing is that it works when I go directly to the website
generally borked metadata stuff
idk how to advise on debugging such a situation, maybe the debug flags might provide something interesting
Is it because I manually renamed the .pom file maybe?
And the jar
The jar name was EcoBits-v1.8.3.jar before but I changed it to ecobits-1.8.3.jar instead
if you renamed stuff from what maven stuff expects to find, yes
like, it's all down to the metadata
these tools are generally not just looking for the jar
they generally expect there to be some metadata there to confirm wtf it is doing
generally I just rely on nexus to create something good enough
Hmm makes sense
Do you know if the jar name should match pom name?
So this wouldn't work?
generally yes
at least least I knew
you'd need to go look at a maven repo and see what it does
otherwise, once again, see gradles debug log, maybe it gives you something useful
This is everything
:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find ecobits-1.8.3.jar (com.willfp:ecobits:1.8.3).
Searched in the following locations:
https://website/releases/com/willfp/ecobits/1.8.3/ecobits-1.8.3.jar
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 13s
1 actionable task: 1 executed
Using the --scan
how?
Other than the https://website/releases/com/willfp/ecobits/1.8.3/ecobits-1.8.3.jar
But I can confirm when I click on the actual link, it downloads the jar
Ah well yeah the jar name
I mean, your screenshot shows _v and not -
That's why I changed it by just renaming the file, but it didnt fix it
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find ecobits-1.8.3.jar (com.willfp:ecobits:1.8.3).
Searched in the following locations:
https://website/releases/com/willfp/ecobits/1.8.3/ecobits-1.8.3.jar
should be a maven metadata file there afaik
Fixed it, not idea why this works but changed the location in the repository to com/willfp/EcoBits/1.8.3/EcoBits-1.8.3.jar
https://paste.md-5.net/itafojefeg.pl i seem to be getting this while trying to open a git cloned mache project in IntelliJ, any ideas why?
Which Java Version is configured in IntelliJ for gradle?
good question give me a sec
is this the one used by gradle or is it sneaky and hiding elsewhere
At least the error message states something with Java 8 and Java 11. Try one of them.
Guess so, to be sure search for Gradle in the settings.
Try Java 17.
Mache itself is likely on 17
https://github.com/PaperMC/mache/blob/ver/1.20.4/build-logic/build.gradle.kts#L48-L65
youre gradle is using java 8
needs to be at least 11
sheesh i see i didnt even know gradle needed anything past 8
it one of the gradle plugins requiring higher i think
ahh i see that makes sense
Would go with 17.
ive never had issues with gradle java versioning before this so i was confused af 😭
yeah 17 seems to be working thank u thank u

hey, is it possible to set a common string for all submodules?
i'd like to do something like
paperDependency = "io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT"
and then use it all over the place
for that particular usecase you want a libs.versions.toml file https://github.com/PaperMC/paperweight/blob/main/gradle/libs.versions.toml
place enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") in your settings.gradle
then you can do this https://github.com/PaperMC/paperweight/blob/main/paperweight-lib/build.gradle.kts#L6
thats amazing thanks
is really still a preview? I thought they were made stable a while ago already
libs thing yes
so i've got this for my buildscript: https://hastebin.com/share/rofemaxiwi.kt
Not sure why but i keep getting error: records are not supported in -source 8 this error when compiling via ./gradlew build
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
Something somewhere is setting the java target to java 8
any suggestions on how to debug what? I can't find it visually
I mean, one would assume that it's one of the plugins you've applied.
ah, yeah so apparently indra already deals with toolchains so I don't need ot redeclare them
gotcha, thanks
How would I compile two modules into one plugin JAR with gradle. I've already achieved this with Maven via declaring my module as a repo and then importing the dependancy in the module using the previously mentioned module. I'm trying to switch to Gradle, but all google searches point to a maven dir or a flat dir pointing to again, a Maven dir
don't you just use the shadow plugin like the shade one on maven? or do I misunderstand that?
I do indeed use the shade plugin
on Maven ofcourse
I'm unfamiliar with the shade plugin on Gradle?
Also, when running gradle init in the Maven project, it does create proper urls and everything, but doesn't compile and says build script wasn't provided or something like that in the kts files
you add a dependency on each module in e.g. the root module and then shadow will combine them
so for example, I have the modules:
- ontime-core
- ontime-sponge
- ontime-paper
- ontime-velocity
and then put this in my root build.gradle.kts:
// for uber jar
dependencies {
runtimeOnly(project(":ontime-paper"))
runtimeOnly(project(":ontime-sponge"))
runtimeOnly(project(":ontime-velocity"))
}
(core is included automatically because it is added to the runtime configuration of each module above)
so I would do just
dependancies {
runtimeOnly(project(":core"))
}
?
how will gradle know what I am refering to?
right now the core module looks like this
its in the same projects directory as all other plugin projects
(the defualt IDEA one)
its that easy?
yes?
yeah it's literally just the name of your module
wtf
that sounds way to easy
I trust you, but my brain can't comprehend this being easy
(the real question is: how refer to it by a different name for whatever reason? xD)
as long as I can import it, I'm cool
and shade it ofcourse
thanks for the help guys
says it doesnt exist
do I have to have gradle scripts in the core as well?
welp, IntelliJ cache at it again, I got a 1 year old bug
and the only way to fix it is to invaldiate caches/deleting .idea :/
btw, just letting you know, but the naming convention for projects is kebab-case usually
not camel
ye I read trough the docs that before
I'm afraid I'll break some stuff if I rename
currently i'm figuring out how to use the shadowJar
easier now than after you publish
technical debt is a thing
and changes get harder over time
but yeah this is a minimal thing
It's not a public plugin
i think the shadow plugin docs are out of date
I'm seriously considering just dropping Gradle all together
the docs suck ass, error messages tell me nothing and shadow jar guide is made for Groovy
Just press on next page.
Had no problems with shading.
Yeah no....
Thanks for the help guys, but this is an inferior build tool to me. The speed may be better, but setup, settings and the thing that made me quit was "Go to declaration" in IntelliJ stright up doesnt work with gradle. I'm going to stick with Maven. I wanted to use paperweight, but I guess thats not happening anytime soon.
Go to declaration works perfectly. No clue what problems you have with it. 🤷♂️
It takes me to the compiled code which just shows the function name and what it returns
So you just missed downloading sources and documentation.
i've spent the last three fucking hours on this and have gotten nowhere. It took me about 30 minutes to setup everything with Maven
It's my own project
i have it opened locally
and yet it takes me to the compiled code
Yeah you're right, you probably should stay with maven.
what do you need to know about shadowjar
because it's usually not much more than just adding the plugin and maybe excluding some dependencies lmao
I made it work
it shadowed as expected
but one thing I can't stand changing is my workflow
intelliJ's "Go to declaration or usages" is a must for me
if it goes to the compiled code instead of the module, that doesnt help a thing
There is a download sources button in the gradle tab, just like the maven tab
so what you're saying is, if I click that, then when I go to the declaration it takes me to the file which saves upon editing?
upon testing a little bit (with Maven), it produces the same problem if the module isn't present. Thing is, I can't import the module when Gradle is in use because it's already imported
could be an IntelliJ bug however
how is the module you're adding as a dependency published?
are you sure it's being published correctly? I've never had any issues in years with go to source (I use it all the time)
Sorry if this sounds dumb, but do I have to publish it in order to use it?
I disabled the publishers, because I thought they were being published publicly
well yeah: either the module is in the same project, or it has to be published
you can publish it to:
- mavenCentral (public)
- mavenLocal (private to your user)
- some other private but remote repository (sonatype nexus instance e.g.)
- some other public repo
Do I even have to use the project() to get the module?
or can I just do implementation(libs.tectoniccore.tectoniccore)
or would api be better in this case?
it’s in your project stuff no?
use project
could also use projects.techtonicCore if you have it enabled
project stuff as in what? the same directory as the root, the no
to give you an idea
then if you declare stuff in the libs thingy then yes, you would depend on it as an external thing
implementation means that it should not be exposed, api means that it should be considered part of the API of the dependency
I am a bit confused because I'm looking at the local repo and it hasn't updated since yesterday
oops wrong folder
plugins {
`java-library`
`maven-publish`
id("com.github.johnrengelman.shadow") version "8.1.1"
}
repositories {
mavenLocal()
mavenCentral()
maven {
url = uri("https://repo.papermc.io/repository/maven-public/")
}
maven {
url = uri("https://repo1.maven.org/maven2/")
}
maven {
url = uri("https://repo.dmulloy2.net/repository/public/")
}
maven {
url = uri("https://repo.maven.apache.org/maven2/")
}
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-beta.19")
api(libs.com.zaxxer.hikaricp)
// compileOnly(libs.mysql.mysql.connector.java)
compileOnly(libs.com.comphenix.protocol.protocollib)
compileOnly(libs.io.papermc.paper.paper.api)
}
publishing {
publications.create<MavenPublication>("maven") {
from(components["java"])
}
}
group = "TectonicCore"
version = "1.0"
description = "TectonicCore"
java.sourceCompatibility = JavaVersion.VERSION_17
wait
okay I realised my mistake
I was using the publish task instead of publishToLocal
okay, I've changed the groups and names as is standard. My go to declaration works (it says I'm in reader mode or something like that). It compiles with changes from both modules making this case closed :D. Thanks for the help everyone.
Just one extra question. ShadowJar docs say it shadows all dependancies, but the file size is the same as with Maven shading only specific dependancies? ShadowJar task:
dependencies {
api("net.tectonic:tectonic-core:1.0.0")
api(libs.com.zaxxer.hikaricp)
compileOnly(libs.io.papermc.paper.paper.api)
compileOnly(libs.mysql.mysql.connector.java)
compileOnly(libs.com.comphenix.protocol.protocollib)
compileOnly(libs.com.viaversion.viaversion.api)
}
tasks.shadowJar {
archiveBaseName.set("Excavators")
archiveClassifier.set("")
archiveVersion.set("")
}
Excellent
ShadowJar, by default, shades dependencies on the runtime classpath
So if you have the paper api, for example, as a compileOnly, it won’t be shaded since that doesn’t add it to the runtime classpath, only the compile time classpath
yeah I figured so, the compiled jar would be otherwise much larger
When creating plugin for paper using the paperweight userdev example it is possible to start the server using the runServer gradle Task provided by xyz.jpenilla.run-paper. My problem now arises when i stop/restart the server through intellij as the build is instantly cancelled and the server is not shutting down properly. Thus for example my onDisable method is never called. Is there any way t o configure that? or at least run /stop on the server, wait 5 sec and then restart the task?
all you can do is run stop
gradles "stop" mechanism does not allow for a graceful shutdown as-is is my understanding
Thats not great 😦 In maven this was possible iirc
On the upside, this simulates a server crash nicely, which you need to handle anyways ^^
hey, am trying to add paper nms into my project, found the git but am using maven in my project so how would I use the gitclone in my project? since the available one is in gradle.
We do not support maven
We don't support maven
aww, if I use the spigot nms it will cause nightmares I assume? 😐 so gotta go gradle ? 😦
That's what we recommend, yes
alr
Any Idea how i could detect that?
hello there!
i was wondering if anybody has any experience using the paperweight userder plugin in a jenkins environment?
i am working for a server and we are currently updating our projects from 1.9 to 1.20
we also have a custom fork of paper 1.20 and we need to reference internal minecraft code in our plugins, so it only made sense to use the userdev gradle plugin
we have some ci-cd pipelines set up with jenkins to automatically build and deploy the code, but i think our build times will skyrocket given that the paperweight caches will not be kept between builds
advice would be greatly appreciated!
are you deleting the workspace between runs?
either way, https://github.com/PaperMC/paperweight/pull/187
enable shared caches in the worker's gradle user home
it seems that would be the case
pipeline is setup to clone the repo every time a build is triggered
it shouldn't be as necessary to wipe things as with maven, but there's reasons to do it anyways tbh (in CI)
just enable the shared caches for the jenkins worker user and forget about it basically
i see
thanks!
i thought i was gonna have to do some trickery to copy the cache every time we build
😅
thanks a lot!
did you add the library that adds the implementation configuration?
you need to apply the plugin that adds that configuration to subprojects
usually I do apply(plugin=), I suppose that might be the same as plugins.apply(), tho idk
still error
not a dependency
implementation is not a default configuration afaik
that is added with the java gradle plugin
I want to add fastutil
all your subprojects need the java plugin
but there is no fastutil plugin
Once again
Not that
it is not fastutil that is the issue
you need the java plugin in order to have the "implementation" configuration to be able to add java libraries to said configuration
as said, apply the java plugin
I don't know how to apply it..
.
I'm really sorry, but I don't know what that saying
What exactly is apply?..
I can't help atm
I'm completely misunderstanding something
yes, you are misunderstanding how gradle works
posting 5 lines without context also doesn't help
Isn't this a problem that can be solved by installing an external plugin like lombok?
I don't know what to understand first 😵💫 😵💫
😢
you just need to apply the java gradle plugin the the gradle module where you want to apply the fastuitl thing, lol
at the top of the build.gradle.kts file there should be a section for plugins definitions
something like this
ohh
in order to have acces to the 'implementation' dependency configuration, which your project needs, you need to have the 'java' plugin
this tells gradle that youre working with java and youre trying to resolve java dependencies
you can read more here
https://docs.gradle.org/current/userguide/plugins.html
i get the idea you're new to gradle
here is the official tutorial: https://docs.gradle.org/current/userguide/getting_started_eng.html
you probably don't need to read the whole thing right now, but keep it as future reference
https://docs.gradle.org/current/userguide/java_library_plugin.html#java_library_plugin this is the implementation plugin
right?
I think this usage is wrong
or I wrong
you probably don't need the java-library plugin if your project isn't a library or api
for most cases 'java' should suffice
you think you could show a copy of your build file?
you mean build.gradle.kts?
yeah
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.
The exact problem is
error: package it.unimi.dsi.fastutil.doubles does not exist
import it.unimi.dsi.fastutil.doubles.DoubleArrayList;
that seems like a multiple module project
yeah
why don't you just add the dependency to the shared project?
yes?
gimme a sec to verify, im waiting for my intellij to properly import the project 😂
in which class exactly are you getting this issue?
in BukkitPlatform
I customized..
alright
there are 2 options you have right now
you can either add the fastutil dependency just for the bukkit sub-project
or you can make it available for all the sub-projects
i went with the second option
in order to do this you have to find the tab.base-conversions.gradle.kts file
then you have to add the dependency in the file like this:
here's the code for easy pasting:
dependencies {
implementation("it.unimi.dsi:fastutil:8.5.12")
}
I've been looking for some weird build.gradle.kts, thanks buddy!
after adding the dependecy there you'll be able to use it in your code
Damn
👍
good luck and happy coding! 😋
just did a clean build of paper, ran ./gradlew applyPatches with no modifications and I'm getting this error
Task :applyServerPatches
Creating Paper-Server from remapped source...
Importing 257 classes from vanilla...
Importing 5 data files from vanilla...
Importing 9 classes from library sources...
error: open(".gradle/caches/paperweight/mc-dev-sources/data/minecraft/datapacks/update_1_21/data/minecraft/advancements/recipes/building_blocks/waxed_exposed_chiseled_copper_from_waxed_exposed_copper_stonecutting.json"): Filename too long
error: unable to index file '.gradle/caches/paperweight/mc-dev-sources/data/minecraft/datapacks/update_1_21/data/minecraft/advancements/recipes/building_blocks/waxed_exposed_chiseled_copper_from_waxed_exposed_copper_stonecutting.json'
fatal: adding files failed
> Task :applyServerPatches FAILED
so can you just not build paper on windows because the file paths are too long?
isn't there some setting or something? I forget, but I thought there was some way around it
I think just using WSL fixes it
fixed it by regedit & had to change git config to allow longer paths
what's the intended way to mix patches from different paper forks?
there is no intended way, that's a you thing to deal with, welcome to git, etc
how do i shadow the reobf jar?
you can depend on the reobf configuration when you declare you dependency on another module
ohh, i see. Thank you
Randomly now Successfully created project 'Database' on GitHub, but initial commit failed: gpg: skipped "AlbusThePenguin ": No secret key gpg: signing failed: No secret key gpg failed to sign the data failed to write commit object why does it randomly sometimes require secret key? I have other projects that have the exact same settings.
you've given next to no context but in general gpg signing can be enabled gloablly or per-repo
Yea, have really no context to give as I bearly understand what's happening. I can't locate the folder all of the sudden my GnuPG folder just vanished after a windows update (I think?) 😂
oof
if it was imported properly it will be inside of the "external dependencies" inside of IJ
also that's the wrong import
Maybe I didn't download it properly
apparently when I added my new project to github it got added strangely out of order due to an error in initial commit.
how would I go about sorting that out?
do I just delete the github repo and reupload?
Out of order in what way?
I just purged it and readded it back in, have had to reinstall the entire gpg system, so thats fun and caused some initial issues with that one.
what is the paper 1.20.1 build number?
dont crosspost
Guys I am trying to compile a folia plugin but I get this error: Script compilation error:
Line 195: copyJar.get().dependsOn(jar)
^ Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public inline operator fun <K, V> Map<out TypeVariable(K), TypeVariable(V)>.get(key: TypeVariable(K)): TypeVariable(V)? defined in kotlin.collections
public operator fun MatchGroupCollection.get(name: String): MatchGroup? defined in kotlin.text
public operator fun <T : Any> NamedDomainObjectCollection<TypeVariable(T)>.get(name: String): TypeVariable(T) defined in org.gradle.kotlin.dsl
public operator fun ExtensionContainer.get(name: String): Any defined in org.gradle.kotlin.dsl
public inline fun <S : Any, T : SoftwareComponent> BinaryCollection<TypeVariable(T)>.get(type: KClass<TypeVariable(S)>, spec: Spec<in TypeVariable(S)>): BinaryProvider<TypeVariable(S)> defined in org.gradle.kotlin.dsl
1 error
Code:
https://hastebin.com/share/tusuxawadi.kotlin
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
I mean, it's telling you the issue straight up
one would maybe guess to get it from tasks
do you mean --task option
No
I don't know to fix it though
I can't write the exact answer foryou
can you atleast guide me its the only error
I think it is a syntax issue but not sure
I'm not a gradle pro, and have generally said what I can
if you don't understand gradle I can't really help
what did you mean by tasks?
the tasks container
where to see that
Literally, just move your dependsOn thing into where you define the copyJar task
import net.minecrell.pluginyml.bukkit.BukkitPluginDescription
import net.minecrell.pluginyml.paper.PaperPluginDescription
plugins {
kotlin("jvm") version "2.0.0-Beta2"
id("net.minecrell.plugin-yml.paper") version "0.6.0"
}
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT")
}
paper {
// Default values can be overridden if needed
// name = "TestPlugin"
// version = "1.0"
// description = "This is a test plugin"
// website = "https://example.com"
// author = "Notch"
// Plugin main class (required)
main = "xyz.seventwentyseven.nyan.Nyan"
generateLibrariesJson = true
// Mark plugin for supporting Folia
foliaSupported = true
// API version (Needs to be 1.19 or higher)
apiVersion = "1.20"
}
tasks.jar {
// Include the plugin.yml file in the jar
from(project.file("src/main/resources/plugin.yml"))
into("")
}```
so that's it
I tried both things to include plugin.yml
the plugin-yml plugin won't put the generated file in the resources folder, or, not like that at least
so you should get rid of that jar task configuration at the bottom
yeah no don't do that
that does not use gradle
you need to use gradle, on intellij you'll find a gradle icon somewhere on the right/left side
then you'll see tasks -> build; or alternatively run gradle on a terminal, ./gradlew build
do with intelij its possible to make that i don't need to compile->put in plugin folder->reload server but code that i write i can instantly test it ?
Take a look at the Gradle run paper plugin
It's also mentioned on our docs in the dev setup page iirc
do its the note about run task ?
Ye
@bronze ember #paper-contrib message
I mean I started 24w... On my Mache fork for clients, but got distracted by my flat going out to drink.
Is there interest in me pr-ing the branch I had to do to make it work for clients, or is official mache staying server-only
(he went to bed)
Ah ok
Idk if that's something we care about
And for mache Gradle stuff in particular we first need to move that to a proper repo instead of having it in the buildsrc
but when i add code it don't update on server



