#build-tooling-help

1 messages Β· Page 5 of 1

muted acorn
#

Tried cleaning the build, fixing the ide, rebooting my pc + router

#

invalidating caches

#

nothing works

final jewel
#

does it happen if you don't do it from the ide?

muted acorn
#

gonna try rn

#

okay i managed to fix it in idea

kind lava
lament scarab
#

not an issue with build tooling

#

(unsupported version of paper, and looks like you have malware or some shit)

west marsh
cinder ember
#

How can i use a class from a project in my new project with dependencies (gradle) ik how it works with maven but not with gradle

lament scarab
#

you would need to publish it to a maven repo

#

(be that maven local or a remote one, see the maven publish plugin

cinder ember
lament scarab
#

No

cinder ember
#

I can't reload gradle

eternal bone
#

how could i reference my scoreboard to my config so i can add and remove lines

lament scarab
#

This channel is for help with build tooling, i.e. gradle, maven, etc

kind bronze
#

how to fix it?

agile skiff
kind bronze
agile skiff
#

what java do you have installed?

#

java 17?

kind bronze
agile skiff
#

install java 17

#

paper is built with java 17 so thats what you should use

kind bronze
#

i have java 19

#

it cant just run on it?

#

or cant i rebuild it for 19

agile skiff
#

i mean you might be able to change it in the gradle build file but honestly just downloading java 17 is easier

kind bronze
#

ok thx

distant mango
#

send your build script

kind bronze
#

oops

#

other error

brave widgetBOT
kind bronze
lament scarab
#

Make sure that paperweight is updated

smoky violet
#

send your build and settings files

brave widgetBOT
distant mango
#

you need to actually add the dev bundle

kind bronze
#

pluginManagement {
    repositories {
        gradlePluginPortal()
        maven("https://repo.papermc.io/repository/maven-public/")
    }
}

include(
    "core",
    "v1_18_R1",
    "v1_18_R2",
    "v1_19_R1",
    "v1_19_R2",
    "v1_19_R3",
    "v1_20_R1",
    "v1_20_R2",
)
kind bronze
#

i cant find it

kind bronze
#

unresolved reference paperweight

smoky violet
#

they couldn't get to that error without a dev bundle...

#

move the java toolchain block inside allprojects

kind bronze
smoky violet
#

same with the tasks.compileJava part

kind bronze
#

i just cant build oraxen from source

smoky violet
#

also compileJava.get().dependsOn(clean) is kind of fucked

#

just remove that

smoky violet
kind bronze
#

yes

#

its open source project

#

and i try to build it

smoky violet
#

ask them for help, this channel is for developers

kind bronze
#

they doesnt help me

kind bronze
#

so i cant receive support about my question?

lament scarab
#

We can't provide support for building every random project on the internet, especially if you're unfamiliar with stuff in general

lament scarab
#

And it's not our project, you've been given advice on general tweaks that might fix it

brave widgetBOT
lament scarab
#

Basically, you'd need to work out why the dev bundle failed to apply

#

if windows, try a shorter path

#

otherwise, only common issue is generally down to java versions and caveats over the decompiler

#

jmp offered you some advice on how to stablise the java version being used for the toolchain to mitigate that risk

kind bronze
lament scarab
#

instead of doing it on your documents folder or whatever, try a folder ontop of the c drive or some other drive

kind bronze
#

its really matter?

#

lol

lament scarab
#

For windows, yes, but it's probably not that, not seen the patch log thingy as my heads spinning

#

as said, java version is the common derp factor

lament scarab
#

or do waht jmp said

#

outside of that, I can;t really offer much more

kind bronze
#

AFTER DOING ALL OF STEPS IT WORKING. THANKS

hidden ferry
#

15m is crazy

umbral pier
#

Sure is

runic aurora
# hidden ferry 15m is crazy

typically the initial build takes a while cause it caches a ton of stuff. 15M is def a ton but also not suprising. Like if your system doesn't have crap loads of RAM and a good cpu it can take a lot of time

bronze ember
#

That repo also has multiple NMS versions so of course it's taking longer the first time

west marsh
#

Heya, sorry to bump this old convo (as a reminder, I'm writing a library in Kotlin to be used as a dependency in another plugin)
So I started writing the API in java, but I guess I won't be able to make use of kotlin exclusive features such as DSL's, right?

lament scarab
#

Well, if you don't expose kotlin then you won't be able to expose its features

west marsh
#

yeah that makes sense, just wanted to make sure

verbal skiff
#

there isnt really a better solution

#

and this is a problem I'm also going to have

kindred ether
#

how can i import paperweight-userdev in maven?

#

or should i just migrate to gradle

distant mango
#

paperweight doesn't support maven

kindred ether
#

ok

distant mango
#

okay seems like adding my maven repos breaks it?

grizzled hamlet
#

How to import quickshop-reremake as a gradle kotlin dependency?

repositories {
    mavenCentral()
    maven("https://repo.codemc.io/repository/maven-public/")
}

dependencies {
    paperweight.paperDevBundle("1.20.2-R0.1-SNAPSHOT")
    library(kotlin("stdlib"))
    compileOnly("org.maxgamer:QuickShop:5.1.2.5")
}``` `inconsistent module metadata found. Descriptor: org.maxgamer:QuickShop:5.1.2.5-SNAPSHOT Errors: bad version: expected='5.1.2.5' found='5.1.2.5-SNAPSHOT'` https://repo.codemc.io/service/rest/repository/browse/maven-public/org/maxgamer/QuickShop/5.1.2.5/
lament scarab
#

their repo is borked

#

there might be a way to tell gradle to ignore that it's borked

#

but, er, gl

grizzled hamlet
#

borked?

lament scarab
#

then again, no, that checks out fine

#

broken

grizzled hamlet
#

yeah I just dicovered

#

so maybe import as artifact

lament scarab
#

wat

grizzled hamlet
#

download jar manually and import to my plugin

grizzled hamlet
#

Hey that actually worked, thanks

#

I didn't know their repo is broken

#

Are there any side effects if you know?

lament scarab
#

Not really, it just fetches the info from the artifact as opposed to tryna read the repo metadata

#

idk what is up with their repo, the file I downloaded was fine, so, cache issue? idk

rain vessel
#

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':generateDevelopmentBundle'.

java.io.IOException: Cannot run program "diff": CreateProcess error=2, The system cannot find the file specified

got this error while trying to create the reobfJar.

#

unsure of what this is and how to fix it

lament scarab
#

you need the diff command available

rain vessel
#

what is the diff cmd and how do i make it avalible?

lament scarab
#

it's a program

#

you'd need to install it, how so depends on your OS

rain vessel
#

whats the program called?

lament scarab
#

it was literally in the error

rain vessel
#

my bad lmfao

#

that it?

lament scarab
#

you want gnu-diff

#

so, probably best option is going to be to install git bash

rain vessel
#

aight

lament scarab
#

But, do note that we don't particularly support windows

#

So, you might need wsl

rain vessel
#

rip

#

alrgiht

#

doesnt intellij come with git bash?

#

i may be mistaken tho

lament scarab
#

No idea

rain vessel
#

wait is this a new thing with paperweight 1.5.9?

#

bc i never got this error on 1.5.8

lament scarab
#

No idea, see the changes

rain vessel
#

mk

#

wait

#

i have git bash already

#

C:\Program Files\Git\bin\bash.exe

#

thats the path

#

im deeply confused lol

lament scarab
#

I mean, last I knew it bundled gnu diff, if not, eeer

rain vessel
#

it does seem to be a 1.5.9 paperweight issue. i have git bash, and i may jsut have an outdated version but i will hceck later. and it doesnt work with 1.5.9 but does with 1.5.9

#

odd

#

i will try updating git bash later

#

(i stand corrected it just failed rip)

lament scarab
#

probably doesn't bundle a diff command then

rain vessel
#

yeah im updated git rn just in case its from an outdated version bc looking at the action logs for my repository it compiles perfectly fine

#

ye i had 2.41.#

#

git on 2.42.#

#

Updating didn't fix it

#

And I got git bash

#

Will download wsl2 later

#

Any ideas why this error is even caused by windows?

lament scarab
#

Because you don't have the command diff installed in the path

rain vessel
#

But I never encountered this issue before which confuses me

#

And I have been running that cmd for ages

#

Is there any known fix for this without changing the os? I'm fine with changing the os but I'm just curious abt if there is a genuine fix for it for windows

lament scarab
#

Well, yes

#

get a copy of the diff command into the path

rain vessel
#

Bet

#

Where can I find the diff cmd and get a copy lmfao

#

And to what path

lament scarab
rain vessel
#

Rip

rain vessel
#

Should I install wsl2 or just switch entirely to Linux?

main mica
#

wsl works pretty nicely imo

rain vessel
#

Oki

#

So will wsl just fix it? Install it and run the cmd again and it works?

#

Maybe restart my computer lol

main mica
#

well you will need to run it in WSL of course, but yeah

rain vessel
#

I have that. That's weird. I will try and figure that out later

copper trellis
#

how 2 compile a plugin

static urchin
#

depends on the plugin

copper trellis
#

sport paper

lament scarab
#

depends on the build system they use

#

We can't really provide support for building random software you find on the internet

static urchin
#

check the projects readme file

#

that should usually include instructions

copper trellis
#

i think it’s maven

copper trellis
static urchin
obtuse mural
#

With paperweight-userdev, is it possible to change the built jar name of reobfJar without? I tried kt tasks.reobfJar { outputJar.set(File(outputJar.get().asFile.absoluteFile.parent, "A.jar")) } but that appears to just prevent the file from being built into build/libs entirely?
Do I just have to create a custom task that runs after reobfJar that renames the files?

echo kilnBOT
distant mango
#

has example

obtuse mural
#

ohh, I have to set it to the build directory

// This is an example of how you might change the output location for reobfJar. It's recommended not to do this
// for a variety of reasons, however it's asked frequently enough that an example of how to do it is included here.

why isn't it recommended?

lament scarab
#

Because the entire point of a build system is that stuff is dumped out in a predictable manner, i.e. the output for a project goes in the projects build folder

granite valve
#

yeah. generally you want it consistent so anyone who just grabs your project and builds it knows what is being built. if everyone changed where stuff was built to, and the name, it'd be harder to know exactly where the built jar went

paper kestrel
#

i mean since its a predicatable name you can always copy (not move please) it where you want it

#

i think one of the project i contributed to had a thing where you can set a custom directory, useful to point to a test server (it didnt use the gradle plugin)

#

runDev on the paper repo breaks version information i think, the manifest gets a file not found, so all the version stuff just says null

static urchin
#

doesn't really matter πŸ˜…

#

its not running a specific version of paper

#

its "whatever the fuck is in your Paper-API and Paper-Server folder rn"

paper kestrel
#

(so a plugin I was testing with broke)

static urchin
#

I mean, you are running a completely unofficial distribution of paper when you runDev

#

If we can nicely fix the version, sure

lament scarab
#

it shouldn't return null

#

it's just not a surprise that running in such an environment causes such a side-effect and is not really a huge priority given that it's intended primarily for server dev, in which that is rarely an issue (and hardcoding go brr)

static urchin
#

idk how it would return null tbh kekwhyper

#
@Override
public String getVersion() {
    return this.serverVersion + " (MC: " + this.console.getServerVersion() + ")";
}
#

like

#

you might get null (MC: null)

lament scarab
#

Well, yea, that's probs what they mean

paper kestrel
#

Uh might have been get server version or smth

#

It just returned null, it might be the plugins issue

static urchin
#

Well, in run dev we don't have a jar

#

so its missing the manifest which includes that stuff

#

idk how we'd nicely fix that

lament scarab
#

afaik we can just add the resources folder to the classpath?

#

well, I mean, it's pulling some of the resources from somewhere, given that the vanilla datapack exists

paper kestrel
#

Does that also mean global translator to en_us would also fail?

#

Oh

distant mango
lament scarab
#

in that case

#

what it's missing is the manifest info

distant mango
#

yes

#

the git stuff is also null

paper kestrel
#

I'll need to see what the plugin is doing and if it's api

lament scarab
#

would basically need to extract out the manifest generation to somewhere like process resources maybe, idk how runDev derives its thing

paper kestrel
#

ok, ive looked, it seems to be calling Bukkit#getBukkitVersion() then string parsing it for minecraft version?
which is the worst way of doing it right?
and also smth to do with the packages?

so mainly its just coincidence, but the manifest data still inst available

vestal badger
#

Path for java installation '/usr/lib/jvm/java-11-openjfx' (Common Linux Locations) does not contain a java executable
Path for java installation '/usr/lib/jvm/java-11-openjfx' (Common Linux Locations) does not contain a java executable
Path for java installation '/usr/lib/jvm/java-11-openjfx' (Common Linux Locations) does not contain a java executable
Path for java installation '/usr/lib/jvm/java-11-openjfx' (Common Linux Locations) does not contain a java executable
> Task :SlavePlugin:compileJava UP-TO-DATE

> Task :compileJava FAILED
2 actionable tasks: 1 executed, 1 up-to-date
error: Unable to generate plugin file
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 208ms
14:04:02: Execution finished 'compileJava'.

Getting this error while compiling

proud maple
#

you'll want to try running that with at least --stacktrace since that doesn't say anything useful

vivid surge
#

i couldve sworn i saw somewhere a gradle plugin to automatically build and start the server, but i cant find it now. anyone seen it?

static urchin
vivid surge
#

yes that is it, thanks!

slender locust
#

I've got a project with multiple nms submodules. I'm trying to have them all build, get reobfuscated and merged into one fat jar. Currently its all being merged but not with the reobfuscated mappings. Anyone know how I can do this?

#

I've got assemble depending on reobf in my submodule, and implementation project(path: ":Spigot-20r2", configuration: "reobf")

#

but still no luck

rain axle
#

Guys, I need some help.
I try to use my own Api in another plugin.
Im loading the api with maven:

<dependency>
            <groupId>me.bufferoverflow</groupId>
            <artifactId>MenuApi</artifactId>
            <version>1.0-SNAPSHOT</version>
            <scope>system</scope>
<systemPath>/Users/x/Documents/Projects/Kotlin:Java/Plugins/PaperSpeedPlugin/Paper Server 1.20.2/plugins/MenuApi.jar</systemPath>
</dependency>

My Plugin.yml looks like this:

name: SpeedPlugin
version: '${project.version}'
main: me.bufferoverflow.speedplugin.SpeedPlugin
api-version: '1.20'
depend: [MenuApi]

When I try to start the server I get this error message during the starting process:

loader constraint violation: loader 'MenuApi.jar' @9b34d60 wants to load interface kotlin.jvm.functions.Function1. A different interface with the same name was previously loaded by 'PaperSpeedPlugin.jar' @10d5b85b. (kotlin.jvm.functions.Function1 is in unnamed module of loader 'PaperSpeedPlugin.jar' @10d5b85b, parent loader java.net.URLClassLoader @446cdf90)

How do I fix it?
Thx for help πŸ™‚

lament scarab
#

Because you have two plugins shading kotlin into them

#

if that's a hard depend, you can just rely on the dependency and only shade it into MenuAPI

distant mango
grand niche
#

tried args("-p", "25519")?

distant mango
#

Will try

#

Seems to work, thanks scorp

#

fixe both

shell leaf
#

Is it possible to use the paperclip system for plugins and apply patches on the Fly

lament scarab
#

I mean, yes and no

#

I mean, literally all it does is boil down to like, applying a binary patch

#

but, no idea what you mean by "on the fly"

#

theres also no granularity to stuff

#

you can't redefine classes that are already loaded without an agent

shell leaf
#

On runtime when the plugin is loaded

#

But in combination with a Java Agent it's possible?

lament scarab
#

you can't screw with other plugins, etc

#

well, I mean, that wouldn't be using paperclip

#

you'd more be looking at mixin type stuff

#

but, mixins don't deal with runtime stuff

shell leaf
#

Not really just a idea to roll out updates without reload and restart

#

And just apply diffs

lament scarab
#

Basically, no, you wouldn't use paperclip for that

#

paperclip cannot modify an already loaded jar

#

what you'd be looking at is stuff like jrebel

shell leaf
#

Yeah just as orientation

#

Oh thanks πŸ™

#

Nice to know

lament scarab
#

(but, none of this stuff is stable, none of this stuff is intended to be used in production environments, etc; expect crashes, etc)

shell leaf
#

Was just a evaluation of possibilities

oak copper
#

Hey

#

I have custom task for finalJar

#

How can I publish it to maven?

distant mango
#

need more info

oak copper
#
tasks.register('finalJar', Jar) {
    dependsOn shadowJar
    dependsOn(':MineStore-Fabric:build')
    from {
        //Include the output from shadowJar
        zipTree(shadowJar.archiveFile.get())
    }
    from {
        zipTree("${project(':MineStore-Fabric').buildDir}/libs/${project(':MineStore-Fabric').name}-${project(':MineStore-Fabric').version}.jar")
    }
    archiveClassifier.set("final")
    archiveFileName = "${project.name}-${project.version}.jar"
    destinationDirectory = file("${projectDir}/build/libs/")
}
#

I need to publish this to local maven

#

I know how to run publish task

#

I just dont know how to specify the file

#

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem was found with the configuration of task ':generateMetadataFileForMavenJavaPublication' (type 'GenerateModuleMetadata').
    • Gradle detected a problem with the following location: 'C:\Afterlife\MineStoreRecode\build\libs\MineStore-1.0.0.jar'.
   
   Possible solutions:
     1. Declare task ':finalJar' as an input of ':generateMetadataFileForMavenJavaPublication'.
     2. Declare an explicit dependency on ':finalJar' from ':generateMetadataFileForMavenJavaPublication' using Task#dependsOn.
     3. Declare an explicit dependency on ':finalJar' from ':generateMetadataFileForMavenJavaPublication' using Task#mustRunAfter.
   ```
#

Here is full log

grand niche
#

that task looks really hacky, what's it supposed to do?

oak copper
#

Than run shadowJar for all other subprojects and merge them all together

grand niche
#

merge like extract into one or a jar-in-jar?

#

why not just declare the subproject(s) as dependencies of that project and let shadow merge it?

oak copper
#

So everything except fabric is like that

#

But fabric build system breaks with using it as dependency

#

Merge into one jar

#

Not jar in jar

silk moat
#

Hello i am use relocate in order to avoid errors, but now I don't have a driver added, please tell me how it can be fixed? git.desertgamer.beeauth.libs.hikari.HikariConfig]: Failed to load driver class git.desertgamer.beeauth.libs.mariadb.Driver from HikariConfig class classloader com.velocitypowered.proxy.plugin.PluginClassLoader@7de843ef

cold kite
#

The mapped jar does contains the deobfuscated code, I confirmed that i was looking in the right jar file.

plugins {
    id("java")
    id("io.papermc.paperweight.userdev") version "1.5.5"
}

group = "de.playunlimited.limitcore"
version = "1.0-SNAPSHOT"

dependencies {
    paperweight.paperDevBundle("1.20.2-R0.1-SNAPSHOT")
}

tasks {
    assemble {
        dependsOn(reobfJar)
    }
    reobfJar {
        outputJar.set(layout.buildDirectory.file("libs/${project.name}-${project.version}-mapped.jar"))
    }
}```
distant mango
#

what command are you using to build

cold kite
#

the normal build command, btw gradle build

silk moat
olive current
#

Some things can’t be relocated due to native bindings, maybe the driver is one of them?

silk moat
#

The fact is that he does not unpack his folder mariadb

#

That is, he unpacked all the files, but specifically the folder with the driver - no

#

org does not contain mariadb, although it should

distant mango
#

ur not shading maria db

silk moat
#

And I brought it here so that it does the relocation, but since there is no main folder, the result is zero

#

I tried to do exactly the same as it is implemented in LuckPerms, as a result, mariadb does not unpacking just

distant mango
#

don't minimize

silk moat
worthy bronze
#

can anyone help me set up a Waterfall server im having a very hard time because there are no updated tutorials all I need help with is adding the server to my network

distant mango
void hill
#

herroo, havin' some trouble with maven. (am clueless with this stuff) [ERROR] Failed to execute goal on project Skills: Could not resolve dependencies for project me.AlbusThepenguin:Skills:jar:1.0.0: The following artifacts could not be resolved: io.th0rgal:oraxen:jar:1.163.0 (absent), com.jeff_media:MorePersistentDataTypes:jar:2.4.0 (absent), com.ticxo:PlayerAnimator:jar:R1.2.7 (absent), me.gabytm.util:actions-spigot:jar:1.0.0-SNAPSHOT (absent): Could not find artifact io.th0rgal:oraxen:jar:1.163.0 in github (https://maven.pkg.github.com/AlbusThePenguin/AthenasMastery) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

#

am trying to import <dependency> <groupId>io.th0rgal</groupId> <artifactId>oraxen</artifactId> <version>1.163.0</version> <scope>provided</scope> </dependency> with <repository> <id>oraxen</id> <name>Oraxen Repository</name> <url>https://repo.oraxen.com/releases</url> </repository>

#

I tried to exclude everything but oraxen in the dependency but oraxen still didn't do gucci stuff. and the url to relaseses returns 404.

lament scarab
#

I mean, the oraxen repo has a jar, but it's a dev artifact, not a jar artifact

#

so, that is probably why it's failing

void hill
#

it works in gradle, but not maven πŸ˜‚

lament scarab
#

you might be able to set the classifier to dev, but, oraxen seemingly relies upon paperweight

void hill
#

yea, converting my addon to my project into gradle as it's not that much hassle :p was planning to move over eventually regardless. silly issue tho

median pulsar
#

so I have a gradle project with 2 modules, first one uses paperweight userdev and the second one is a plugin that depends on the first module and shades it with shadowjar. how do I get the second module to shade the reobfuscated (reobfJar) variant of the first module?

lament scarab
#

you can specify the configuration for the project dependency

median pulsar
#

how?

lament scarab
#

project(":blah", configuration = "reobfJar") or something

median pulsar
#

A dependency was declared on configuration 'reobfJar' which is not declared in the descriptor for project :disguises.

lament scarab
#

might be called reobf, idr 100%

median pulsar
#

that worked thanks

brisk belfry
#

archiveFileName.set('a') or 'a.jar' I am not sure

#

It says that it cannot be empty

distant mango
#

you don’t need to edit the name

#

just the classifier

finite crow
#
 runtimeOnly(project(":adapters:platform:bukkit-1-17", "reobf"))

I have this line in my buildtscript that i want to convert to use typesafe project accessors. How do I tell it I only want the reobf'ed jar from my project?

runtimeOnly(projects.platform.bukkit117, "reobf")

^ This is invalid.. since reobf is the configuration specified on the project, not the dependency scope

#

so really my question is how do i get the reobf configuration (honestly, i don't know what it's called but the thing which has the reobf'ed artifact) from the typesafe dependency

#

runtimeOnly(projects.platform.bukkit117.dependencyProject.configurations["reobf"]) doesn't work since apparently despite bukkit117 having a "reobf" configuration, it doesn't exist on the dependencyProject..?

distant mango
#

rubtiemonly(project) { targetConfigiration =

finite crow
#

thanks!

granite valve
white arrow
#

My Paper Fork compiles correctly and every time I try to apply patches it works as expected. However, when I generate a dev bundle and try to use it with paperweight userdev I get an error:

Failed to apply dev bundle patches. See the log file at 'censoredpath\impl\paper\version-support\v1_20_R1.gradle\caches\paperweight\setupCache\patchedSourcesJar.log' for more details. Usually, the issue is with the dev bundle itself, and not the userdev project.

The log tells me there are 60 failed matches. What can cause this issue and how can I fix it?

lament scarab
#

generally, decompiler mismatch

white arrow
#

I just saw my fork is using an older paperweight version. So I should try updating that? The paperweight userdev is on 1.5.9 and the fork is on 1.5.7

Or is there another reason that there are different decompilers in use?

lament scarab
#

the decompiler version is specified in your build config

#

otherwise, you'd need to look into why the hunks failed

white arrow
lament scarab
#

yes

#

it needs to match papers

#

idk if that's your issue, you'd need to look

white arrow
# lament scarab it needs to match papers

So I tried matching it with papers but I still have the issue. Could it be caused because I'm not directly forking Paper but instead AdvancedSlimePaper which uses a different decompiler version then paper?

What would I do in this situation?

lament scarab
#

you would need to look into it yourself and work out why the hunks are failing

kindred haven
#

Hey,
I am using HikariCP and i want to compile it into my jar file. Does anyone know how to?

distant mango
#

what build@tool are you using

kindred haven
#

gradle

distant mango
#

shadow plugin

kindred haven
#

can you give me a example please?

brave widgetBOT
echo kilnBOT
distant mango
#

might also have it

#

nvm

void hill
#

so I've moved over from maven to gradle recently and wanted to know how I would setup using my private github (with token) for gradle? I have this repo with the key obviously, and for maven I had to mess with settings.xml and that.

#

to use my own repo as a dependency for my other plugins

lament scarab
#

environment variables iirc

#

RepoNameUsername
RepoNamePassword

#

(google "github gradle publish", theres about several dozen guides)

elfin valley
#

there are also plugins they let you use your maven settings file

verbal skiff
lament scarab
#

There are worse things I could do...

oak copper
#

Does anyone know how to shadow the same dependency twice.

#

Once relocated and the other time not.

olive current
#

Huh, why?

echo kilnBOT
distant mango
#

?????

oak copper
#

I already talked about it here

olive current
#

Link?

oak copper
#

Looking for it

#

It will be faster to just write it

#

Basically velocity requires not relocated dependency. Fabric requires relocated one.

distant mango
#

seperate jars

oak copper
#

I decided on uber jar

#

And changing it would take too much time

#

Of course if it aint possible than I will have to but I want to try to do uberjar

lament scarab
#

easiest option would be to make the one which requires relocating it to shade + relocate it

#

and then you can just pull in the output of shadow

oak copper
lament scarab
#

that

oak copper
#

Oh I can do it here

#

Just zipTree the not modified jar right?

lament scarab
#

you tell the thing to shade in the shadowJar of that module instead of the standard configuration output

#

well, yea, that would work

oak copper
#

I need custom task because fabric anyway

smoky violet
#

manual dependsOn for non-lifecycle tasks generally screams you're doing it wrong

smoky violet
#

read the documentation I linked

oak copper
#

I did

#

Partially

#

But I know how this API works

#

At least I think I do

glass warren
#

If you're trying to hire or pay someone you'll want to look elsewhere. Paper is not a marketplace.

oak copper
#

Yeah but he clearly understands how it works

#

So it would have been more efficient

glass warren
oak copper
#

Fine PepeLaughEasy

#

Oh common warning for that

#

I am pretty sure I did not violate this

static urchin
#

you literally attempted to hire a developer cat_what

#

Deleting the message won't change that lmao

oak copper
#

I did not delete it

#

ocelotpotpie did

oak copper
#

Because my intent wasnt to hire somone for work

static urchin
#

you can hire people for temporary jobs too πŸ˜…

#

but w/e, nothing to discuss here πŸ‘ its just a warning

oak copper
#

It was more like that it is more time efficient for someone to do it for me instead me asking stupid questions.

glass warren
#

jmp linked you the docs. If you can't get what you need from the docs to setup things how they need to be setup then I suggest hiring a developer through some appropriate means.

oak copper
glass warren
oak copper
#

I will just look into the docs myself

#

It is fine

barren jackal
#

hey there fam i have a question

smoky violet
#

you can literally just from zipTree(someAbstractArchiveTask.archiveFile) and it will auto wire the task dependencies

#

don't use .get()

#

and assemble is a lifecycle task, so dependsOn is fine there. you don't want finalizedBy

barren jackal
#

i am making a plugin basiclky it has integration with simpleclans plugin api so im thinking i will also integrate vault but now i ask, ik alot of plugins are hooked to vault meaning if i integrate vault people can use my plugin alongside with many other economy plugins but how about premissions? do i have to install the api of the most popular ones 1 by 1 or does vault have compatibility fort htat too?

#

my friend sent me that

smoky violet
#

this is not really a build tooling question

barren jackal
#

oh sorry

#

should i go to docs?

smoky violet
barren jackal
#

gotcha sorry boys

oak copper
#

Oh so this makes sure shadow is run right?

        //Include the output from shadowJar
        zipTree(shadowJar.archiveFile);
    }```
oak copper
#

I need to run finalJar as the new build

#

So thats why finalizedBy is there

smoky violet
#

if you already know better then what are you asking about

oak copper
#

No I am not saying I know better

#

I just dont know the other way

smoky violet
#

build runs jar because build dependsOn assemble, and assemble dependsOn jar

#

so if your task should be run by assemble/build, you make assemble depend on it

#

finalizedby is not what you want. you should read the docs for it. it will casue the task to run AFTER, regardless of if previous tasks failed even

#

and looking at the docs for CopySpec, idk how from { } would even compile... must be a grovy thing. you want from(zipTree(shadowJar.archiveFile)), but groovy means you can omit the outer parens and do from zipTree(shadowJar.archiveFile)

oak copper
#

And can this be improved in some way too?
from zipTree("${project(':MineStore-Fabric').buildDir}/libs/${project(':MineStore-Fabric').name}-${project(':MineStore-Fabric').version}.jar")

#

I feel like I should be get the output of the task too right?

smoky violet
#

is that the remapjar or shadowjar

#

actually doesn't matter

#

project.tasks.named('taskName', AbstractArchiveTask).archiveFile

oak copper
#

I want the output of build task right?

#

Or remapJar?

smoky violet
#

assemble and build are lifecycle tasks

oak copper
#

from zipTree(project(':MineStore-Fabric').tasks.named("build", DefaultTask).archiveFile)

smoky violet
#

they have no output

oak copper
#

Oh I see

#

I need archive task

#

So remapJar correct?

#

Caused by: org.gradle.api.UnknownTaskException: Task with name 'remapJar' not found in project ':MineStore-Fabric'.

#

I guess I am just stupid twofacepalm

smoky violet
#

for fabric, that's usually the main output

#

try moving the task creation into an afterEvaluate {}

olive current
smoky violet
#

it's cross-project configuration

olive current
#

Ohh my bad ignore me

oak copper
#

I think it runs this build.gradle first

#

So it knows nothing about the subprojects

#

That is my only guess

smoky violet
#

yeah solving this properly is a bit complicated

oak copper
smoky violet
#

btw you're still using finalizedby 😭

oak copper
#

Yeah because dependsOn produces 1kb jar

smoky violet
#

...

#

how are you producing any jar when it errors in configuration

#

move the task definition back outside the afterevaluate

#

set it to a variable like def finalJar = register...

#

then fabricProj.afterEvalutate { finalJar.configure { from(zipTree([get remap jar archive output])) } }

#

(this is not solving it the 'proper way' that I was talking about, but it's a lot better than manual dependsOn and hardcoded file paths....)

oak copper
#

But finalizedBy is still needed?

smoky violet
#

when have I said anything about finalizedBy other than to remove it and replace it with dependsOn

oak copper
#

ok sry

oak copper
#

Could not get unknown property 'archiveFile' for provider(task 'remapJar', class net.fabricmc.loom.task.RemapJarTask) of type org.gradle.api.internal.tasks.DefaultTaskCollection$ExistingTaskProvider_Decorated.

oak copper
#

Because archiveFile does not exist on it

smoky violet
#

might need task.flatMap { it.archiveFile }

#

usually you can skip that with groovy tho

oak copper
#

It works

#

Thank you

#

Would you also know how to publish the output jar of finalJar to maven instead of publishing the normal one

#

Because right now it publishes empty file

oak copper
#

What does it represent

harsh bough
#

I am getting java.lang.NoClassDefFoundError: com/zaxxer/hikari/HikariConfig when my plugin tries to load. I have this in dependencies implementation("com.zaxxer:HikariCP:5.1.0") and using Gradle Kotlin DSL

olive current
#

Did you use shadowjar properly?

harsh bough
#

I haven't been using shadowJar, I'm guessing I need that

#

Yeah works with shadowJar and using the -all version of the jar but the size is huge. And I didn't think that was the right one either

#

all I did was add id("com.github.johnrengelman.shadow") version "8.1.1"

olive current
#

Define huge?

harsh bough
#

4.44 MB

olive current
#

What is your full dependency list?

harsh bough
#

compileOnly("io.papermc.paper:paper-api:1.20-R0.1-SNAPSHOT")
compileOnly("me.clip:placeholderapi:2.11.3")
implementation("mysql:mysql-connector-java:8.0.33")
implementation("com.zaxxer:HikariCP:5.1.0")

olive current
#

Prolly the mysql connector

#

Are you building against latest?

harsh bough
#

Latest what?

olive current
#

Server version

harsh bough
#

Yes

olive current
harsh bough
#

Is there some way to do it with Gradle instead? I'm not sure if it's like relocating or what it is

olive current
#

You already did it with gradle.

#

It just gives u a rather large jar which you seemed unhappy with

#

Relocating will not change the jar size

#

You could try minimizing it

harsh bough
#

Well I mean however plugins like LP can lower it I'd like to do

olive current
#

LP uses their own dependency loader

harsh bough
#

How can I minimize it?

olive current
#

It’s a method in the shadow plugin

#

tasks {
    withType<ShadowJar> {
        archiveClassifier.set("")
        minimize()
    }
}

grand niche
#

make sure to exclude the mysql connector from minimizing

olive current
#

Won’t really reduce his output by much then, the hikari lib was only 100-200kb and the mysql connector 2mb

grand niche
#

yea

#

but the minimizer is gonna poof it altogether, since it's discovered via SPI and holds no bytecode references

olive current
#

Poor man

paper kestrel
#

what if you try the new coordinates com.mysql:mysql-connector-j:8.0.33

odd tulip
#
- name: Java CI with Gradle

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]

permissions:
  contents: read

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4
    - name: Set up JDK 17
      uses: actions/setup-java@v3
      with:
        java-version: '17'
        distribution: 'temurin'
        
    - name: Setup Gradle
      uses: gradle/gradle-build-action@v2
    - name: Gradle Wrapper
      run: gradle wrapper
    - name: Make executable
      run: chmod +x ./gradlew
    - name: Execute Gradle build
      run: ./gradlew assemble
    - name: Upload artifact
      uses: actions/upload-artifact@v3
      with:
        name: Plugin
        path: build/libs/Origami*.jar
        if-no-files-found: error
        patterns: |
          '!build/libs/Origami*-DEV*.jar'
``` I think I got this wrong, github is still uploading a zip file and is now giving me an error
#

Ideally I want the only artifact uploaded to be the plugin jar, and then I want that to be uploaded as a release automatically

#

I also find the build to be quite slow so if there is something I can do to improve that lmk

smoky violet
#

35s-1m on free gh actions runners isn't slow imo

#

and the actual gradle build is taking 10 seconds

#
    - name: Gradle Wrapper
      run: gradle wrapper
    - name: Make executable
      run: chmod +x ./gradlew
``` this shouldn't be needed
#

just commit the wrapper w/ scripts already chmod'd

odd tulip
#

I'm on windows so idk if that will work, also wouldn't that mean bloat in the repo?

#

anyway the upload isn't working properly, I don't want to include the dev plugin... is there a way using the wildcard system i can only include jars without "dev"?

smoky violet
#

it's standard practice with gradle to commit the wrapper, even though it's not standard by git conventions to commit a jar

#

your project will not automatically build with whatever random version of gradle someone has installed most likely

#

if you insist on not using the wrapper, then running gradle wrapper is a waste of time still

odd tulip
#

should i commit gradlew and its bat file as well as the wrapper.properties and jar?

verbal skiff
#

yes

smoky violet
#

when you use gradle init to create the project you'll get a default .gitattributes and .gitignore that specify settings for that

#

.gitignore (with intellij stuff added) ```

Ignore Gradle project-specific cache directory

.gradle

Ignore Gradle build output directory

build

.idea/
*/.idea/

odd tulip
#

ah, I used github desktop's gitignore by default

#

nice, now stuff is looking much cleaner and simpler

#

now I need to figure out how to upload this jar straight to a release

odd tulip
#
      - name: Find Artifact
        run: find build -type f -name 'Origami*.jar' ! -name '*-dev*' -exec echo "Uploading {}" && mv {} /tmp/artifact/
      - name: Upload Artifact
        uses: actions/upload-artifact@v3
        with:
          name: Plugin
          path: /tmp/artifact/Origami*.jar

Warning: No files were found with the provided path: /tmp/artifact/Origami*.jar. No artifacts will be uploaded.

#

why can't it find the file that very clearly exists?

#

I see "Uploading build/libs/Origami-1.0-SNAPSHOT.jar" in the log for the find

verbal skiff
#

that regex doesn't match what you think it does

odd tulip
#

I should probably make it Origami-*

verbal skiff
#

nope

#

that would just match Origami and then any number of -

#

for example Origami-- or Origami----------

odd tulip
#

I am terrible at writing regex so I have no idea how to make it work properly

verbal skiff
#

if you want to match any number of any character its .*

#

. = any character

odd tulip
#

anyway that isnt the issue here cause it found the right file

#

I'll have to fix it eventually but right now I just wanna upload the artifact and get it sent as a release

odd tulip
#

okay it looks like everything will be zipped no matter what I guess

#

maybe I could get gradle to stop producing dev jars when assembling or smth

#

I eventually want to upload each tagged build to modrinth and curseforge

smoky violet
#

for a gradle plugin based approach (combined with hangar-publish-plugin ofc :p)

#

actions-based is valid though, it's a preference thing

odd tulip
#

looks good, I'll check it out

#

I wanna publish on Modrinth and CF because that means I can make money without having to charge for the plugin itself, but i'll be sure to make a hangar page that redirects to one of those sites

#

is there a way i can store the secret tokens in a gitignored file rather than environment vars?

smoky violet
#

env vars is for easily passing CI secrets, basically

#

you can use $GRADLE_USER_HOME/gradle.properties though

odd tulip
#

thanks, I might not use that tho cause I'm using idea to download and setup gradle so if i update it might change that dir

#

are there examples of that gradle plugin being used for plugin publishing? the readme is for mods, which have different options on MR/CF

smoky violet
#

I don't use cf so I can't help with that side of it, but if you run into problems should open an issue at mod-publish-plugin

#

also gradle user home doesn't randomly change, that's kinda the point of it

#

gradle stores the different distributions downloaded by wrappers there for example

eager cave
#

Hey guys how can i add JDA to my gradle project? When using "implementation("net.dv8tion:JDA:5.0.0-beta.18")" it doesnt get included in the jar

oak copper
#

Do you have shadow gradle plugin?

eager cave
#

No, i have never used gradle

oak copper
#

What version of gradle do you use?

agile skiff
agile skiff
oak copper
#

We dont know πŸ˜„

olive current
agile skiff
#

1.12 isn't supported anyway

oak copper
eager cave
agile skiff
eager cave
#

fixed my issue

#

ty guys :P

agile skiff
#

tbh for me. when i make plugins (which now i rarely do) i give a shit about backwards compatibiliy. either use latest build of paper or don't use the plugin

oak copper
#

If you used shadow make sure to relocate

eager cave
paper kestrel
#

whenever i try re-building a version within mache, i get errors on the section symbols i think

#

is there somewhere gradle is meant to be told its utf8, not ascii?

#

is there a global option or smth?

paper kestrel
#

ok, got it working by setting

systemProp.file.encoding=utf-8
org.gradle.jvmargs='-Dfile.encoding=UTF-8'

in my global gradle.properties

paper kestrel
#

hmm, did mache always not seperate the resources?

#

im sure a previous jar i got more closely matched the vanilla jar

#

nvm it might have been a change i made

paper kestrel
#

ah ok, found the issue: not running setup for the version initally
i assumed that since the resources were in the src root (?) they were copied over to the jar

bronze ember
#

Setup is def requires since it sets up the resource folder, yes

paper kestrel
#

I mean I'm guessing it's a temp thing, as I thought the plan was to be able to patch any file, including the resources, no?

#

And setup sources sounds like it should do anything setup does

misty lava
#

this was a big help for me ty

verbal skiff
#

I have an issue where a BOM is not being provided transitively:

In the "library" project, I add the adventure BOM in the transitive compileOnlyApi dependency configuration:

plugins {
  // ...
  `java-library`
}

dependencies {
  // ...
  compileOnlyApi(platform(libs.adventure.bom))
  // ...
}

libs.versions.toml:

# ...
[libraries]
adventure-bom = "net.kyori:adventure-bom:4.14.0"
# ...

This project is included in another one:

dependencies {
    api(libs.anvil.core)
    api("net.kyori:adventure-text-serializer-legacy")
    api("net.kyori:adventure-text-serializer-plain")
    // ...
}

But I get this error:

* What went wrong:
Could not determine the dependencies of task ':shadowJar'.
> Could not resolve all dependencies for configuration ':runtimeClasspath'.
> Could not find net.kyori:adventure-text-serializer-legacy:.
     Required by:
         project : > project :catalyst-velocity
> Could not find net.kyori:adventure-text-serializer-plain:.
     Required by:
         project : > project :catalyst-velocity

Any ideas?

floral whale
#

I currently have a lib that can be used as dependency like this compileOnly("com.github.Mantic-Development:ManticLib:1.0.42.1")

But I want to move it to a private github repository, so I need to publish it and check credentials etc.

But I'm not sure what to actually publish, this is what I have rn:

publishing {
    publications.create<MavenPublication>("maven") {
        from(components["java"])
    }

    repositories {
        maven("${project.rootDir}/releases")
    }
}

artifacts {
    archives(tasks.shadowJar)
}

Which generates a lot of files, but not sure which ones I actually need

verbal skiff
#

the -all jar shouldnt be published

#

everything else yes

#

also IDK why you have a custom folder set there

#

use a normal maven repository (e.g. nexus)

floral whale
#

Can I use that for making a private github repo though?

floral whale
verbal skiff
#

its the standard way of doing it

floral whale
verbal skiff
#

i'd need to see more of your gradle scripts then

floral whale
verbal skiff
#

private github packages also arent free

floral whale
verbal skiff
#

that is like, a total abuse of how it should work

#

if its what i think it is

#

are you just pushing those build files directly to a github repository?

#

jesus christ

#

i wonder if theres actually some kind of rule against that

floral whale
#

Oh well

#

I should probably just use mavenLocal until we get an actual hosted maven repository then

verbal skiff
#

you can also just publish the API of your project

#

but eh idk

#

yeah the proper way would be through a nexus instance

verbal skiff
#

but the implementation is private

floral whale
#

Just would prefer not having to add it to every project manually

#

As a file

verbal skiff
#

if you guys are an actual company, use a proper maven server

#

i just got blocked the other day for hitting the github download ratelimit

#

and i wasnt even downloading that much stuff

#

you dont want to be reliant on that

floral whale
floral whale
verbal skiff
#

are you guys an actual company?

#

do you have your own infrastructure?

#

if it was me, i would host it myself, but i also have my own infra

#

otherwise you can go to a cloud provider

floral whale
verbal skiff
#

perfect

#

then you have the answer

floral whale
#

But is it hosted through "nexus" or whatever that is

verbal skiff
#

no, nexus is just the software

#

you can download it and run it

#

there's the image

floral whale
#

Alright, so if I want to publish a plugin to nexus from my own pc to the server that will host the repositories, how would that be done?

verbal skiff
#

then for the URL in your buildscript you put the URL of running nexus instance on the server

#

the easiest way to host this is with docker compose

#

if you have multiple servers and want high availability etc then kubernetes

floral whale
verbal skiff
#

you can set a username/password

#

but they would need to have access to your network in the first place

#

which they don't unless you port forward for example

floral whale
#

Alright I'll let the server manager take care of this lol, I don't understand all this haha

brisk belfry
floral whale
#

Should I do anything with these duplicates?

#

gson and guava for example

olive current
#

Probably fine

agile skiff
floral whale
#

Yeah kinda confused why Vault would include all that

#

When I say all that I mean just bukkit lol

distant mango
#

because vault

opal verge
brisk belfry
#

I might actually switch to your solution

#

Although it would still be gradle so it won’t fix the issue

granite valve
#

@smoky violet having a strange issue where the access transformer is failing to change the visibility of a specific field. Other fields work, but just MushroomCow stewEffects does not seem to change

#

it's being merged in with all the other ATs, can see that in the taskCache

smoky violet
#

fix fork javadoc patch ```diff
diff --git a/.gitignore b/.gitignore
index 615b683..dbe10f9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -48,5 +48,6 @@ run/

forktest-server
forktest-api
+paper-api-generator

!gradle/wrapper/gradle-wrapper.jar
diff --git a/build.gradle.kts b/build.gradle.kts
index 359f8d0..1dd360d 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -67,6 +67,15 @@ paperweight {
serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
serverOutputDir.set(layout.projectDirectory.dir("forktest-server"))
}
+

  •    patchTasks {
    
  •        register("generatedApi") {
    
  •            isBareDirectory.set(true)
    
  •            upstreamDirPath.set("paper-api-generator/generated")
    
  •            patchDir.set(layout.projectDirectory.dir("patches/generatedApi"))
    
  •            outputDir.set(layout.projectDirectory.dir("paper-api-generator/generated"))
    
  •        }
    
  •    }
    
    }
    }
