#build-tooling-help

1 messages · Page 6 of 1

bleak lark
#

the JAR below

#

once i delete it, it works

lament scarab
#

yes, because the all artifact is the one which actually has everything inside if it

olive current
#

You can set the archive classifier in shadowjar if u absolutely don’t wanna use the runpaper plugin

lament scarab
#

don't

#

use a copy task

bleak lark
#

i set it to automatically export to the plugin folder, thats why i forgot about it

lament scarab
#

don't break gradle

bleak lark
#

copy task from build/libs to plugin folder?

#

run after build

lament scarab
#

yes, you create a task which copies the output of shadowJar

#

See pins

bleak lark
#

yes thank you

odd tulip
#

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

lament scarab
#

No

bronze willow
brave widgetBOT
lament scarab
#

exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 64

#

I'm going to guess

#

unsupported java version

bronze willow
#

I just was tweaking around with my git project, it worked 10minutes before

lament scarab
#

Okay

#

Like, you can take in what I've said, or you can play the "just" card, your perogative

bronze willow
#

Okay then im going to investigate what i broke with my java version

#

What's the "best" java version for gradle?

lament scarab
#

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

bronze willow
#

weird question but how do i use the wrapper?

olive current
#

Gradle wrapper?

#

On intellij i think it’s in settings and under gradle u can choose gradle wrapper

#

Settings or project structure

bronze willow
#

Is that default or do i have to do it manually?

lament scarab
#

default

bronze willow
#

Thats what i thought

lament scarab
#

but IJ uses its own gradle copy when creating a project which last I knew as kinda old

verbal skiff
distant mango
#

has been since like forever

verbal skiff
#

don't make me feel old

#

i remember this not being a thing

bronze willow
brave widgetBOT
distant mango
#

add the java plugin thing

#

check papers settings.gradle.kts

bronze willow
distant mango
#

syntax will work

#

it’s the plugin you need

#

i’m guessing at least

bronze willow
#

plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '8.0.0'
}

and the java plugin is there

distant mango
#

no

bronze willow
#

?

distant mango
#

to your settings.gradle

bronze willow
#

the whole file, or just the one line?

distant mango
#

the line

bronze willow
brave widgetBOT
distant mango
#

in the plugins block

lament scarab
#

do note that they're using groovy

bronze willow
brave widgetBOT
distant mango
lament scarab
#

and are allergic to reading

distant mango
#

send your file here

bronze willow
#

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?

floral whale
#

Does anyone know how to use something like secrets on github on private repositories without paying for GitHub premium or whatever it is

distant mango
#

secrets work just fine on github private repos?

floral whale
#

Yeah but requires payment...

#

On organization level at least

#

Which sucks

distant mango
#

add them on the repo itself

floral whale
#

Is that free?

distant mango
#

yes

floral whale
#

It's a private repository inside a organization

distant mango
#

yes

cinder ember
#
 <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)?

smoky violet
#

I think shadow has a transformer that can merge manifests

cinder ember
#

Believe it or not I understood nothing from the sentence you just typed

coarse ginkgo
#

why are there two decompile tasks in paperweight if the remapped output of spigotDecompileJar is already used in the final Something-Server sources?

lament scarab
#

Because spigots patches need the spigot decompiler

#

for stuff we only touch, we use a better decompiler

magic hearth
#

hi so when i try to build my plugin it fails

#

this is the error

#

heres my settings.gradle.kts

#

and my build.gradle

lament scarab
#

Caused by: io.papermc.paperweight.PaperweightException: Failed to resolve dev bundle

magic hearth
#

yes

lament scarab
#

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

magic hearth
#

ok thanks

coarse ginkgo
#

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 💀

finite crow
#

@ 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?

devout crescent
#

Working in Iran is more cancerous, because you have to bypass both US restrictions and internet censorship

coarse ginkgo
limpid heart
#

well, considering that specific error is for javadoc generation, maybe you can get away with it by disabling any javadoc tasks?

