#build-tooling-help
1 messages Β· Page 5 of 1
does it happen if you don't do it from the ide?
Pastebin.pl is a website where you can store code/text online for a set period of time and share to anybody on earth
not an issue with build tooling
(unsupported version of paper, and looks like you have malware or some shit)
Site's not even loading for me π€
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
you would need to publish it to a maven repo
(be that maven local or a remote one, see the maven publish plugin
could you send me the docs?
No
I can't reload gradle
how could i reference my scoreboard to my config so i can add and remove lines
This channel is for help with build tooling, i.e. gradle, maven, etc
mb
how to fix it?
can you send the entire logs including the run command? that could help us
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
no
i mean you might be able to change it in the gradle build file but honestly just downloading java 17 is easier
adoptium has very good jdks for java 17 https://adoptium.net/temurin/releases/?version=17&os=windows
ok thx
send your build script
message.txt by @kind bronze: https://pastes.dev/E6MO5KohVd
Make sure that paperweight is updated
send your build and settings files
message.txt by @kind bronze: https://pastes.dev/vGzOYQTm6Z
you need to actually add the dev bundle
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",
)
can you link me to the docs?
i cant find it
unresolved reference paperweight
they couldn't get to that error without a dev bundle...
move the java toolchain block inside allprojects
sorry, i work with gradle first time, what do you mean?
same with the tasks.compileJava part
i just cant build oraxen from source
oh so this isn't your project
ask them for help, this channel is for developers
they doesnt help me
so i cant receive support about my question?
We can't provide support for building every random project on the internet, especially if you're unfamiliar with stuff in general
there is a specific build error lol
And it's not our project, you've been given advice on general tweaks that might fix it
message.txt by @kind bronze: https://pastes.dev/BUjdd1gFPH
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
yes, im on windows
wdym by trying the shorter path?
instead of doing it on your documents folder or whatever, try a folder ontop of the c drive or some other drive
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
i should try this i mean?
15m is crazy
Sure is
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
That repo also has multiple NMS versions so of course it's taking longer the first time
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?
Well, if you don't expose kotlin then you won't be able to expose its features
yeah that makes sense, just wanted to make sure
Honestly I would just not relocate kotlin in your case
there isnt really a better solution
and this is a problem I'm also going to have
paperweight doesn't support maven
ok
https://i.imgur.com/hzwLN4M.png
https://i.imgur.com/7k9jQZg.png
gradle 8.4
pw 1.5.9
okay seems like adding my maven repos breaks it?
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/
their repo is borked
there might be a way to tell gradle to ignore that it's borked
but, er, gl
borked?
wat
download jar manually and import to my plugin
Hey that actually worked, thanks
I didn't know their repo is broken
Are there any side effects if you know?
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
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
you need the diff command available
what is the diff cmd and how do i make it avalible?
whats the program called?
it was literally in the error
my bad lmfao
https://www.git-tower.com/blog/diff-tools-windows/
this was the first result for "dif program windows 11"
that it?
aight
No idea
No idea, see the changes
mk
wait
i have git bash already
C:\Program Files\Git\bin\bash.exe
thats the path
im deeply confused lol
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)
probably doesn't bundle a diff command then
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?
Because you don't have the command diff installed in the path
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