#

@grim mauve

fading fern
#

This is my first java project that's not using the minecraft dev plugin and I am getting a no main manifest attribute in gradle.

#

Can someone help?

#

I know I haven't specified a main class but I do not know how to do so.

#

If anyone wants to know why I'm not using the minecraft dev plugin it is because I wanted to make something independent of spigot.

distant mango
#

what exactly are you trying to do

fading fern
#

I just wanted to make something experimenting with files and byte arrays.

#

I can do that with spigot but I don't wanna make it for a minecraft server.

#

Thanks though!

shadow compass
#

how do i add an output directory in gradle

#

once again

granite valve
#

Wdym an output directory? Stuff is output to the build directory.

#

We don’t recommend changing file names or output locations

#

You can symlink the jar if you want to use it in a server after building

spice sparrow
verbal skiff
#

TIL about mklink πŸ˜‚

#

at first I thought... no that's a mistake, it's ln -sf

cinder ember
#

I'm tryinna use paperweight and i stuck on :reobfJar

here's my build.gradle

plugins {
    id "java"
    id "com.github.johnrengelman.shadow" version "8.1.1"
    id "io.papermc.paperweight.userdev" version "1.5.10"
    id "xyz.jpenilla.run-paper" version "2.2.2"
}

group = "zip.sodium"
version = "0.01r"