grand niche
#

you can use the --no-platform-links javadoc tool option to disable platform linking entirely or supply alternate URLs via --link-platform-properties

smoky violet
#

if you don't care about javadoc at all can just -x javadoc for the gradle incovation

finite crow
#

noted

devout crescent
#

سامانه «شکن» یک تحریم شکن ایرانی و قانونی است که امکان دسترسی به سایت های تحریم شده را بدون نیاز به ابزارهای ناقض حریم خصوصی و امنیت مانند فیلترشکن، وی پی ان و پراکسی به آسانی و برای استفاده شخصی به رایگان فراهم می‌کند

elfin salmon
#

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

distant mango
#

what isn’t working

odd tulip
#

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

elfin salmon
#

I cant import it ore use it

#

oh sorry for the ping

olive current
#

How are you trying to use it? @elfin salmon

elfin salmon
#

@olive current

olive current
#

?paste

echo kilnBOT
#

Please send large files/logs to a pastebin

elfin salmon
#

thx for your help

olive current
#

You have to sync gradle

verbal skiff
quick thicket
lament scarab
#

the jar

quick thicket
#

thanks

verbal skiff
#

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

smoky violet
#

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

verbal skiff
verbal skiff
lament scarab
#

gradlew module:publish

verbal skiff
#

afaik you guys don't publish PR apis

verbal skiff
#

I'm thinking of setting up an action that auto-mirrors select PRs and publishes them...

#

maybe another day

smoky violet
#

you should change the version to something that gradle and maven won't select over an actual build

#

or change the group id

verbal skiff
#

thats probably not a bad idea

#

for now I've just moved the repository declaration up to the top

smoky violet
#

that's exactly the issue, if someone has your repo at the top they will unintentionally get your builds

verbal skiff
#

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

smoky violet
#

gitpatcher moment?

#

you can see quiet-loom on my github for an example use with workflows

verbal skiff
#

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

odd tulip
#

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

odd tulip
#

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

bronze ember
#

Just develop the UI outside of the plugin? Lol

odd tulip
#

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

lament scarab
#

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

teal helm
#

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)

static urchin
#

are you using gradle 8.5 ?

teal helm
static urchin
#

Yea 👍

teal helm
static urchin
#

we bumped to gradle 8.5 and our build script now uses features that became stable in 8.4

#

gradle 8.1 hence fails

teal helm
#

ah ok

odd tulip
lament scarab
#

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

odd tulip
#

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

gentle viper
#

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

granite valve
#

you on windows?

#

you can try working in the wsl environment, I think that fixes that issue?

agile skiff
#

or enable long paths

#

i think there is also a git config option you need to change after enabling them

#

but wsl is recommended

floral whale
#

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")
        }
    }
prime cliff
floral whale
#

That's what I want to avoid doing though

lament scarab
#

you can also inject them as env variables iirc, you just need to use the correct convention

floral whale
#

To use the secrets instead of the properties

#

Otherwise it would be useless to use the secrets

floral whale
prime cliff
lament scarab
#

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

floral whale
floral whale
lament scarab
#

..

floral whale
#

Or what

#

Bruh sry

#

Im dumb

lament scarab
#

what do you thing an "env" is setting

floral whale
#

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

static urchin
#

(for that example)

floral whale
#

Oh... I thought it was local environment variables... That's why it didnt make sense to me

#

Thank you

static urchin
#

local?

floral whale
#

As in windows environment variables

static urchin
#

i mean

#

it can also be that

#

but that is on your PC

#

you can rn go into your windows environment variable

floral whale
static urchin
#

set ORG_GRADLE_PROJECT_blahUsername and the other one

#

and now your local gradle runs would pull from there

floral whale
#

Is it litterally ORG_GRADLE_PROJECT?

static urchin
#

what

#

ORG_GRADLE_PROJECT_blahUsername

#

literally this but instead of blah your repo

#

literally

floral whale
#

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")
        }
    }
floral whale
static urchin
#

I mean

#