Rip
Should I install wsl2 or just switch entirely to Linux?
wsl works pretty nicely imo
Oki
So will wsl just fix it? Install it and run the cmd again and it works?
Maybe restart my computer lol
well you will need to run it in WSL of course, but yeah
Run intellij terminal in WSL?
I have that. That's weird. I will try and figure that out later
how 2 compile a plugin
depends on the plugin
depends on the build system they use
We can't really provide support for building random software you find on the internet
i think itβs maven
they are not clear
I mean, https://github.com/Electroid/SportPaper (if that is the correct fork) has instructions
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?
has example
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?
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
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
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
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"
Guess it's an API issue then, as https://jd.papermc.io/paper/1.20/org/bukkit/Server.html#getVersion() is nonNull
declaration: package: org.bukkit, interface: Server
(so a plugin I was testing with broke)
I mean, you are running a completely unofficial distribution of paper when you runDev
If we can nicely fix the version, sure
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)
idk how it would return null tbh 
@Override
public String getVersion() {
return this.serverVersion + " (MC: " + this.console.getServerVersion() + ")";
}
like
you might get null (MC: null)
Well, yea, that's probs what they mean
I mean runreobf works file
Uh might have been get server version or smth
It just returned null, it might be the plugins issue
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
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
null (MC: 1.20.2)
I'll need to see what the plugin is doing and if it's api
would basically need to extract out the manifest generation to somewhere like process resources maybe, idk how runDev derives its thing
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
declaration: package: org.bukkit, class: Bukkit
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
you'll want to try running that with at least --stacktrace since that doesn't say anything useful
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?
there is https://github.com/jpenilla/run-task
yes that is it, thanks!
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
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 π
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
Trying to use https://github.com/jpenilla/gremlin but I keep getting https://pastes.dev/7tKXGjxSuC
Also cna't quite figure out how to change the port using run-task, have this but it's not recognizing the -p https://i.imgur.com/G3poGW1.png
tried args("-p", "25519")?
Is it possible to use the paperclip system for plugins and apply patches on the Fly
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
On runtime when the plugin is loaded
But in combination with a Java Agent it's possible?
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
Not really just a idea to roll out updates without reload and restart
And just apply diffs
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
(but, none of this stuff is stable, none of this stuff is intended to be used in production environments, etc; expect crashes, etc)
Was just a evaluation of possibilities
need more info
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
that task looks really hacky, what's it supposed to do?
Get jar from fabric build system
Than run shadowJar for all other subprojects and merge them all together
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?
That breaks with loom
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
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
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"))
}
}```
what command are you using to build
the normal build command, btw gradle build
Help me please I am using Gradle build
Some things canβt be relocated due to native bindings, maybe the driver is one of them?
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
ur not shading maria db
my shadowJar it looks like this
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
Fuck, you're a genius :/
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
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.
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
it works in gradle, but not maven π
you might be able to set the classifier to dev, but, oraxen seemingly relies upon paperweight
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
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?
you can specify the configuration for the project dependency
how?
project(":blah", configuration = "reobfJar") or something
A dependency was declared on configuration 'reobfJar' which is not declared in the descriptor for project :disguises.
might be called reobf, idr 100%
that worked thanks
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..?
rubtiemonly(project) { targetConfigiration =
thanks!
rubtiemonly
new gradle config
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?
generally, decompiler mismatch
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?
the decompiler version is specified in your build config
otherwise, you'd need to look into why the hunks failed
Does this version need to match papers version? Is that the issue?
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?
you would need to look into it yourself and work out why the hunks are failing
Hey,
I am using HikariCP and i want to compile it into my jar file. Does anyone know how to?
what build@tool are you using
gradle
shadow plugin
can you give me a example please?
https://github.com/johnrengelman/shadow
Gradle plugin to create fat/uber JARs, apply file transforms, and relocate packages for applications and libraries. Gradle version of Maven's Shade plugin.
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
environment variables iirc
RepoNameUsername
RepoNamePassword
(google "github gradle publish", theres about several dozen guides)
there are also plugins they let you use your maven settings file
that just sounds like technical debt hell
There are worse things I could do...
Does anyone know how to shadow the same dependency twice.
Once relocated and the other time not.
Huh, why?
Asking about your attempted solution rather than your actual problem
?????
I already talked about it here
Link?
Looking for it
It will be faster to just write it
Basically velocity requires not relocated dependency. Fabric requires relocated one.
seperate jars
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
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
What do you mean by pull in the output of the shadow
that
you tell the thing to shade in the shadowJar of that module instead of the standard configuration output
well, yea, that would work
I need custom task because fabric anyway
What else should I do?
read the documentation I linked
If you're trying to hire or pay someone you'll want to look elsewhere. Paper is not a marketplace.
This doesn't change my response. Please do not try to solicit developers here.
you literally attempted to hire a developer 
Deleting the message won't change that lmao
I thought that asking someone if he can do it for me and that I am willing to compensate him isnt considered hiring but sure.
Because my intent wasnt to hire somone for work
you can hire people for temporary jobs too π
but w/e, nothing to discuss here π its just a warning
It was more like that it is more time efficient for someone to do it for me instead me asking stupid questions.
This is exactly what the rule is for. We don't allow that here. You've been warned already once. We don't need to keep discussing whether or not what you're trying to do is considering "hiring" in the build-tooling-help channel.
Don't try to hire developers or pay people to setup projects for you.
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.
Does not check out. It is my first warning
HelpChat has a for hire section and is linked in the #community-guilds channel
hey there fam i have a question
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
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
this is not really a build tooling question
gotcha sorry boys
So if finalzedBy is bad should I replace it with dependsOn?
Oh so this makes sure shadow is run right?
//Include the output from shadowJar
zipTree(shadowJar.archiveFile);
}```
But that does something completely different
I need to run finalJar as the new build
So thats why finalizedBy is there
if you already know better then what are you asking about
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)
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?
is that the remapjar or shadowjar
actually doesn't matter
project.tasks.named('taskName', AbstractArchiveTask).archiveFile
assemble and build are lifecycle tasks
from zipTree(project(':MineStore-Fabric').tasks.named("build", DefaultTask).archiveFile)
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 
for fabric, that's usually the main output
try moving the task creation into an afterEvaluate {}
Did u put the code before or after defining plugins?
it's cross-project configuration
Ohh my bad ignore me
Still not found
I think it runs this build.gradle first
So it knows nothing about the subprojects
That is my only guess
yeah solving this properly is a bit complicated
That is why I used dependsOn and this
btw you're still using finalizedby π
Yeah because dependsOn produces 1kb jar
...
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....)
But finalizedBy is still needed?
when have I said anything about finalizedBy other than to remove it and replace it with dependsOn
ok sry
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.
I guess that doesnt work
Because archiveFile does not exist on it
might need task.flatMap { it.archiveFile }
usually you can skip that with groovy tho
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
What exactly is flatMap?
What does it represent
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
Did you use shadowjar properly?
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"
Define huge?
4.44 MB
What is your full dependency list?
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")
Latest what?
Server version
Yes
Try using the plugin.yml library loader instead (of shadow) then if you donβt want the bloat in the jar https://www.spigotmc.org/threads/spigot-bungeecord-1-17-1-17-1.510208/#post-4184317
Is there some way to do it with Gradle instead? I'm not sure if it's like relocating or what it is
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
Well I mean however plugins like LP can lower it I'd like to do
LP uses their own dependency loader
How can I minimize it?
Itβs a method in the shadow plugin
tasks {
withType<ShadowJar> {
archiveClassifier.set("")
minimize()
}
}
make sure to exclude the mysql connector from minimizing
Wonβt really reduce his output by much then, the hikari lib was only 100-200kb and the mysql connector 2mb
yea
but the minimizer is gonna poof it altogether, since it's discovered via SPI and holds no bytecode references
Poor man
what if you try the new coordinates com.mysql:mysql-connector-j:8.0.33
also try excluding com.google.protobuf:protobuf-java : https://dev.mysql.com/doc/connector-j/en/connector-j-installing-maven.html
just from googling
- 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
(WIP) A Minecraft Paper plugin that allows for adding new blocks and items in YAML, using resource packs - Java CI with Gradle Β· Workflow runs Β· btarg/Origami
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
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"?
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
ok thanks, I'll do that now then
should i commit gradlew and its bat file as well as the wrapper.properties and jar?
yes
when you use gradle init to create the project you'll get a default .gitattributes and .gitignore that specify settings for that
.gitattributes ```
https://help.github.com/articles/dealing-with-line-endings/
Linux start script should use lf
/gradlew text eol=lf
These are Windows script files and should use crlf
*.bat text eol=crlf
.gitignore (with intellij stuff added) ```
Ignore Gradle project-specific cache directory
.gradle
Ignore Gradle build output directory
build
.idea/
*/.idea/
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
might need to look into this https://github.com/actions-ecosystem/action-regex-match
- 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
I should probably make it Origami-*
nope
that would just match Origami and then any number of -
for example Origami-- or Origami----------
I am terrible at writing regex so I have no idea how to make it work properly
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
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
I would recommend https://github.com/modmuss50/mod-publish-plugin
for a gradle plugin based approach (combined with hangar-publish-plugin ofc :p)
actions-based is valid though, it's a preference thing
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?
my build file btw https://github.com/btarg/Origami/blob/master/build.gradle.kts
env vars is for easily passing CI secrets, basically
you can use $GRADLE_USER_HOME/gradle.properties though
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
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
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
Do you have shadow gradle plugin?
No, i have never used gradle
if its for a minecraft plugin you can also try adding it to the libraries in your plugin.yml then your plugin jar will be a lot smaller cause you don't need to shade it https://docs.papermc.io/paper/dev/plugin-yml#libraries
This is only since 1.12 afaik
i mean what version do they program there plugin for?
We dont know π
Isnβt it much later
1.12 isn't supported anyway
@eager cave
Yeah sorry, one second im trying that rn
i think it got introduced in 1.16
yeah im on the most recent version
fixed my issue
ty guys :P
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
You used gradle shadow or plugin.yml?
If you used shadow make sure to relocate
plugin.yml
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?
ok, got it working by setting
systemProp.file.encoding=utf-8
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
in my global gradle.properties
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
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
Setup is def requires since it sets up the resource folder, yes
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
this was a big help for me ty
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?
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
get rid of the artifacts part
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)
Can I use that for making a private github repo though?
Aight ty
you can use nexus for a private repository yes
its the standard way of doing it
Its still published after removing the artifcats part
i'd need to see more of your gradle scripts then
Also where does it then go?
you host it yourself
private github packages also arent free
I want to avoid hosting though, I'm trying to just "host" it on github
But it can be as a normal repository no?
Sec
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
Didn't think that was bad lol
Oh well
I should probably just use mavenLocal until we get an actual hosted maven repository then
you can also just publish the API of your project
but eh idk
yeah the proper way would be through a nexus instance
this way, its still public for those who want to use your API (if its meant to be used)
but the implementation is private
It's not meant to be used, it's just a library for one dev team
Just would prefer not having to add it to every project manually
As a file
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
Oh what didn't know that was a thing but makes sense
How would you then recommend hosting a private maven repo?
there are many ways
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
Yeah we will have a server available to host it
But is it hosted through "nexus" or whatever that is
no, nexus is just the software
you can download it and run it
there's the image
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?
you start the image on the server and configure it
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
So it has to be published on the host? Otherwise anyone can just add a repository?
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
Alright I'll let the server manager take care of this lol, I don't understand all this haha
nice
Probably fine
you will probably still want to exclude the entire org.bukkit:bukkit stuff. since that might conflict with the api you put directly into your dependencies
Yeah kinda confused why Vault would include all that
When I say all that I mean just bukkit lol
because vault
Knew it'd help others, no problem!
I might actually switch to your solution
Although it would still be gradle so it wonβt fix the issue
@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
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
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.
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!
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
mklink plugin.jar <path to jar in gradle output> (in plugins directory)
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
windows?
yeah
Shoould be faster on subsequent runs, but yeah windows can be slow
does paperweight work with maven
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.. ?
let me try
send a screenshot of the contents of ./build/libs if it doesn't work
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
Please send large files/logs to a pastebin
A sensible, modern pastebin. Share text and source code snippets with no hassle.
in the future
aight, mb
what jar are you using
top one
wdym
use the top one
ok
another error
you need to shade it in
running this task gives the bottom one
what does that mean
change compileOnly to implementation
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
what exactly is that generateEverything method doing
it looks like java serialization 
the caused by stack I'm guessing
yeah don't use java serialization
use gson or configurate or the config api or something
that's why it's saying class not found
oh my GOD i cant believe i wasted so many hours on this
You are always welcome to ask help here. We have gradle wizard jmp here 
i think im good
but THANKS A LOT I LOVE YOU ALL
this is how much time i wasted trying to fix this btw
Example?
Maybe ill switch to that.
gson is probably easiest for local file based storage
other than that you could use a database
A Java serialization/deserialization library to convert Java Objects into JSON and back
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
π
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
Generally you donβt, you add a copy task
how to achieve that
give me a minute I'll send something I can pin
tyt
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)
shouldnt this work then?
probably
it doesn't :(
you need to give more details
it's not going to that path
did you actually run the task
reobfJar? yes
...
that's the one you need to run
it will call reobfJar on it's own, read https://docs.gradle.org/current/userguide/lazy_configuration.html#working_with_task_dependencies_in_lazy_properties if you don't get how that works
ok so thanks
but is there a way for it to show up here instead of using the terminal?
it's going to be under other unless you specify a group
Gradle Docs: https://docs.gradle.org/current/userguide/userguide.html
Maven Docs: https://maven.apache.org/guides/
you can do tasks.register<Copy>("copyJars"), slightly cleaner
It's only when I add implementation "org.bytedeco:javacv-platform:1.5.9" to my dependencies
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
see the log?
java.lang.OutOfMemoryError
ong
Yeah the problem of "it takes too long" still persists though
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
it's java
ah so right i have to give java access to more ram
the Xmx value is calculated based on the environment
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
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
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
are you using reposilite
Yes
Ah, then I get the no auth error, but I do have the correct credentials
Fragments are never send to servers
Could not PUT 'https://maven.summitrealms.com/releases/me/fullpage/blah/blah.jar'. Received status code 401 from server: Unauthorized
send logs & build config
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.
do the user and pass work in browser
Yes
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?
what exactly is ```kotlin
authentication {
create<BasicAuthentication>("basic")
}
Idk, it was on the guide made by Reposilite
try removing it
Same thing happens then
Removed special chars from passphrase, didn't fix it either
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
I mean, if you need a private repo or something and want to build on github CI, you need to get those credentials there
Github CI?
you said it runs fine locally ?
where is this failing ? Why is it even building there
It's failing when doing the action on github
Yea
So github CI
Idk what that is
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
https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions is pretty much your best friend
I'd advise to create a user that has as limited access to your repo as possible for this
How come?
I mean
I would not want admin credentials for my repo somewhere on github
even if github is trying its best to protect them
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
its fine just, don't give out admin perms
The credentials would just be in gradle.properties
single read-only user and you should be good to go
So the new user should just be able to read those secrets?
the user and their password you use in github actions only needs permissions to read your private repo
But then how do I read using the user but write using my main user?
do you write to the repo in the release ?
Oh yeah I don't I just add the latest jar and source code
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
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
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
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?
Then it would be one user pr repository though?
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
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?
huh ?
I might be misunderstanding this completely lol
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
But who has access to the github-actions user then? Only the owner ig? And then people can use it as authentication?
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
Then a dev could just log into the user and see all the credentials though? Or well secrets ig it is
if they have login access to the owner account of the github repo sure ?
Oh when you say you you mean the owner?
Because that aint me lol
oh
I'm just working on the team
But the devs using the github-actions user shouldn't have the login credentials correct?
the devs locally have their own accounts
the github-actions user is only for inside github actions
Yeah, but how can I then use the read-only user to access the secrets? Without having the login credentials for it
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
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
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"
Ah yeah, so we should setup another account for that as well, because we have different users for github and reposilite ofc
github users ?
read-only github and read-only reposilite accounts then
the fuck is a read-only github user
Isnt that what you meant by github-actions? lmao
No
I only ever meant a reposilit account
or whatever that software is called
So I can just add another secret here that would be the credentials for that reposilite account right?
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Yea
Makes a lot more sense now lol, I thought you meant a read-only github user
ah π yea sorry for not being clearer
Nah that's my bad lol, thanks for all the help! :))
Reposilite has this guide, ig it's good enough https://reposilite.com/guide/github
Yea sure π
Perfect, thank you!
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
https://github.com/thelooter/EventChecker/blob/main/build.gradle.kts I have this buildfile that works, maybe you can try finding a way there
Can you show me the complete Build Gradle
I mean, first guess is, "are you actually running shadowJar?"
true
Only weird thing i got is this
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
well, that just looks, weird
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
ok so this is the reason