dependencies {
    paperweight.paperDevBundle("1.20.2-R0.1-SNAPSHOT")

    implementation group: "org.bytedeco", name: "javacv-platform", version: "1.5.9"
}

def targetJavaVersion = 17
java {
    def javaVersion = JavaVersion.toVersion(targetJavaVersion)
    sourceCompatibility = javaVersion
    targetCompatibility = javaVersion
    if (JavaVersion.current() < javaVersion) {
        toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
    }
}

tasks.withType(JavaCompile).configureEach {
    if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
        options.release = targetJavaVersion
    }
}

processResources {
    def props = [version: version]
    inputs.properties props
    filteringCharset "UTF-8"
    filesMatching("paper-plugin.yml") {
        expand props
    }
}

#

it took 7 minutes to just get past :reobfJar

distant mango
#

windows?

cinder ember
#

yeah

olive current
#

Shoould be faster on subsequent runs, but yeah windows can be slow

cinder ember
#

ouch

#

well thanks

red kestrel
#

does paperweight work with maven

distant mango
#

no

#

gradle plugin

red kestrel
#

well i've been having some issues with using both gradle and paper

#

i've had a maven and spigot project for almost 2 months and i decided to migrate today, everything works fine

#

but when i run the server

#

i get an error

#

the class says it is found in the class so.. ?