obviously you didn't literally run that

#

right ?

#

ORG_GRADLE_PROJECT_blahUsername: "MAVEN_NAME"

#

like

floral whale
#

Everything except blah yeah

static urchin
#

"MAVEN_NAME"

#

bro

floral whale
#

That's the secret name tho lol

#

Thought that was what it's supposed to be

static urchin
#

you obviously replaced that with ${{ secrets.MAVEN_NAME }}

#

righttt?

floral whale
#

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

static urchin
#

I

#

let me grab my spoon

floral whale
static urchin
#

it fucking isn't

floral whale
#

Huh? Why not? It references the variables defined above

static urchin
#

no

#

it doesn't

#

this is not java

#

this is yaml / golang templating syntax

floral whale
#

I thought it worked like this lol

String mavenSecret = ${{ secrets.MAVEN_NAME }}
ORG_GRADLE_PROJECT_summitPrivateUsername: mavenSecret 
#

mb

static urchin
#

Yea no, you are in a completely different language

floral whale
#

Oh yeah kinda forgot this is yaml lmao

#

Sry

static urchin
#

kekwhyper no worries

floral whale
#

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?

floral whale
#

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
distant mango
#

also had the wrong env names

#

it’s looking for blahUsername and you have summitPrivatre whatever

pliant knoll
#

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
lament scarab
#

mache solely exists to generate a clean set of compilable sources from the vanilla server

pliant knoll
#

wait thats fine for my use case tho

lament scarab
#

it's not intented for anything outside of that, that would be on you to provide, essentially

pliant knoll
#

i just want to get the source for the vanilla server and modify it

lament scarab
#

Yes, but it's not exactly intended for that

pliant knoll
#

ah i see

#

is there something else i should use for it or-

lament scarab
#

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

pliant knoll
#

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

lament scarab
#

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

pliant knoll
#

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

distant mango
#

it’s not used yet

lament scarab
#

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

pliant knoll
#

huh interesting

paper kestrel
#

which was quite nice

lament scarab
#

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

paper kestrel
#

For servers right? Since the launcher does the class path for client

quiet axle
#

Not sure why im getting this error. the repo and plugin is there.

#

i moved the dependencies block and it worked shrug

verbal skiff
quiet axle
#

i had clicked it a few times but

#

¯_(ツ)_/¯

grizzled nebula
#

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...

static urchin
#

running what ?

#

mostly screams you are not using gradle

#

what are you even trying to do

grizzled nebula
#

Trying to compile a server jar

#

I have gradle installed pretty sure

static urchin
#

and whaat are you specifically running

#

What command

grizzled nebula
#

I am not sure i think it is build or smt

static urchin
#

what do you mean you are not sure

#

what are you doing to get that result

grizzled nebula
#

Running the IntelliJ build thing

#

I am new to Gradle (Started today a hour ago lol)

static urchin
#

And what project is this ? I presume just paperweight-examples ?

grizzled nebula
#

Its a fork of paper

#

With some patches

static urchin
#

Does your intellij have the project linked as gradle

#

e.g is there the gradle tab on the right side of your intellij

grizzled nebula
#

yep its there

static urchin
#

I mean, that looks good in your intellij ?

#

just run the task applyPatches

#

in the task folder

grizzled nebula
#

paperweight/applyPatches?

static urchin
#

ye

grizzled nebula
#

Its running

static urchin
#

Give it some time 👍

grizzled nebula
#

I'll let you know when it finishes

grizzled nebula
# static urchin Give it some time 👍

corrupt patch at line 61

could not build fake ancestor

Execution failed for task ':applyServerPatches'.

io.papermc.paperweight.PaperweightException: Failed to apply patches

static urchin
#

make sure you are using the correct decompiler in that project then

quiet axle
#

using paperweight user-dev i cant use the dev jar right

#

how do i get a normal one?

#

oh its the reobfjar task right

granite valve
#

correct

lament scarab
#

well, the relocation didn't run

#

so, all one can guess is that you didn't build it with maven properly

distant mango
#

how are you building it

#

how are you building it

lament scarab
#

I mean, on the surface, that just looks like you used the IDEs build artifacts thing

distant mango
#

the plugin

#

how do you get the jar

lament scarab
#

which is not maven

#

and will not use mavens config outside of some basic configuration aspects

#

use the maven tool window

gloomy steeple
#

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?

distant mango
#

on the right side

#

of intellij

#

what does it say

#

exactly

lament scarab
#

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

lament scarab
#

I mean, it's saying that it failed to create the artifact which is actually shaded

#

so, yea, maybe you should care about it

verbal skiff
#

maven moment

#

it should work, you're probably missing something

#

but most of use gradle, so idk

#

I can't help with maven

olive current
#

Something about your java version

#

65 is java 21

prime cliff
#
  1. The shadow version is outdated -> 8.1.1 or something is the latest
  2. Shadow doesn't support Java 21 currently
grizzled nebula
#

Hello, what do I run to get the server JAR

static urchin
#

createReobfPaperclipJar

grizzled nebula
#

Just got hit with a bunch of errors

echo kilnBOT
#

Please send large files/logs to a pastebin

grizzled nebula
#

These are warnings

static urchin
#

ah

#

Yea ignore those kekwhyper

grizzled nebula
#

100 warnings fr?

static urchin
#

Well, a lot of API stuff is deprecated

#

but the server has to call them

#

so plugins don't sob

grizzled nebula
#

Ah alr alr

#

lol

#

Okay the createReobfPaperclipJar is finished running

#

I can't find the JAR tho 💀

prime cliff
#

$projectRoot/build/libs/

grizzled nebula
#

👍

#

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

lament scarab
#

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

shadow compass
#

how do i make it that when i compile my plugin with gradle it puts it in the plugins folder of my server?

lament scarab
#

Pins

granite valve
#

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

proud jay
#

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)

#

.

distant mango
#

what do you need it for

#

but probably see pins

verbal skiff
#

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

verbal skiff
#

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:

shy sage
#

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...

quaint raven
shy sage
#

Package names are censored. ;-;

quaint raven
#

Is the Events class in the same gradle module as the plugin class?

shy sage
#

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")

quaint raven
#

Then it should work fine... do you use /reload or PlugMan or smth like that?

shy sage
#

Nope. Absolutely not. I just restart.

#

Neither is plugman or /rl a good choice.

quaint raven
#

Yea, I just made sure it's not some reload bug

shy sage
#

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).

quaint raven
#

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/

shy sage
#

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...

quaint raven
#

You can add a CopyTask to copy the file.

shy sage
#

in build/libs/

shy sage
#

Or upload directly if using a VPS

quaint raven
shy sage
#

weird jdk version? 🤔

#

Welp, not shadowing the jar will problemate Commodore itself...

smoky violet
#

don't bother with commodore when using cloud on modern versions

shy sage
#

?

#

Using cloud also made the same error.... So... Now I'm even more confused...

shy sage
#

Tho I thought we removed it (I mean either me or the other dev)

#

Alright I somehow fixed it. Now onto having other issues with Commodore. YUPIEEE

shrewd lynx
#

Execution failed for task ':patchSpigotApi'.

io.papermc.paperweight.PaperweightException: Failed to apply patches

#

I ran applyPatches it should work right 💀

sand wagon
#

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

bronze ember
#

try printing the stacktrace

#

but thats some internal java compiler error

sand wagon
#

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
bronze ember
#

lombok

#

yeah ok now I understand why your compiler is unhappy 😂

sand wagon
#

Oh

#

my god

bronze ember
#

seems like lombok is incompatible with your jdk or something

#

on the action

sand wagon
#

I'm not gonna get into the lombok disagreement we had lmao

bronze ember
#

idk about locally, need to look at the patchedSourcesJar

bronze ember
sand wagon
#

not here, I mean with the people who work on this plugin

#

I hate lombok so much