smoky violet
#

You need to run ./gradlew reobfJar

#

and use the jar without -dev in the name

red kestrel
#

let me try

smoky violet
#

send a screenshot of the contents of ./build/libs if it doesn't work

red kestrel
#

ok so, same error

#
import java.nio.file.Paths

plugins {
    alias(libs.plugins.shadow)
    alias(libs.plugins.paperweight)
    alias(libs.plugins.run.paper)
    java
}

group = "com.glassykiller"
version = "1.0"

repositories {
    mavenCentral()
    mavenLocal()
    maven("https://jitpack.io")
    maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots")
    maven("https://oss.sonatype.org/content/groups/public")
    maven("https://hub.jeff-media.com/nexus/repository/jeff-media-public")
    maven("https://repo.flyte.gg/releases")
    maven("https://repo.papermc.io/repository/maven-public/")
}

dependencies {
    paperweight.paperDevBundle("1.20.1-R0.1-SNAPSHOT")
    implementation(libs.paperlib)
    compileOnly("com.jeff_media:MorePersistentDataTypes:2.3.1")
}

tasks {
    build { dependsOn(shadowJar) }
    runServer { minecraftVersion("1.20.1") }
    compileJava {
        options.encoding = Charsets.UTF_8.name()
        options.release.set(17)
    }
    shadowJar {
        relocate("io.papermc.lib", "gg.flyte.paperlib")
        archiveFileName.set("IslandsOfVerlore.jar")
        //destinationDirectory.set(Paths.get("C:\\Users\\NS TECH\\Desktop\\Server 2.0\\plugins").toFile())
    }
    javadoc { options.encoding = Charsets.UTF_8.name() }
    processResources { filteringCharset = Charsets.UTF_8.name() }
}