left sapphire
#

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

sand wagon
#

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

bronze ember
#

I call that a big W

#

^^

void hill
#

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>```
static urchin
#

I mean, the patches should make sense ?

golden seal
#

define not readable

static urchin
#

what patch file are you talking about ?

#

that is a binary patch

#

obviously useless

golden seal
#

you're not suposed to be able to read it

static urchin
#

what fork are you using that isn't open source skully

#

sounds like a rather pesonal issue then kekwhyper

#

go back to what

#

from a binary patch ?

#

no

golden seal
#

inb4 trying to decompile pufferfishplus

static urchin
#

best you'd do is decompile the patched server

static urchin
#

if you are planning on sueing the maintainer for it

#

sure

golden seal
#

yeah take that up with a lawyer otherwise no one gives a shit

#

no

static urchin
#

but yea, if you really wanna force it

#

decompile patched server jar

#

diff against decompiled patched paper server

cinder ember
#

hi guys

rapid fractal
kind garden
#

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

lament scarab
#

Poll the API and find the latest build number for that version

kind garden
#

oh found it thanks

shrewd lynx
#

Execution failed for task ':patchSpigotApi'.

io.papermc.paperweight.PaperweightException: Failed to apply patches
I ran applyPatches it should work right 💀

lament scarab
#

well, yes, it should work

#

but it apparently did not

granite valve
#

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.

paper kestrel
#

Why not add a patch that changes the strings

granite valve
#

or you could use mixins via ignite

paper kestrel
#

Or something to change them at runtime

glass sable
#

or just don't run paperclip

distant mango
#

what are you trying to do

#

or rather why

#

okay

#

gl

glass sable
#

pretty sure paper doesn't have that

#

;)

paper kestrel
#

.

distant mango
#

no one here is going to help you with that

glass sable
#

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

distant mango
#

no one here is going to help you try to bypass something

torn sonnet
#

Calling lawyer or quick fixing with code. One is easier than the other 😂

lament scarab
#

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

glass sable
#

I mean, one of those option is legal and not against Discord ToS ;)

bronze ember
#

assisting in circumventing of copyright protection is illegal and thus not allowed on this server.

glass sable
#

everything is copyrighted (unless an AI created it Kappa)

bronze ember
#

cool

#

sue them

#

this topic ends here

austere pivot
#

in which file do we define the name of those folders?
Paper-API
Paper-Server

granite valve
#

should be in the root build.gradle file

austere pivot
#

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)
}```
granite valve
#

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

austere pivot
#

I am a bit clueless as to where to look?

granite valve
#

in paper's settings.gradle file

#

there is also a paperweight-examples repo for a demo of making a fork

austere pivot
jovial jetty
#

Can you set the paperweight artifact name?

distant mango
#

pins

#

nvm

echo kilnBOT
distant mango
#

this one

jovial jetty
#

oh, thank you

#

I can't find the file name setting, I've been trying to figure this out for a while without success

paper kestrel
jovial jetty
#

oh god, didnt see the commented code... thanks

deep lichen
#

No command package found, did you mean:
Command jpackage in package openjdk-17

golden seal
#

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

deep lichen
#

Why

golden seal
deep lichen
#

Kej

#

Okej

sharp trellis
#

hi, how can I change dev classifier to mojmap in maven publication?

bronze ember
#

whats your build file?

sharp trellis
#
publishing {
    publications {
        create<MavenPublication>("maven") {
            from(components["java"])

            artifact(tasks.reobfJar)
            artifact(tasks.jar)
        }
    }
}

to build and publish I run ./gradlew reobfJar publishToMavenLocal

sharp trellis
#

nvm, fixed

publishing {
    publications {
        create<MavenPublication>("maven") {
            artifact(tasks.reobfJar)
            artifact(tasks.jar).classifier = "mojmap"
        }
    }
}
plucky bramble
#

im using run-task gradle plugin, how to let runFolia can use downloadPlugins feature 🙂

eternal jacinth
#

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.