java {
    toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}```
#

this is my build.gradle btw

echo kilnBOT
#

Please send large files/logs to a pastebin

devout ledge
#

in the future

red kestrel
#

aight, mb

distant mango
#

what jar are you using

red kestrel
#

this is what's outputted

#

and i use that

distant mango
#

top one

red kestrel
#

wdym

distant mango
#

use the top one

red kestrel
#

ok

distant mango
#

i think at least?

#

make sure you're using the reobfJar task

red kestrel
#

another error

distant mango
#

you need to shade it in

red kestrel
red kestrel
distant mango
#

change compileOnly to implementation

red kestrel
#

alright, one sec

#

another error..

#

ok, fixed

#

but this error is weird, i changed the package name from "jjk" to "iov" and i started getting the error

#

but there are no errors in the code

#

and yet it still shows up in the console

#

i'd prefer if the package name was iov

smoky violet
#

what exactly is that generateEverything method doing

#

it looks like java serialization PepeLa

red kestrel
#

how'd you know

#

it is

devout ledge
#

the caused by stack I'm guessing

smoky violet
#

yeah don't use java serialization

red kestrel
#

OHHHHHHHHHH

#

i think i get it

#

this has the old name saved in it

smoky violet
#

use gson or configurate or the config api or something

red kestrel
#

that's why it's saying class not found

#

oh my GOD i cant believe i wasted so many hours on this

rapid fractal
#

You are always welcome to ask help here. We have gradle wizard jmp here AYAYARie

red kestrel
#

but THANKS A LOT I LOVE YOU ALL

#

this is how much time i wasted trying to fix this btw

red kestrel
#

Maybe ill switch to that.

smoky violet
#

what kind of data is this

#

configuration or user data type thing

red kestrel
#

Its a class i made called Stats

#

Nah not config

#

A class

smoky violet
#

gson is probably easiest for local file based storage

#

other than that you could use a database

#

instead of a string you can also pass BufferedReader/Writer for working with files

#

#paper-dev if you have more questions, this is the build tooling channel

red kestrel
#

πŸ‘

red kestrel
# red kestrel

ok so another thing, how do i change the output directory of the top file?

#

i want it to get immediately sent to my /plugins folder

lament scarab
#

Generally you don’t, you add a copy task

red kestrel
#

how to achieve that

smoky violet
#

give me a minute I'll send something I can pin

red kestrel
#

tyt

smoky violet
#

Task to copy jar(s)

Kotlin DSL: ```kotlin
tasks.register("copyJars", Copy::class) {
// Include the jar(s) we want to copy
// from(tasks.shadowJar) // If using shadow (and not paperweight-userdev)
// from(tasks.reobfJar) // If using paperweight-userdev
// from(tasks.jar) // Not using shadow or paperweight-userdev

// If you want to rename a jar in the destination dir:
/*
from(tasks.jar) {
    rename { "NewName.jar" } // Rename the jar in the destination directory
}
 */

// Pick a destination directory -
// into(layout.projectDirectory.dir("directory/relative/to/projectDirectory"))
// into(file("/absolute/directory"))

}


For Groovy DSL replace the first line with ```groovy
tasks.register("copyJars", Copy) {

In case you want to delete jars/directories on clean: kotlin tasks.clean { // delete(layout.projectDirectory.dir("directory/relative/to/projectDirectory")) // delete(layout.projectDirectory.file("file/relative/to/projectDirectory.txt")) // delete(file("/absolute/directory/or/file/path")) } (you could also register your own custom Delete task, in a similar fashion to the Copy task above)

red kestrel
#

shouldnt this work then?

smoky violet
#

probably

red kestrel
#

it doesn't :(

smoky violet
#

you need to give more details

red kestrel
#

it's not going to that path

smoky violet
#

did you actually run the task

red kestrel
#

reobfJar? yes

smoky violet
#

...

red kestrel
#

oh copyJars?

#

no.

smoky violet
#

that's the one you need to run

red kestrel
#

ok so thanks

#

but is there a way for it to show up here instead of using the terminal?

smoky violet
#

it's going to be under other unless you specify a group

red kestrel
#

ohhhhhhh

#

thanks a lot

#

❀️

smoky violet
verbal skiff
cinder ember
#

It's been on :shadowJar for 2 minutes now

#

And I bet it'll be the same with :reobfJar

#

Aaaand :reobfJar failed

#
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':reobfJar'.
> io.papermc.paperweight.PaperweightException: Execution of 'net.fabricmc.tinyremapper.Main' failed with exit code 1. Log file: C:\iterator\.gradle\caches\paperweight\taskCache\reobfJar.log Classpath: C:\Users\huzun\.gradle\caches\modules-2\files-2.1\net.fabricmc\tiny-remapper\0.8.10\7b6ef88079ac1d0c306c4f243d689357978b5ae5\tiny-remapper-0.8.10-fat.jar

lament scarab
#

see the log?

cinder ember
#

java.lang.OutOfMemoryError

#

ong

#

Yeah the problem of "it takes too long" still persists though

lament scarab
#

i'd imagine that if the build failed beause of an OOM, you where probably thrashing memory

#

though, the gradle daemon should generally kill the build when that happens

cinder ember
#

i have 6.5 gigs of ram available, isn't that enough for :reobfJar?

lament scarab
#

it's java

cinder ember
#

ah so right i have to give java access to more ram

lament scarab
#

the Xmx value is calculated based on the environment

cinder ember
#

so what do i do

#

and how do i do it

lament scarab
#

idk if those tasks directly expose the means to increase the memory

#

but, you can configure the memory allocated to deamon processes in general

#
$ cat .gradle/gradle.properties
org.gradle.jvmargs=-Xmx2G
org.gradle.daemon=false
cinder ember
#

still out of memory

#

tried adjusting xmx to 3g and 4g and 6g

#

still the same thing

lament scarab
#

well, that will mostly just deal with that daemon

#

iirc, reobf jar spins off its own task

#

see the jvmArgs property on the remapJar task

cinder ember
#

okay now it doesnt crash

#

but it still takes too long

#

about 5 minutes

floral whale
#

Hey I need to publish to this repository url = uri("https://maven.summitrealms.com/#/releases")

But when publishing it ignores the #

#

Anyone got an idea why?

#

Oh how to fix

distant mango
#

are you using reposilite

floral whale
#

Yes

distant mango
#

remove the #/

#

that's only for the UI

floral whale
#

Ah, then I get the no auth error, but I do have the correct credentials

bronze ember
#

Fragments are never send to servers

floral whale
#

Could not PUT 'https://maven.summitrealms.com/releases/me/fullpage/blah/blah.jar'. Received status code 401 from server: Unauthorized

distant mango
#

send logs & build config

floral whale
#

This is in build.gradle

publishing {
    repositories {
        maven {
            name = "myDomainRepository"
            url = uri("https://maven.summitrealms.com/releases")
            credentials(PasswordCredentials::class)
            authentication {
                create<BasicAuthentication>("basic")
            }
        }
    }

    publications.create<MavenPublication>("maven") {
        from(components["java"])
    }
}

This is in gradle.properties:

myDomainRepositoryUsername={login} // Inserted correct login ofc
myDomainRepositoryPassword={password} // Same with password
#
Execution failed for task ':publishMavenPublicationToMyDomainRepositoryRepository'.
> Failed to publish publication 'maven' to repository 'myDomainRepository'
   > Could not PUT 'https://maven.summitrealms.com/releases/me/fullpage/blah/blah.jar'. Received status code 401 from server: Unauthorized

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
distant mango
#

do the user and pass work in browser

floral whale
#

Yes

distant mango
#

looked at reposilite's logs?

floral whale
# distant mango looked at reposilite's logs?

Ah yeah forgot those

17:56:54.103 DEBUG | PUT /releases/me/fullpage/blah/1.0.43.0/blah.jar from ip, ip // Removed by me

17:56:54.106 DEBUG | {login} failed to authenticate with Basic realm due to ErrorResponse(status=401, message=Invalid authorization credentials)

17:56:54.106 DEBUG | ERR RESULT | PUT /releases/me/fullpage/blah/1.0.43.0/blah.jar errored with ErrorResponse(status=401, message=Invalid authorization credentials)
#

Sry for ping

#

Didnt see in time

#

It's the correct ip's and login name

#

I have weird characters like & in the password, does that matter?

smoky violet
#

what exactly is ```kotlin
authentication {
create<BasicAuthentication>("basic")
}