distant mango
#

can you run with --info

eternal jacinth
#

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.
smoky violet
#

@sleek siren

north geyser
#

here

#

oh wait you cant access the build.log

#

mb

#

oop, i think my friend found a way

lament scarab
true burrow
#

This felt like a more appropriate channel.
How much time does paperweight-test-plugin generally take to be compiled ?

static urchin
#

depends entirely on your machine and setup

true burrow
static urchin
#

Are you using WSL and crossing FS boundaries ?

true burrow
#

Compiling it on powershell

static urchin
#

one drive synced or some bs ? ¯_(ツ)_/¯

#

windows loves to do stupid things

true burrow
#

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

true burrow
static urchin
#

I mean, you can always run gradle in debug mode to see if it gets stuck anywhere

true burrow
#

:executing 'decompile transformed minecraft server jar'

static urchin
#

how much memory do you have available ?

true burrow
#

4 GB, DDR3

static urchin
#

for the entire system ??

true burrow
#

Yes

static urchin
#

Yea that might very well be your issue

#

that is cutting it very very close

true burrow
#

So do I have alternatives for this

lament scarab
#

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

true burrow
#

I tried compiling fabric and quilt templates it worked tho

lament scarab
#

which likely aren't setting the memory requirement as high as we do or something

true burrow
#

Hmm

true burrow
lament scarab
#

No, basically

#

all I can suggest is looking to see if you're paging like crazy

true burrow
#

So I would have to use normal paper API

lament scarab
#

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

true burrow
#

Okay, thanks for the help!

rustic reef
#

is the java plugin necessary when using kotlin?

lament scarab
#

Well, no

#

but it generally includes some stuff you might want

rustic reef
#

such as?

rustic reef
#

right, thanks

paper kestrel
#

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

paper kestrel
#

ok, got 23w51b up, skipping 23w51a

floral whale
#

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

lament scarab
#

We can't really provide advice around random stuff on the internet

floral whale
#

It's a repository I hosted, just can't share the link

lament scarab
#

it would generally imply that there is something wrong with the repo or something

#

We can't debug that for you

floral whale
#

So yeah this is an issue with the repository?

lament scarab
#

generally, yes

floral whale
#

Weird thing is that it works when I go directly to the website

lament scarab
#

generally borked metadata stuff

#

idk how to advise on debugging such a situation, maybe the debug flags might provide something interesting

floral whale
#

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

lament scarab
#

if you renamed stuff from what maven stuff expects to find, yes

#

like, it's all down to the metadata

floral whale
#

Gradle just couldn't find the jar when the version contained v

#

as in v1.8.3

lament scarab
#

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

floral whale
#

How can I generate the correct pom with just the jar?

#

Or is that even possible?

lament scarab
#

generally I just rely on nexus to create something good enough

floral whale
#

Hmm makes sense

#

Do you know if the jar name should match pom name?

#

So this wouldn't work?

lament scarab
#

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

floral whale
#

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

lament scarab
#

Well, I mean

#

that screenshot doesn't match the other one

floral whale
#

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

lament scarab
#

I mean, your screenshot shows _v and not -

floral whale
#

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
distant mango
#

should be a maven metadata file there afaik

floral whale
#

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

pliant knoll
prime cliff
pliant knoll
#

good question give me a sec

#

is this the one used by gradle or is it sneaky and hiding elsewhere

prime cliff
#

At least the error message states something with Java 8 and Java 11. Try one of them.

prime cliff
paper kestrel
#

yeah there are other options

pliant knoll
#

ty

#

hmmm

prime cliff
pliant knoll
#

oh alright one sec

distant mango
#

youre gradle is using java 8

pliant knoll
#

oh should i change it to 17

#

alright

distant mango
#

needs to be at least 11

pliant knoll
#

sheesh i see i didnt even know gradle needed anything past 8

paper kestrel
#

it one of the gradle plugins requiring higher i think

pliant knoll
#

ahh i see that makes sense

prime cliff
#