floral whale
smoky violet
#

try removing it

floral whale
#

Removed special chars from passphrase, didn't fix it either

floral whale
#

Bruh I'm dumb

#

I put the login in literal {} myDomainRepositoryUsername={login}

floral whale
#

I'm backkkk

I'm currently getting this issue

Could not determine the dependencies of task ':shadowJar'.
> The following Gradle properties are missing for 'summitPrivate' credentials:
    - summitPrivateUsername
    - summitPrivatePassword

Because the properties are not in the git, because I don't want to share the password ofc. any other way to do this? I assume it's not working because the properties aren't in the git but only on my local computer. It runs shadowJar fine local

static urchin
#

I mean, if you need a private repo or something and want to build on github CI, you need to get those credentials there

floral whale
#

Github CI?

static urchin
#

you said it runs fine locally ?

#

where is this failing ? Why is it even building there

floral whale
#

It's failing when doing the action on github

static urchin
#

Yea

floral whale
#

For creating a release

#

On github

static urchin
#

So github CI

floral whale
#

Idk what that is

static urchin
#

contiunous integration

#

actions is githubs name for it

floral whale
#

Oh, I mean I do have the workflow setup correctly and everything, what else should I do then? To provide the credentials locally

#

Not sure what CI should be used for if it's just the workflow / actions