Would go with 17.

pliant knoll
#

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

dire ridge
#

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

bronze ember
#

place enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") in your settings.gradle

verbal skiff
distant mango
#

libs thing yes

finite crow
#

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

lament scarab
#

Something somewhere is setting the java target to java 8

finite crow
#

any suggestions on how to debug what? I can't find it visually

lament scarab
#

I mean, one would assume that it's one of the plugins you've applied.

finite crow
#

ah, yeah so apparently indra already deals with toolchains so I don't need ot redeclare them

#

gotcha, thanks

fading vapor
#

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

glass sable
#

don't you just use the shadow plugin like the shade one on maven? or do I misunderstand that?

fading vapor
#

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

verbal skiff
#

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)

fading vapor
#

so I would do just

dependancies {
  runtimeOnly(project(":core"))
}

?

#

how will gradle know what I am refering to?

glass sable
#

your core module?

#

seems to be pretty clearly stated in your file

fading vapor
#

right now the core module looks like this

#

its in the same projects directory as all other plugin projects

#

(the defualt IDEA one)

lament scarab
#

I mean

#

it says project

#

it expects the name of the project

fading vapor
#

its that easy?

lament scarab
#

yes?

glass sable
#

yeah it's literally just the name of your module

fading vapor
#

wtf

#

that sounds way to easy

#

I trust you, but my brain can't comprehend this being easy

glass sable
#

(the real question is: how refer to it by a different name for whatever reason? xD)

fading vapor
#

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?

glass sable
#

yes

#

otherwise it's just a folder, not a module

fading vapor
#

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 :/

verbal skiff
#

not camel

fading vapor
#

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

verbal skiff
#

easier now than after you publish

#

technical debt is a thing

#

and changes get harder over time

#

but yeah this is a minimal thing

fading vapor
#

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

prime cliff
#

Had no problems with shading.

fading vapor
#

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.

prime cliff
fading vapor
#

It takes me to the compiled code which just shows the function name and what it returns

prime cliff
fading vapor
#

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

prime cliff
#

Yeah you're right, you probably should stay with maven.

golden seal
#

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

fading vapor
#

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

granite valve
#

There is a download sources button in the gradle tab, just like the maven tab

fading vapor
#

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

verbal skiff
#

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)

fading vapor
#

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

verbal skiff
#

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
fading vapor
#

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?

distant mango
#

it’s in your project stuff no?

#

use project

#

could also use projects.techtonicCore if you have it enabled

fading vapor
#

project stuff as in what? the same directory as the root, the no

#

to give you an idea

lament scarab
#

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

fading vapor
#

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("")
}
fading vapor
#

Excellent

granite valve
#

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

fading vapor
#

yeah I figured so, the compiled jar would be otherwise much larger

gusty otter
#

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?

lament scarab
#

all you can do is run stop

#

gradles "stop" mechanism does not allow for a graceful shutdown as-is is my understanding

gusty otter
#

Thats not great 😦 In maven this was possible iirc

bronze ember
#

On the upside, this simulates a server crash nicely, which you need to handle anyways ^^

void hill
#

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.

lament scarab
#

We do not support maven

bronze ember
#

We don't support maven

void hill
#

aww, if I use the spigot nms it will cause nightmares I assume? 😐 so gotta go gradle ? 😦

bronze ember
#

That's what we recommend, yes

void hill
#

alr

gusty otter
chrome flower
#

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!

smoky violet
#

are you deleting the workspace between runs?

#

enable shared caches in the worker's gradle user home

chrome flower
smoky violet
#

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

chrome flower
#

i see
thanks!
i thought i was gonna have to do some trickery to copy the cache every time we build

#

😅

#

thanks a lot!

torn merlin
#

in build.gradle.kts

#

idk why??

#

😢

lament scarab
#

did you add the library that adds the implementation configuration?

granite valve
#

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

lament scarab
#

not a dependency

#

implementation is not a default configuration afaik

#

that is added with the java gradle plugin

torn merlin
#

I want to add fastutil

bronze ember
#

all your subprojects need the java plugin

torn merlin
lament scarab
#

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

torn merlin
torn merlin
#

What exactly is apply?..

lament scarab
#

I can't help atm

torn merlin
#

For now, I'll try to understand on my own...

bronze ember
#

its a gradle plugin

#

your gradle is missconfigured in the sub projects

torn merlin
#

I'm completely misunderstanding something

bronze ember
#

yes, you are misunderstanding how gradle works

#

posting 5 lines without context also doesn't help

torn merlin
#

Isn't this a problem that can be solved by installing an external plugin like lombok?

#

I don't know what to understand first 😵‍💫 😵‍💫

#

😢

bronze ember
#

you just need to apply the java gradle plugin the the gradle module where you want to apply the fastuitl thing, lol

chrome flower
#

at the top of the build.gradle.kts file there should be a section for plugins definitions

#

something like this

chrome flower
#

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

chrome flower
#

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?

torn merlin
#

you mean build.gradle.kts?

chrome flower
#

yeah

torn merlin
#

The exact problem is

#

error: package it.unimi.dsi.fastutil.doubles does not exist
import it.unimi.dsi.fastutil.doubles.DoubleArrayList;

bronze ember
#

that seems like a multiple module project

chrome flower
#

yeah

bronze ember
#

why don't you just add the dependency to the shared project?

chrome flower
#

i just cloned the project in question

#

i might have figured it out

torn merlin
chrome flower
#

gimme a sec to verify, im waiting for my intellij to properly import the project 😂

chrome flower
torn merlin
#

I customized..

chrome flower
#

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")
}
torn merlin
chrome flower
#

after adding the dependecy there you'll be able to use it in your code

chrome flower
#

good luck and happy coding! 😋

viral sierra
#

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?

granite valve
#

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

viral sierra
#

fixed it by regedit & had to change git config to allow longer paths

teal helm
#

what's the intended way to mix patches from different paper forks?

lament scarab
#

there is no intended way, that's a you thing to deal with, welcome to git, etc

north geyser
#

how do i shadow the reobf jar?

granite valve
#

you can depend on the reobf configuration when you declare you dependency on another module

void hill
#

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.

smoky violet
#

you've given next to no context but in general gpg signing can be enabled gloablly or per-repo

void hill
#

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?) 😂

smoky violet
#

oof

torn merlin
#

What method should I use to check if I downloaded the API correctly?

lament scarab
#

if it was imported properly it will be inside of the "external dependencies" inside of IJ

distant mango
#

also that's the wrong import

torn merlin
void hill
#

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?

olive current
#

Out of order in what way?

void hill
#

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.

untold tinsel
#

what is the paper 1.20.1 build number?

distant mango
#

dont crosspost

dire wren
#

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

lament scarab
#

I mean, it's telling you the issue straight up

#

one would maybe guess to get it from tasks

dire wren
lament scarab
#

No

dire wren
lament scarab
#

I can't write the exact answer foryou

dire wren
#

I think it is a syntax issue but not sure

lament scarab
#

I'm not a gradle pro, and have generally said what I can

#

if you don't understand gradle I can't really help

dire wren
lament scarab
#

the tasks container

dire wren
lament scarab
#

Literally, just move your dependsOn thing into where you define the copyJar task

cinder ember
#
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

novel knoll
#

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

cinder ember
#

yeah, it just wasn't commented

#

done

novel knoll
#

how are you building the plugin?

#

cuz it should just be there

cinder ember
#

Build artifact

novel knoll
#

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

hexed lava
#

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 ?

bronze ember
#

Take a look at the Gradle run paper plugin

#

It's also mentioned on our docs in the dev setup page iirc

hexed lava
#

do its the note about run task ?

bronze ember
#

Ye

paper kestrel
#

@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

rapid fractal
#

(he went to bed)

paper kestrel
#

Ah ok

bronze ember
#

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

hexed lava
static urchin