#

Which I already use

floral whale
#

Ohhh didn't know secrets were possible there

#

Thanks

static urchin
#

I'd advise to create a user that has as limited access to your repo as possible for this

floral whale
#

How come?

static urchin
#

I mean

#

I would not want admin credentials for my repo somewhere on github

#

even if github is trying its best to protect them

floral whale
#

Oh yeah true, hmm

#

Maybe we should just have a common user for the private repository then? But then I'd have same issue ig

static urchin
#

its fine just, don't give out admin perms

floral whale
#

The credentials would just be in gradle.properties

static urchin
#

single read-only user and you should be good to go

floral whale
#

So the new user should just be able to read those secrets?

static urchin
#

the user and their password you use in github actions only needs permissions to read your private repo

floral whale
#

But then how do I read using the user but write using my main user?

static urchin
#

do you write to the repo in the release ?

floral whale
#

Oh yeah I don't I just add the latest jar and source code

static urchin
#

so yea, the gradle credentials to access the repo can be of a user on the repo that can do nothing but read that specific repository

#

your local user might have some wild admin perms, but the one on github can only read that repository nothing else

#

if you fuck up down the line and it gets exposed, people don't get to completely fuck your repo

floral whale
#

So we should still have a common user for the maven repository right? Because the issue I had before is I wouldn't want to share the credentials I use for publishing the the repo etc.

#

Or what

static urchin
#

A common user ?

#

General rule of thumb is, only give away permissions that are needed

#

your github actions only needs to read from a specific repo ? Create a user that can only do that

floral whale
#

Basically we have our private maven repository hosted using reposilite, where we each have our own user. I wouldn't want to share my credentials when publishing though, and they're stored in gradle.properties atm. I thought I could just fix it by removing that file from the git, but then the workflow ofc. won't work

#

What would you recommend doing to solve this?

floral whale
static urchin
#

Well you can reuse that user but yea

#

keep your credentials

#

create a new user, idk github-actions's the name

#

give that as little permissions as possible

#

and have your github action use that username/password

#

you don't checkin the passwords into git

#

your build script can pull them from the environment

floral whale
#

But wouldn't I need to manually create a new github user for every repository I make then?

#

And every dev working on the repo would need their own read-only user?

static urchin
#

huh ?

floral whale
#

I might be misunderstanding this completely lol

static urchin
#

well, you can just give github-actions user read access to repo a and b

#

and no, the credentials are with github

#

so devs just have their code run

#

github supplies the secrets you set

floral whale
#

But who has access to the github-actions user then? Only the owner ig? And then people can use it as authentication?

static urchin
#

You know the username and password

#

you store it on github

#

github passes it to gradle during the actions run

#

your devs and other people preferably don't get it

floral whale
#

Then a dev could just log into the user and see all the credentials though? Or well secrets ig it is

static urchin
#

if they have login access to the owner account of the github repo sure ?

floral whale
#

Because that aint me lol

static urchin
#

oh

floral whale
#

I'm just working on the team

static urchin
#

well yea

#

the owner then or whoever does credentials

floral whale
#

But the devs using the github-actions user shouldn't have the login credentials correct?

static urchin
#

the devs locally have their own accounts

#

the github-actions user is only for inside github actions

floral whale
#

Yeah, but how can I then use the read-only user to access the secrets? Without having the login credentials for it

static urchin
#

huh ?

The workflow is like this:
your local pc:
you have your repo credientials valdemar (password123) somewhere.
You use them to build stuff locally
you don't check them into git, only you know them

github actions container:
github knows github-actions user and their password test456
your github workflow yml stores those values in environment variables or a file or whatever ( a bunch of ways work) when building in github actions
the gradle daemon in the github actions container can now read from your reposilite using the github-actions user
build the jar, publish it to releases whatever

#

you never get the credentials to github-actions

floral whale
#

Ohhh I see, didn't know github actions had a container like that, but that would make sense yeah. The difficult part (for me at least) would be setting the github-actions user correctly up, doesn't sound very simple. So, me, as a dev on the team / organization wouldn't have to change anything to use the auth of the github-actions user to read it?

But even if this is setup correctly, there should also be a read-only account for the maven repository right? So the github-actions can get the required dependencies to build the jar

static urchin
#

github actions run not on your PC

#

they run on githubs servers

#

you as a developer never "use" them

#

and yes github-actions is literally the "read-only account for the maven repo"

floral whale
static urchin
#

github users ?

floral whale
#

read-only github and read-only reposilite accounts then

static urchin
#

the fuck is a read-only github user

floral whale
#

Isnt that what you meant by github-actions? lmao

static urchin
#

do you guys share a github user ??

#

no

floral whale
static urchin
#

I only ever meant a reposilit account

floral whale
#

OHHHH

#

Okay

#

I see

static urchin
#

or whatever that software is called

floral whale
#

So I can just add another secret here that would be the credentials for that reposilite account right?

        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
static urchin
#

Yea

floral whale
#

Makes a lot more sense now lol, I thought you meant a read-only github user

static urchin
#

ah πŸ˜… yea sorry for not being clearer

floral whale
#

Nah that's my bad lol, thanks for all the help! :))

static urchin
#

if you want to follow up on some good practices

floral whale
static urchin
#

Yea sure πŸ‘

floral whale
#

Perfect, thank you!

bleak lark
#
        at me.codedbyyou.computersecurity.ComputerSecurity.onEnable(ComputerSecurity.kt:25) ~[ComputerSecurity-1.0-SNAPSHOT.jar:?]```
i get this error, so i tried to shade kotlin it it didnt work, i also tried @ thelooter's suggestion it didnt work by implementing it
humble scaffold
#

Can you show me the complete Build Gradle

lament scarab
#

I mean, first guess is, "are you actually running shadowJar?"

humble scaffold
#

true

bleak lark
#

i used the plugin it created the gradle file for me and etc.. i added the output and thats all, i dont think its wrong though

lament scarab
#

well, that just looks, weird

bleak lark
#

well i got it working, somehow

#

thanks for the help

#

finally i can work on the plugin, got 6 finals, so i wanted to use mc as part of the project final

bleak lark