#build-tooling-help
1 messages · Page 3 of 1
sure
also open your jar and see if the classes are there
still
doesn't look like it
what command are you using to build
try using package
nope
i usually mvn clean package install, works just fine
didn't work
it doesn't build it any where
like i can't find the jar
looks lioke i am getting error with it as wel
your pom is correct, it's a code issue
don't think it is
send me your jar
is it located in C:\Users\Merlijn\Documents\Beyond\Servers\Proxy\plugins?
nope
so it's not the right one
?
your pom build the jar in C:\Users\Merlijn\Documents\Beyond\Servers\Proxy\plugins
as specified
yes?
so it's should be there
if i build it normaly it does.
shade failed
but if i use this it doesn't
no shit
the only way you should get your jar is mvn clean package
for you it's a pom issue
<version>LATEST</version>
it's a code issue for the other guy
Are you sure you can use LATEST as version there?
Stop pinging me bruh
what version sould i user?
user*?
bruh
i can't type
whatever HikariCP version you want to use?
Imo yes, at some point you stuff will not compile anymore because LATEST is incompatible with your code
Latest isn't even guaranteed to work fully
but that will not fix it?
not sure how maven works, I don't use that. you created somehow a profile "release" with the shade plugin. do you compile your plugin with that release profile?
?
why is there so much thing is your pom
idk
maybe you should drop the entire pom and start from scratch then.
there is no point in using stuff you don't understand.
Skoice.jar yes
i use that?
https://pastebin.com/yLtjvhrD this is what i have
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 scope = compile = in the jar, right?
iirc, yes
This should work
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mcpractice</groupId>
<artifactId>MCPracticeProxy</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>MCPracticeProxy</name>
<properties>
<java.version>11</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<minimizeJar>false</minimizeJar>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<repositories>
<repository>
<id>papermc-repo</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.velocitypowered</groupId>
<artifactId>velocity-api</artifactId>
<version>3.2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.28</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>5.0.0</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.27</version>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>4.3.1</version>
</dependency>
</dependencies>
</project>
don't spoon feed... and you're missing the relocation patterns here
he copied and pasted my pom, I just removed what wasn't necessary. it's true that he'll have to relocate but for testing it's not necessary
code issue
?
thanks one more thing why is Mysql lined out?
i guess?
prod the wrong place to ask but what is jdbcUrl?
thanks
If you run build here on build-logic you wont get fat jar
then add something so that assemble also executes shadowjar
The shadow needs to be on the build-logic
what
what
Without shadowJar implementation libs are not shaded in
shadow is there
Where?
Where is libs defined?
val libs = extensions.getByType(org.gradle.accessors.dm.LibrariesForLibs::class)
gradle/libs.versions.toml
it's needed for build-logic
Well my build logic is completely different I dont understand how this works at all 😄
I mean I get it but WTF
are ytou using build-logic or buildSrc
I am just using shadowJar
I get all the submodules and merge them
I do this on root
Well I just modified it so it matches how I do it
So I changed the configuration from "shadow" to "reobf"
This works so I am happy
haven't touched my build file for velocity, and now it's somehowbeing a hoe
no main manifest attribute, in server.jar
So I added this to my build.gradle
jar {
manifest {
attributes(
'Main-Class': 'io.github.haappi.duckvelocity.DuckVelocity'
)
}
}
Error: Unable to initialize main class io.github.haappi.duckvelocity.DuckVelocity
Caused by: java.lang.NoClassDefFoundError: com/velocitypowered/api/proxy/messages/ChannelIdentifier
.-.
https://hastebin.com/share/niqiyoboya.java build file
It was working before like, today
So I created a Paper fork using the PaperMC/paperweight-examples repository.
I've setup my project basically the way Folia has but when trying to execute gradlew applyPatches I get this error:
Command finished with 128 exit code: git -c commit.gpgsign=false -c core.safecrlf=false clone --no-hardlinks '<directory1>' '<directory2'
Is there anything I am missing?
smack the debug flag -Dpaperweight.debug=true applyPatches and provide the output
Thanks for that flag, that gave this:
error: unable to create file nms-patches/net/minecraft/world/level/storage/loot/predicates/LootItemConditionRandomChanceWithLooting.patch: Filename too long
error: unable to create file nms-patches/net/minecraft/world/level/storage/loot/predicates/LootItemConditionSurvivesExplosion.patch: Filename too long
Which makes me think that I should move this fork; probably into a directory that has a shorter path than the current directory
Yea
windows moment
Either move or, I think (has been a while since I touched windows) there is a flag somewhjere in the registry
Yeah, moving definitely solved that problem, now I am searching this stupid flag in the registry
filename too long... yikes
I mean, if it's possible, why is it not enabled by default?! Windows, whyyyyy?
"Windows, whyyyyy?" is honestly their slogan
Also, one more question, in theory, in my gradle.properties under paperRef I could put any commit hash that exists on the main branch of PaperMC/Paper, right?
Not only the main branch, but yes
so im trying to use paperweight userdev and i cant get the reobfJar task to work, can anyone help me? https://github.com/plexusorg/ItemizerX
it shows an error on startup that the nbt class couldn't be found and idk what im doing wrong
You want to specify the configuration in your project depend to depend on the reobfJar config
i am not sure how to do that
i can't depend on reobfJar in the core project and it already is for the subprojects
in the project() thing
you can specify a configuration, idr the syntax and my craptop won't cope, so, you'll have to crossref the docs for that project method thingy or look around for somebody with such a setup
alright, i figured it out
also, the paperDevBundle is crossed out
but i cant do the paperweight.paperDevBundle
the paperweight is in red
uh https://i.imgur.com/3b4Aqvh.png I get this when running ./gradlew runMojangMappedServer using run-paper
I mean, seems like a runtask issue ?
make sure you are up to date with paperweight userdev ?
iirc it grabs stuff from there
userdev 1.5.5
Hmmm, seems to work fine on the paperweight-test-plugin
How would I change the name of the jar? archiveBaseName doesn't exists (userdev)
read the example
bleh okay
what was the gradle tool to translate groovy to kotlin
okay, whatever, i used the chatgpt and prayer method
Anyone know if i can run multiple servers simultaneously using https://github.com/jpenilla/run-task?
yes
you need a task for each server, each with own run directory, then adjust the ports so they don't collide
I mean, it will run them in parallel if parallel mode is on. but you probably want to run it in separate terminal emulators so each one has it's own stdin/out
Hey, I'm reloading my gradle project within intellij which has multiple subprojects, and it's going through the whole paperweight shenanigans twice (once in the subproject that uses the plugin, and again when the parent project reloads). Is there anyway to stop this as it takes quite a while
send your root build.gradle and the sub project's
they are practically identical to the ones in the test plugin
Root
plugins {
kotlin("jvm") version "1.9.0" apply false
}
Plugin
import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm")
id("io.papermc.paperweight.userdev") version "1.5.5"
id("xyz.jpenilla.run-paper") version "2.1.0"
}
group = "com.jackchap"
version = "1.0.0-SNAPSHOT"
description = "A plugin to provide your servers stats to the Universal Stats Bot"
dependencies {
paperweight.paperDevBundle("1.20.1-R0.1-SNAPSHOT")
compileOnly(kotlin("reflect"))
}
tasks {
assemble {
dependsOn(reobfJar)
}
processResources {
filteringCharset = Charsets.UTF_8.name() // We want UTF-8 for everything
val props = mapOf(
"name" to project.name,
"version" to project.version,
"description" to project.description,
"apiVersion" to "1.20",
"kotlinVersion" to getKotlinPluginVersion(),
)
inputs.properties(props)
filesMatching("plugin.yml") {
expand(props)
}
}
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "17"
kotlinOptions.freeCompilerArgs = listOf("-Xcontext-receivers")
}
other sub project uses kotlin plugin but not paperweight
How do I make blossom run on build?
or rather, on assemble or jar, whichever one is better (I'm using it to substitute plugin version)
you need to apply paperweight to the root plugin
blossom {
val constants = "src/main/java/com/oskarsmc/tablist/TabListPlugin.java"
replaceToken("\${version}", version, constants)
}
tasks.assemble { dependsOn(tasks.named("blossomSourceReplacementJava")) }
with apply false
not u
even if its only in one subproject?
yes
i assumed that was if it was in multiple
okay
I was just about to try that as I thought that might have been the case
this works but this if anyone knows any improvements please say!
didn't need to, somehow intellij had made two separate gradle builds, one for the root, and one for a single subproject?! deleted the separate build and now its all built correctly
according to the userdev docs it is required /shrug
Due to a gradle bug, independently applying paperweight-userdev to multiple projects in a build can result in errors
I mean, that's for mutliple sub projects
yes, that was my understanding
and what the readme says
I think what happened was I copied over a template plugin of mine including the gradle wrapper so intellij assumed it was a separate project rather than a subproject
Can I just ignore this? https://i.imgur.com/0xAPW8g.png
I already did git prune a few times
i mean, yes
but, if you wanna ru that command, you'd need to do it in the submodules
i answered you in paper-dev
I added the repo paper
send a new screenshot then
also try to use the actual release
so 1.5.5
is the latest
iirc
but again, wtf are you trying to do
Could somebody help me set up velocity?
no
(64b75287cdf07f25f6ac9fa9) // @solar heath (keysean#0082 / 958908249049038920) has been kicked by @rapid fractal (177150983258767360)
Reason: troll and impolite person
How to set up a papermc server on Linux?
head to #paper-help for help with administration of servers
So currently
I've been trying to achieve what I want (including the :common subproject inside the :paper and :fabric jars) without using any plugins by using the solution as presented here: https://discuss.gradle.org/t/how-to-include-dependencies-in-jar/19571/5. I had to adjust it a bit and in the end my build.gradle file for :fabric looked like this:
configurations {
includeInJar
}
dependencies {
configurations.implementation.extendsFrom(configurations.includeInJar)
includeInJar project(':common')
compileOnly "io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT"
}
jar {
dependsOn ':common:remapJar'
from {
configurations.includeInJar.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}```
That worked, in that it actually included the classes from :common inside the :fabric JAR, however...
When I then published my stuff to maven local, and tried to use it in a different project, it said this ```
A problem occurred configuring root project 'SeedMapper'.
Could not resolve all files for configuration ':modImplementation'.
Could not find dev.xpple:common:1.1.5-multi-platform.
Searched in the following locations:
- file:/C:/Users/frede/IdeaProjects/SeedMapper/.gradle/loom-cache/remapped_mods/dev/xpple/common/1.1.5-multi-platform/common-1.1.5-multi-platform.pom
- file:/C:/Users/frede/.gradle/caches/fabric-loom/minecraftMaven/dev/xpple/common/1.1.5-multi-platform/common-1.1.5-multi-platform.pom
- file:/C:/Users/frede/IdeaProjects/SeedMapper/.gradle/loom-cache/minecraftMaven/dev/xpple/common/1.1.5-multi-platform/common-1.1.5-multi-platform.pom
- https://maven.fabricmc.net/dev/xpple/common/1.1.5-multi-platform/common-1.1.5-multi-platform.pom
- https://libraries.minecraft.net/dev/xpple/common/1.1.5-multi-platform/common-1.1.5-multi-platform.pom
- https://libraries.minecraft.net/dev/xpple/common/1.1.5-multi-platform/common-1.1.5-multi-platform.jar
- https://repo.maven.apache.org/maven2/dev/xpple/common/1.1.5-multi-platform/common-1.1.5-multi-platform.pom
- file:/C:/Users/frede/.m2/repository/dev/xpple/common/1.1.5-multi-platform/common-1.1.5-multi-platform.pom
- https://maven.xpple.dev/maven2/dev/xpple/common/1.1.5-multi-platform/common-1.1.5-multi-platform.pom
- https://nexus.seedfinding.com/repository/maven-seedfinding/dev/xpple/common/1.1.5-multi-platform/common-1.1.5-multi-platform.pom
- https://nexus.seedfinding.com/repository/maven-seedfinding-snapshots/dev/xpple/common/1.1.5-multi-platform/common-1.1.5-multi-platform.pom
Required by:
project : > dev.xpple:betterconfig:1.1.5-multi-platform-fabric```
@lethal sparrow what version of runTask
2.1.0
So for some reason it started looking for dev.xpple:common:... even though that doesn't exist outside of my development environment
it works for me ¯_(ツ)_/¯
I could confirm my suspicion by looking inside the .module file inside the JAR file, where it says this { "group": "dev.xpple", "module": "common", "version": { "requires": "1.1.5-multi-platform" } }
jvmArgs("-Xmx4000M", "-Xms4000M") might work but I'm unsure on how to see if it's actually doing anything.
So yeah that's where I am stuck now, so much so that I now want to use that shadow plugin instead
How can I get this window to show up when running the runServer task?
Remove some --nogui argument
It doesn't even regonize the nogui argument
its not a jvm arg, its a program arg
probably have to remove it from the args list in the task
I've tried all of this
args?.remove("--nogui");
args?.remove("-nogui");
args?.remove("nogui");```
but it did not work.
Although, I ended up downloading Spark and using /spark heapsummary just to see if `jvmArgs("-Xmx4000M", "-Xms4000M")` was actually affecting the memory and it does!
but...
the gui told you it worked... why did you need spark for that? xP
nvm im fucking stupid lmao
How can I set up a test server task for my plugin?
And also a test module along side my main module?
gradle should automatically do that. just create the folder
I think those are techincally sourceSets not modules to use the gradle parlance
Ty
Do I use paperweight-test-plugin to make a test plugin setup for my plugin?
what
I searched through this Discord and someone mentioned using it to test their plugin
Idfk
And in my case I don't wanna just test my plugin, I wanna test my plugin using another test plugin, since I'm writing a library plugin
paperweight-test-plugin is an example repo for paperweight-userdev, our way to allow plugin authors to access internals via a gradle plugin
it seems unrelated here
what is your defenition of a "testing plugin"
just create a plugin like normal..?
I want it in the same project as my main plugin
To use the classes from it
Something like this https://github.com/FabricMC/fabric/tree/1.20.1/fabric-api-base/src but then for plugins
I just want this, but...
- dependencies for project are separate from dependencies for tests
- why would you do that
There's a very good motivation
Yeah
What you can do is use a mock(Plugin.class) from Mockito
Then stub the methods returning the relevant information
yeah, use mockito
Basically just mock anything not directly being tested if it's an interface outside your implementation (which TDD advocates will hate me for saying)
I mean, mocking is generally flawed testing wise
but, nobody wants to spin up entire dev environments and the tooling that goes along with that
either that or you basically focus on testability over caring about the actual intended goal
Sure thing, but until you find an alternative that allows me to write tests covering my entire plugin, be my guest and sit pretty
i only sit pretty on friday/saturday nights
Me too, Friday/Saturday is my weekend
Currently I have an entirely separate project to test my plugin, and along with that a server set up somewhere. All I want is to have that in one place
basically, for good testing, you generally kinda need to focus on testing
mocking is one of those kinda neccessary evils on some front
I mean testing it like this is really inefficient
I love necessary evils
Really
So join me on the dark side and embrace the automated mocking mess
Idk what it is exactly but it doesn't feel like something I'd need to use for this
I mean, that's what mockito is
it just helps with some stuff where it generally ain't as viable or desirable to maintain 200 different mocks
It should be possible to achieve what I want with some Gradle hacks
Well, your missing class is a classpath issue
Test dependency?
I mean, afaik the test classpath generally derives from some aspects of the other classpaths
otherwise, you can explictly add stuff to the test classpath
Ahhh does it work like that, I see
I'm a total noob when it comes to Gradle
Well that was an easy fix lol
Okay I've got almost everything sorted out
The only thing that remains is to build the test plugin somehow
I don't think you can build a jar w/o some custom tasks from the tests source folder
show the whole project tree
This is the paper subproject
why does that matter
paper does it
Because it's nice to have similar structures in your project
It doesn't make sense to have common, paper, fabric and then also testplugin as subprojects
No one ever has done it like that
you could have testplugin as a subproject of paper
I guess that could work? But I'd rather not, is there really no way to build the test sources?
yes, by making it a subproject
each source set has its own compileXxJava and xxClasses tasks anyway
Does that create something similar to build/libs?
you'd still need to setup a task to actually create the jar
see the tasks task
but again, this would be a million times easier with a subproject
i think it sets up xxJar as well but, i don't remember
xx being the name of the sourceSet
When I do testpluginClasses it complains that it can't find some class from my main source set, is the below not correct? gradle sourceSets { testplugin { compileClasspath += main.compileClasspath runtimeClasspath += main.runtimeClasspath compileClasspath += main.java runtimeClasspath += main.java } }
doesn't look like it https://i.imgur.com/7GJkIFe.png
Yea it's not there for me either
--all?
okay then it doesn't set up a jar task ¯_(ツ)_/¯
but it's like 3 lines to set one up
from(sourceset.outputs) or something
I see, I'll look that up
What about this?
Ah do I need main.output instead of main.java
What is the difference between compileTestJava and testClasses?
classes task is like the combination of various compileLanguage tasks
So it's better to use that one ig?
For future people with this problem:```gradle
tasks.register('buildTestplugin', Jar) {
it.group = 'paper'
it.archiveBaseName = 'testplugin'
it.archiveVersion = '1.0.0'
from sourceSets.testplugin.output
}
tasks.register('copyJarsToServer') {
it.group = 'paper'
doLast {
copy {
from jar
into "${projectDir}/run/plugins"
}
copy {
from buildTestplugin
into "${projectDir}/run/plugins"
}
}
}
copyJarsToServer.dependsOn(build, buildTestplugin)
tasks.register('runTestpluginServer') {
it.group = 'paper'
doLast {
javaexec {
workingDir = "${projectDir}/run"
main = '-jar'
args = ["${projectDir}/run/server.jar", '--nogui']
jvmArgs = ['-Dcom.mojang.eula.agree=true']
standardInput = System.in
}
}
}
runTestpluginServer.dependsOn(copyJarsToServer)```
or ```groovy
plugins {
id(“xyz.jpenilla.run-paper”) version “2.1.0”
}
tasks.register('buildTestplugin', Jar) {
it.group = 'build'
it.archiveBaseName = 'testplugin'
it.archiveVersion = '1.0.0'
from sourceSets.testplugin.output
}
tasks.runServer {
minecraftVersion(“1.20.1”)
pluginJars.from(tasks.jar.archiveFile, tasks.buildTestplugin.archiveFile)
systemProperty(“com.mojang.eula.agree”, true)
}
I totally would have used that if I knew it existed
funny quotes
lol
Noticed that too
Anyone know why i can't type runServer to build a server ?
"can't"
^ what’s the problem / error
i can't runServer in my console (normally that will start a server with my plugin on a papermc server)
That doesn't really tell anything, do you get an error or something? What's the command you're running?
Like, we're not magicians here, just saying "can't" gives us literally nothing to go off
lol
oh
I'm feeling... dumb
Do you know how to accept the eula with the runServer task ?
where ?
in the RunServer task
tasks {
runServer {
minecraftVersion(Constants.MINECRAFT_VERSION)
jvmArguments.add("-Dcom.mojang.eula.agree=true")
systemProperty("terminal.jline", false)
systemProperty("terminal.ansi", true)
}
}
what do the systemProperty ?
colors
ok
hmmmm
same problem
are you using kotlin or groovy dsl
try to actually run it
from the commandline
best guess would be plugin version or something
but, er
isn't that from erm, what's it called
gradles own thingy?
brain, words, etc
plugins {
id("java")
id("xyz.jpenilla.run-paper") version "2.1.0"
}
group = "io.lakwiss.paper"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
tasks {
runServer {
minecraftVersion("1.20.1")
jvmArguments.add("-Dcom.mojang.eula.agree=true")
systemProperty("terminal.jline", false)
systemProperty("terminal.ansi", true)
}
}
That's all my code
¯_(ツ)_/¯
Cannot resolve resource filtering of MatchingCopyAction. IDEA may fail to build project. Consider using delegated build (enabled by default).
btw what does this warning mean and how to fix if possible
processResources {
filesMatching("paper-plugin.yml") {
expand(project.properties)
}
filesMatching("plugin.yml") {
expand(project.properties)
}
}
val targetJavaVersion = providers.gradleProperty("java_version").get()
how can i convert this val into an int?
(in kts)
.toInt()
ty
build.grade.kts by @cold jay: https://pastes.dev/RvJaUzkdvv
what's missing?
because you want to run reobfJar
yes
my bad i put dependsOn(shadowJar) instead of reobfJar
Do I have to clear paperweight's caches for it to update the api?
or something else?
alr
How do I delete a patch from my fork? Is it safe to just delete the patch file?
You want a proper paperweight fork that has a patch that is a revert of the initial patch, fixing all conflicts that arise
I.e. run git revert in forkname-server, fix conflicts so it compiles, rebuild patches
any clue how I can apply userdev via apply?
trying to see if I can format my multi-module project abit differently like this in the main one but cant seem to apply it
normal plugins {} complains so
plugins block has to be at the top
im trying to strip out submodules needing their own build gradle file, and move it all into the main one
iknow the block needs to be at the top normally but cant use the block within the submodules like that
put it at the top with apply false
umean like this?
yes
seems to work though I have to use the deprecated paperDevBundle as it still doesnt find "paperweight"
im very new to papermc development and i was tryna code a plugin in kotlin but im getting this err
Plugin 'org.jetbrains.kotlin:kotlin-maven-plugin:1.9.0' not found
id recommend using gradle with kotlin
Hey, I'm trying to make project as api, however I have issue with publishing, I am not sure, how it should be there, this is what I have currently
publishing {
publications {
shadow(MavenPublication) {
from components.shadow
}
}
}
build.gradle -> https://pastes.dev/t1JVLIxPw1
shadow looks quite out of place there
Generally you don’t publish your shadow jar
You should declare your dependencies in such a way that when someone else depends on you, they get your dependencies transitively. And then you can hide some dependencies that aren’t needed for the “api” part of your project
it fails always to build on jitpack
⚠️ WARNING:
Gradle 'publishToMavenLocal' task not found. Please add the 'maven-publish' or 'maven' plugin.
See the documentation and examples: https://docs.jitpack.io
you need to add repositories to publish to
Why am I getting this error? Could not determine the dependencies of task ':commander-paper:compileJava'.
wait what
show your build scripts
plugins {
id("java")
id("maven-publish")
}
repositories {
maven("https://repo.papermc.io/repository/maven-public/")
}
dependencies {
implementation(project(mapOf("path" to ":commander-common")))
compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = "com.github.QuadraBoy"
artifactId = "commander-paper"
version = "0.1-ALPHA"
from(components["java"])
}
}
}
I'm new to making Gradle multi-projects and I have no idea why I'm getting this error
Please send large files/logs to a pastebin
A sensible, modern pastebin. Share text and source code snippets with no hassle.
Because it wants you to define it in the root project so that that task exists globally is my guess
https://github.com/QuadraBoy/commander you can check this repository that I made for testing
and build log is this https://paste.gg/p/anonymous/a98c3cc591bf445b8f31edf1dcc6027e
under subprojects?
So under the root plugins?
Well, you can just provide it to the needed sub modules I guess
Generally you add stuff that affects the entire build into the root config, but, idk the conventions too well so
class org.gradle.api.internal.project.DefaultProject_Decorated cannot be cast to class org.gradle.api.initialization.Settings (org.gradle.api.internal.project.DefaultProject_Decorated and org.gradle.api.initialization.Settings are in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @3b22cdd0)
I got this error
Phew, this Gradle multi-projrct thing is a real pain in the ass
It's 1:23 AM in my country I need to go sleep. I will test it tomorrow morning
So I've played bit with maven publish, but now seems, jitpack is throwing error about no local toolchains, when I added plugin org.gradle.toolchains.foojay-resolver-convention (0.4.0), which should fix this, gradle throws Gradle's dependency cache may be corrupt ....
Full error - https://pastes.dev/SHBxbgfrcW
are you sure I need to use 0.6.0? on gradle was 0.4.0
latest is 0.6.0
Ok so JitPack managed to successfully build my multi-project but when I tried to add the project as an dependency, IntelliJ gives me an error
it's trying to check the jar in the papermc repo even though it's on JitPack :/
Contribute to QuadraBoy/commander development by creating an account on GitHub.
you can check all of the build.gradle file on this repo
https://jitpack.io/#QuadraBoy/commander/0.1-BETA you can try it out for yourself
..you need to add jitpack's repo
it's been there
send your pom
the thng just logs the last repo it tried when it blew up
you might need to run run the thng with -U to tell maven to refetch stuff
outside of that, any issues with jitpack you'd basically need to take up with them; their stuff ain't exactly known here for being reliable
I tried running it with that flag but still, it doesn't work
is there a way to configure a finalizer task in gradle with an output of the parent task?
basically want to set the input of the finalizer task to one of the outputs
what do you mean "parent task"
sounds cursed
finalizer tasks are kinda annoying to use in general iirc, I used to use them in toothpick but they caused problems with inconsistent results
that was gradle 6 tho
The there are 2 apply patch tasks, and after both, the git repo is setup.
If there’s a way to configure finalizer task with an output of the task that’s being “finalized” I couldn’t find it
no you'd just need to wire stuff normally, and I think that comment is saying it breaks the finalization behavior to do that
is only one going to be run in a given gradle invocation?
and you're trying to use the same finalizer task regardless of which apply patch task is done?
Correct
I would say don't do that, just have a different finalizer for each, and use that hack where you pass the outputs while breaking the task dependency chain
like that comment is talking about
Hmm, so to pass the outputs i have to unwrap the provider then?
Or save the failed patches to a file and then load them from that file
Yeah ok. Then I can have one finalizer and just have both apply patch tasks save to the same spot
so if it has a task dependency on the output it can't be a finalizer, as then it could only run when the previous succeeded
yeah that would work too
It was seemingly working for me as is when the apply failed. Like I tested it with a patch that would conflict to make sure the whole thing worked
The apply patch task throws if any patch failed to apply
I’ll try it again to be sure that the finalizer is running if the apply patch fails.
But I can just change it to save/load from a file regardless
yeah finalizers always run even if the task they are finalizing fails
think of it as, one task sets up a temporary resource, you always want the finalizer for it to run to clean it up, regardless of build outcome
unfortunately if you tell gradle the finalizer task depends on the task it's finalizing via an input, then gradle decides the finalizer CAN'T run if the taks fails since its inputs aren't set up properly, so it never runs it
I don't know what @granite valve's question is tho
I had it set up to do the right thing already
the task is a finalizer for both apply patches tasks
yeah there should just be one setupSources task
applyPatches and applyPatchesFuzzy should never be run together, idk if there's a way to encode that in gradle tho. I would just call that UB and call it a day
or I guess the --max-fuzz argument could exist on just the single apply patches task and default to -1 for not setting it or something idk.
yeah, to pass the failed patches to the setup sources task so they aren't committed
but I can just do what you do for the patched jar, pass the file patch for a list of failed patches
the failed patches could just be in a different jar or something
yeah, that would work too. the way that pr does it now is just unstages those files after adding all diff before committing the Patched commit
ok, I went that way https://github.com/PaperMC/mache/pull/5. Just creates another jar that the "patched w/conflicts" file is moved to when using the native patcher
then that jar's file is copied back over after the patch commit
the java patcher doesn't have the 3-way merge conflict thing, so unsure how best to handle that. right now, just nothing happens. We could omit the whole file from the "patched" commit instead of just the patch conflict
So I think I messed really bad uhmm I can't access JetBrains' annotations and the adventure api in my project and I found out when removing my custom built api in the pom.xml seems to fix the issue
here's a picture
Here's a picture while I have my API in the pom.yml. I can't access the Adventure API, numerous methods of the CommandSender, Bukkit, and probably in other classes.
And here's the build.gradle of my API ```kts
plugins {
id("java")
id("maven-publish")
}
group = "me.quadraboy.commander"
version = "BETA-0.1"
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = "com.github.QuadraBoy"
artifactId = "commander"
version = "BETA-0.1"
from(components["java"])
}
}
}
show the dependency tree
@cinder ember ^^
Oh sorry I managed to fix it
alright, I assume it was that you had bukkit and/or spigot on the classpath?
yeah
ok nvm the issue returned
here's my pom.xml @distant mango
.
Sorry, I still don't get it
oh ok
again.
At line:1 char:1
+ mvn dependency:tree
+ ~~~
+ CategoryInfo : ObjectNotFound: (mvn:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
then just try running it in the termianl
Alt + f12
i believe maven is bundled with intellij
Oh that's where I run the command
this is the output it gave me though
I probably need to download maven right?
I thought intellij added maven to PATH 
where's the :nomaven: emote when you need it
So what am I gonna do?
are you using gradle and maven at the same time? or why do you have both a pom and a gradle buildscript
why dont you just use gradle for both?
I want to check if my API works for projects that uses maven
and here we are
they will, as long as you use the gradle maven publish plugin
you dont need to check it
gradle uses the maven publishing system
but your problem is actually that you arent using compileOnlyApi
instead of the java plugin, add the java-library plugin
this gives you access to dependency configrations such as api and compileOnlyApi
implementation and compileOnly won't create a transitive dependency, which seems to be your goal here
plugins {
id("java")
id("maven-publish")
}
group = "me.quadraboy.commander"
version = "BETA-0.1"
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = "com.github.QuadraBoy"
artifactId = "commander"
version = "BETA-0.1"
from(components["java"])
}
}
}
``` here's the gradle one btw
here is my updated build.gradle ```kts
plugins {
id("java-library")
id("maven-publish")
}
group = "me.quadraboy.commander"
version = "BETA-0.1"
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
}
dependencies {
compileOnlyApi("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = "com.github.QuadraBoy"
artifactId = "commander"
version = "BETA-0.1"
from(components["java"])
}
}
}
Is it right?
sure sure
alright I'm gonna test it out
but as I said, you really dont need to check it with maven - if it works with gradle its going to work with maven too because they use the same format
i should rephrase and not let my anti-maven-bias out so much: If it works with either one, its going to work with both
uhmm it still doesn't work
where are you publishing to
jitpack
you can try it
jitpack is a hacky mess that doesn't always work, try it with maven local
also fyi you really shouldn't use compileOnlyApi for your paper dep
pretty sure that'll cause it to be added to the jar for other people
had that happen to me once
compileOnly means it wont be included at runtime
thats the whole point of compileOnly
I know that, but a dependency that I was using had a compileOnlyAPi for paper which caused it to be added to my jar
then your shadow configuration was wrong
there is a compileClasspath and the runtimeClasspath
default shadow config /shrug
i mean i've never had any problems with shadow including anything other than the runtime classpath
^ @cinder ember
and for when you actually want to publish, I recommend going for maven central if its a serious project
you have to own the domain for your project
how can I do that?
but then its as simple as opening a ticket on their JIRA, i've done it three times now
you also have to meet the minimum requirements (i.e. publishing sources, javadoc, signing)
but its very doable and the standard for JVM projects
I'll consider that option since I just want to publish my private works
why do you want to publish?
Just for fun
anyways
Do you know what's causing this issue?
- try it with maven local
- make sure you also add the paper repository to the downstream project
I have the paper repo in my API
The issue only appears if I add my API as a dependency
what is the issue exactly
i thought you said that you dont have access to the paper classes through your api?
which means that naturally you wont have access if you remove your API
yes, I can't access some classes and methods in the PaperMC API including the Adventure API and JetBrains Annotations
But when I removed my API from the dependencies, the issue is gone
wait I'll provide some pictures
The issue only appears if I don't add my API as a dependency
whoops wrong explaination
here's the project without my API as a dependency
and here's the project with my API as a dependency
do you have paper api added as a dependnecy yourself
it's not including any transative dependnecies hence why it's not working
hmm, good point
How can I know that
I assumed he's not adding the paper api explicitly in the downstream project
yep
do you have compileOnly(paper...) in the downstream project
or implementation, compileOnlyApi, api
Wait so the downstream project is the API I made?
no
the downstream project is "down the stream" from your API
its the project that uses your API
oh
<repositories>
<repository>
<id>papermc-repo</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.QuadraBoy</groupId>
<artifactId>commander</artifactId>
<version>BETA-0.1</version>
</dependency>
</dependencies>
everything is there though
yeah ok
so dont do that
remove the paper api
your commander artifact already includes the paper dependency if you use "api"
or compileOnlyApi
now I'm like 95% sure this is a jitpack problem
please give it a go with maven local
after adding the java-library plugin did you publish that to jitpack?
everything falls apart
yes
I republish it again
nvm
and then add maven local to your repositories in the downstream project
after running publishToMavenLocal, all of the errors are gone
T_T I can finally sleep
what time zone are you in? o.o
okay, that makes sense then
for most people on this server its around 11 AM right now I think
5pm for me
I usually sleep at 10 but when I'm working on a project like this, I sleep at 2-3 am
my 15-year old brain can finally relax
17:00 for me /s
thank you!
i would be very careful about that on discord, as the minimum age is 16 and they really like to ban people for that
i would delete that message
wait a second
nevermind
its 13
depends on the country
it's 13 in my country
yeah, i've just seen so many posts on reddit about people joking about their age and losing their account of 7+ years
hi,
Im trying to setup a dev environment for the actual PaperMC github project
➜ Paper git:(master) java --version
openjdk 17.0.8 2023-07-18
OpenJDK Runtime Environment (build 17.0.8+7)
OpenJDK 64-Bit Server VM (build 17.0.8+7, mixed mode)
I have JDK17 as it says in the README To compile Paper, you need JDK 17 and an internet connection.
I applyPatches sucssesfully
But when I runDev it fails in paper-api:compileJava with:
> error: release version 17 not supported
also sorry I'm not familiar with java build-systems
also im using Intellij idea if theres an easy configuration method
ok so setting my java version to java-20-openjdk it seems to build correctly
id be interested for possible reasons behind that huh
@kind pewter run ./gradlew --version in the Paper project.
also, are you running these tasks via intellij or on the command line?
------------------------------------------------------------
Gradle 8.0.2
------------------------------------------------------------
Build time: 2023-03-03 16:41:37 UTC
Revision: 7d6581558e226a580d91d399f7dfb9e3095c2b1d
Kotlin: 1.8.10
Groovy: 3.0.13
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 20.0.2 (Oracle Corporation 20.0.2+9)
OS: Linux 6.4.8-arch1-1 amd64
command line
on the integrated terminal thing
right, so you said it worked with 20
but it should work with 17. set the java version back and show the gradle version
------------------------------------------------------------
Gradle 8.0.2
------------------------------------------------------------
Build time: 2023-03-03 16:41:37 UTC
Revision: 7d6581558e226a580d91d399f7dfb9e3095c2b1d
Kotlin: 1.8.10
Groovy: 3.0.13
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 17.0.8 (Oracle Corporation 17.0.8+7)
OS: Linux 6.4.8-arch1-1 amd64
Its set back to 17
and now, running ./gradlew runDev after ./gradlew applyPatches fails?
well first clean the cache
so do ./gradlew clean and then ./gradlew runDev --no-build-cache
cause it probably didn't actually recompile the api since you didn't make any changes since last compile
➜ Paper git:(master) ./gradlew runDev --no-build-cache
> Task :paper-api:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':paper-api:compileJava'.
> error: release version 17 not supported
* 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 3s
3 actionable tasks: 3 executed
what is your java home set to? echo $JAVA_HOME
not set
ok, I think that has to be set to whatever java version
how are you managing multiple versions?
yeah, I'm not familiar with it. Just to see if it fixes it... put JAVA_HOME=path/to/java/bin in front of ./gradlew runDev and see what happens
then also check if JAVA_HOME is set when you change java versions to 20 via archlinux-java
use archlinux-java get to list your versions
and then something like archlinux-java set java-17-openjdk
yeah im not sure why that utility is not setting JAVA_HOME
does it not set it when you change to 20? if it doesn't set it there either, but you can still compile then it might not be the issue
yep
did you set java-17 ?
yep
➜ Paper git:(master) java -version
openjdk version "17.0.8" 2023-07-18
OpenJDK Runtime Environment (build 17.0.8+7)
OpenJDK 64-Bit Server VM (build 17.0.8+7, mixed mode)
its changing something...
.
cause you said when you changed it to 20, you can compile
I guess also check javac --version to make sure the compiler version matches
I set it to 20
➜ Paper git:(master) java -version
openjdk version "20.0.2" 2023-07-18
OpenJDK Runtime Environment (build 20.0.2+9)
OpenJDK 64-Bit Server VM (build 20.0.2+9, mixed mode, sharing)
and do all the cache clean stuff.. It now doesn't compile
what does a good JAVA_HOME look like? /usr/lib/jvm/java-17-openjdk/
/usr/lib/jvm/java-17-openjdk/bin?
I forget if its supposed to have /bin or not
you shouldnt link it to a version directly, rather then symmlink
well just test it like this to see if this is even the issue
I think its without the /bin. so
JAVA_HOME=/usr/lib/jvm/java-17-openjdk/ ./gradlew runDev
🤷♂️ I'm kinda out of ideas then...
this is interesting. ill experiment
IDEA does insert some vars IDEA_JDK IDEA_CLASSPATH
oh I guess try it outside of intellij all together
* What went wrong:
Execution failed for task ':paper-api:compileJava'.
> error: release version 17 not supported
Its specifically paper-api?
or is that just the first build target?
> Task :paper-server:runDev
System Info: Java 17 (OpenJDK 64-Bit Server VM 17.0.8+7) Host: Linux 6.4.8-arch1-1 (amd64)
Loading libraries, please wait...
Yeah in conclusion I don't know, using archlinux-java to set the JDK version to 20 seems to work for me.
gradle then just ignores it, finds and uses jdk17 anyway.
do you have maybe a ~/.gradle/gradle.properties file?
or a gradle.properties in the project
maybe they are setting the java home variable
no it doesn't seem to be
are you running gradle with a command or from the IDE?
a terminal
try running it from intellij and setting the gradle VM
Can't exclude kotlin from shading
Are the depdendencies defined as compileOnly?
trying to add guava 32.1.2-jre to my project, and I get this gradle error https://paste.gg/p/anonymous/a525a2ee2a7842338c72095fd79ab658
dependencies {
implementation(libs.guava)
}
where libs.guava is a version catalog for guava 32.1.2-jre
https://github.com/gradlex-org/java-ecosystem-capabilities maybe add this plugin?
Error resolving plugin [id: 'org.gradlex.java-ecosystem-capabilities', version: '1.3.1']
> The request for this plugin could not be satisfied because the plugin is already on the classpath with an unknown version, so compatibility cannot be checked.
with
plugins {
id("java-conventions")
id("publishing-conventions")
//alias(libs.plugins.jmh)
id("org.gradlex.java-ecosystem-capabilities") version "1.3.1"
}
do you have indra?
yeah
3.1.1
java-conventions is
plugins {
id("base-conventions")
id("java-library")
id("net.kyori.indra")
id("com.diffplug.spotless")
}
indra {
javaVersions {
target(17)
}
}
base-conventions is
plugins {
id("net.kyori.indra.git")
}
group = rootProject.group
version = rootProject.version
description = rootProject.description
3.1.1 ships an old version of that plugin
ah got it
Hey, I have this gradle error, when I was trying to setup paper as dependency for both modules I have there (core, api)
Parent: https://pastes.dev/CVfj8l3c1r
:core : https://pastes.dev/PEre85vjcM
:api : https://pastes.dev/WxxoLXBYQ8
you'll have to define the java plugin in your allProjects block via apply
otherwise, how would gradle ensure that all projects even have the java plugin
just because you happen to define it in the subprojects, does not mean that is guaranteed
@woeful gate ^ (ping given I am an hour late lol)
so add dependency and repository to main build.gradle and then in allProjects, something with apply
thanks, atleast someone responded
Yea, pretty much just slap apply plugin: 'java' into the allprojects block
realistically tho, all of this is subprojects
not allprojects
wait apply plugin java?
I wanted to apply papermc api to all projects (both core and api)
Yea
but to apply a dependency via compileOnly, the project needs the java plugin or some derivative of said plugin
so when you try to define the compileOnly dependency in a generic "allprojects" block without also defining that that project has the java plugin applied, gradle properly crashes
ooooooooh
is this same for groovy?
that should be groovy 😅
oops
I tried to grab it from the gradle docs
no idea if it is correct
never used the groovy dsl
you started on kotlin gradle?
I have been a maven enjoyer prior
(don#t tell jmp)
okay seems to work, on :api project I have now this build.gradle
group = 'net.experienced.powered.staffprotect'
version = '1.0-SNAPSHOT'
do I even need it?
me aswell but I switched because I was always hearing gradle is better, so I tried it
Well yea, different project and potentially different version
and group?
Yea
any chance I can also get version from both these projects so I can make version and I can somehow get it in project?

gradle.properties my beloved
idk I didn't figured
nevermind, I did something, it works for me nicely
so im trying to get a client jar working with paper mache, ive changed it so it can download the client stuff rather than server, but idk how to fix the dependency handling, as client jars have an array of downloads, rather than everything embedded in the server jar
i guess i need to add a new resolver or something?
not sure if im ready to right enough bad code atm, so i might leave it for now
edit: right so the server jar is a bundler jar, which includes the actual server jar in a sub directory
I'll add client support soon-ish. It's not high priority, but it's something I want to do. Working on writing some in-depth documentation on some of the technical aspects of it first
https://github.com/the456gamer/paper-mache/tree/feat/add-client-support
i think i got it working? its a little hacky, but if you do smth like
mache {
minecraftVersion.set("1.20.1")
minecraftJarType.set("client")
}
in a version build.gradle.kts, it should download + decompile the client instead of the server
with paper mache, how do i start creating patches for a new version? (on main branch mache btw, i was having the issue on my fork too)
just adding it as a config doesnt seem to work
A problem was found with the configuration of task ':versions:23w32a:setupSources' (type 'SetupSources').
- In plugin 'mache-lib' type 'io.papermc.mache.tasks.SetupSources' property 'failedPatchJar' specifies file '~/projects/minecraft/paper-mache-test/mache/versions/23w32a/build/mache/server/failed_patch.jar' which doesn't exist.
there is probably a magic gradle task im missing ;)
out of curiosity, how were the first patches done? just taken from somewhere else? done manually?
More or less done manually, sometimes compared with other decompilers
Why does the chunks load slowly on paper and not spigot?
I need to fix this but idk how
hello. tomorrow I will make a pull request to bring paperweight-example up to date for 1.20, went through the process myself so may as well contribute
<3
Eh, updating that templte iirc is pretty annoying, as you have to update and force push all branches 😅
@smoky violet might wanna chime in on this
It does not work powercas
but it works in the other directory?
Might have to restart your pc after installing it
idk how windows does that stuff
It works when I open terminal on windows and run it there
But not in the project directory
Hmm, let me try that ig
why force push?
because the example branches are based on the main branch
so when the main branch is updated, all others are rebased onto the main branch
which requires a force push
I can see that the histories diverge after d64a2d0 but with the same commit messages, but I'm not following why. If I wanted to change the paperweight version number, for example, that would go into (and rewrite the history of) a previous commit?
Oh
they aren#t actually on this repo 
jmp usually just rebases those
at least with the userdev example
I guess, feel free to open a PR. Given he has not responded to the ping either, can't blame you for trying to help us out
I'll update each branch how I would normally do it, do the pull request for the main branch and mention the other branches, and y'all can do whatever you want with those
Is there a similar feature in gradle?
it happens automatically with gradle afaik
Reposting from #paper-dev :
Bit of a silly question, but does anyone know how to change the name of the jar generated by the reObf jar task? It always uses my submodule name which is not ideal.
My build task:
build {
dependsOn(reobfJar)
}
Usually I would do something like:
jar {
archiveBaseName.set("TestName")
}
Edit:
In addition, there are some external dependencies I need to include in the classpath for my plugin. Should I create a fat jar that includes those dependencies? If so, how can I do this in combination with the reobfJar step?
The example project actually shows you how to do this: https://github.com/PaperMC/paperweight-test-plugin/blob/master/build.gradle.kts#L53-L57
And I think you can just use normal shadow jar logic to shade dependencies?
paperweight-userdev automatically detects shadow and will use shadowJar as input for reobfJar. This means no extra configuration is required to use paperweight-userdev with shadow. See the shadow branch on this repository for an exmaple usage of shadow with paperweight-userdev.
@daring cliff
Perfect, thank you!
So just want to let people know, for some odd reason, this was the solution to my problem
windows be like that
you are also forced to restart after updates for example
and like 90% of the time when you install something new, you also have to restart
Hiya! I'm trying to build a plugin I found on GitHub, any idea what is causing this?
Do you not have the necessary repository for those in the build.gradle file maybe?
Those 2 are both in https://repo.papermc.io/repository/maven-public/
I am using paperweight to clone another project and this is what I got so far
paperweight {
serverProject.set(project(":project-server"))
remapRepo.set(projectMavenPublicUrl)
decompileRepo.set(projectMavenPublicUrl)
useStandardUpstream("name") {
url = github("owner", "repo")
ref = providers.gradleProperty("commit")
withStandardPatcher {
apiPatchDir.set(layout.projectDirectory.dir("patches/api"))
apiOutputDir.set(layout.projectDirectory.dir("Project-API"))
serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
serverOutputDir.set(layout.projectDirectory.dir("Project-Server"))
}
}
}
But when I run it, it keeps printing kotlin org.gradle.execution.TaskSelectionException: Task 'prepareForDownstream' not found in project ':name' and its subprojects.
As I am completely new to paperweight and cannot find any documentation I am a bit overwhelmed by this. Sure I know what the error "means" but I have no idea how or where to create such a task.
Bungeecord
A problem occurred configuring project ':naturerevive-spigot:nms:nms-1_17'.
> Cannot set the value of property 'downloadService' of type io.papermc.paperweight.DownloadService using a provider of type io.papermc.paperweight.DownloadService.```
I'm trying to build a project that uses paperweight and I get this error
https://pastebin.com/uB9vgQ34
This is the build file
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.
Error downloading original jar
java.io.FileNotFoundException: https://s3.amazonaws.com/Minecraft.Download/versions/1.8.8/minecraft_server.1.8.8.jar
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1993)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
at java.base/java.net.URL.openStream(URL.java:1161)
at org.apache.commons.io.FileUtils.copyURLToFile(FileUtils.java:1460)
at com.destroystokyo.paperclip.Paperclip.main(Paperclip.java:90)
I can't install 1.12.2 Lobby
see this eror & not download files
I meant 1.12.2 and 1.8.8
And can you give me the right channel?
#paper-help normally but, 1.8.8 and 1.12.2 are not supported
ok, sorry
Can anyone please help, I am still clueless?
Paperweight is designed for working with projects which use paperweight
Bungee also doesn't use gradle, and so you'd probably just wanna copy what waterfall does
A problem occurred configuring project ':naturerevive-spigot:nms:nms-1_17'.
> Cannot set the value of property 'downloadService' of type io.papermc.paperweight.DownloadService using a provider of type io.papermc.paperweight.DownloadService.```
I'm trying to build a project that uses paperweight and I get this error
https://pastebin.com/uB9vgQ34
This is the build file
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.
Please don’t randomly reply to me for the sake of pinging me
why do you have spigot api
Hello there, I have a multi module project with a Core module depending on paperweight-userdev, and a Plugin module that just uses Paper
I also have an API module but I've had no problems combining that.
My problems come from me combining core and plugin into a final jar, I have tried this in my shadowJar task:
dependsOn(project(":Parabots-Core").tasks.getByName("reobfJar"))
But I've checked the output classes and they still use mojang mappings (giving me exceptions)
Where have I missed a step 🙂
Currently have my shadowJar and final publish tasks in the Plugin module
You'd sepcify the configuration for the project
Setting depends on just says that it depends on a task running, it doesn't automatically consume the output of that (afaik)
Thanks, I just need a little more help setting up the config for that:
I have:
configurations {
create("reobfCfg")
}
But setting the config to have just the reobfJar's output, I haven't been able to figure out the correct syntax
You don’t setup a confit, paperweight already does that
I see, thanks for the help. However I would want to create a fork and convert into gradle then, as this should be a subproject of another gradle project. I would love to learn how to setup this prepareForDownstream task, Have you got any documentation I have overseen or some rough code example? Anything please. Thanks for any help.
I mean, paperweight is intended for paper and all the stuff that entails
It’s literally useless for random software
Use git patcher
Would It be possible to run it with Velocity then?
Once again, the tooling is intended for paper
The entire thing is solely wired up for the process of decompiling a mojang server jar, etc,etc
Gitpatcher is a plug-in which purely exists to handle patches
Thanks for the help guys. I think I'll go with gitpatcher then. ^^
'REMAPPER_CONFIG' is this the one? Not home yet so can't test, just looked thru the repo
No, the project thing
That method thing
Has a configuration arg iirc
Was either reobfJar or reobf
On a tablet with 0.5 eyes
Got it ty
is there any nasty side effects that im not seeing by setting the gradle property "publishDevBundle" in the paper repo, changing the dev bundle artifact id, and publishing to maven local for testing a pr (brig command pr to be exact)
the only thing maybe is using the wrong version of the stuff, probably cause i dont know how the dev bundles work. are all the patches / whatever inside the dev bundle, or does it need to resolve other artifacts as well (and can i change them so they stay seperate?)
alright when i tried getting it to change the api and mojang api coords it didnt work, so im guessing the custom dev bundle name is still resolving from offical paper repos (or the otherway round, and this way will interfer if i want to build against offical paper)
Is it possible to add paper through paperweight-userdev to a specific gradle configuration? Nevermind, I got it working.
How do I commit to the server/api repo when using paperweight without submodules?
IntelliJ always makes me commit to the root repo thingy
don't use intellij to make the commits
Git command line?
ik mini often uses the VCS UI, but, er
Nah, I have to work with people on this who don't really know what they're doing. I can't subject them to that
pretty sure the submodule less thing still sets up submodules
it just doesn't expect the paper repo its consuming to be already added as a git submodule it needs to checkout and manage like that
It might have just been glitched because I'm renaming things
Now my userdev-bundle is weird. It says it can't decompile, but those classes I didn't touch. https://pastes.dev/q6c5wSael5
All I did was steal the SlimeWorld format patch from https://github.com/InfernalSuite/AdvancedSlimePaper/
I already checked, toolchain is on Java 17
what's the gradle error
and the log file?
oh
general advice is to look at the thing and see what blew up
this paste is the log file
make sure that you're using the sane decmpiler + version as paper
I also checked again, I do use the classes a bit, so the decompiler might not like that.
well, big one is that you need to make sure that you're using the same decompiler as paper otherwise your dev bundle might decompile something diff
otherwise, not sure, no means to test, etc
Howdy!
I'm working on a conventions plugin for a multi-module gradle project, migrating from Spigot to Paper. I can't seem to crack the right layout/syntax to get the paper dev-bundle working for the plugin modules.
I can get the script building by providing the plugin id and version in buildSrc's build.gradle and declaring the paperweightDevelopmentBundle in the dependencies, but it doesn't appear to apply to the subsequent implementation of the convention script itself.
And attempting to apply the paperweightDevelopmentBundle within the convention script yields errors concerning declaring a versioned plugin:
Invalid plugin request [id: 'io.papermc.paperweight.userdev', version: '1.5.5']. Plugin requests from precompiled scripts must not include a version number...,
but this version is required it seems to get the dependency to resolve.
In other words, I can only get the paperweightDevelopmentBundle to build by declaring it in buildSrc:build.gradle, but that does not appear to have bearing on the library-conventions script, or any plugin modules that reference it.
Bit niche, just wondering if anyone has tackled this problem previously
https://github.com/play-rivalsnetwork-hu/RivalsAPI
I can't really know what your current gradle layout is, but maybe looking at some of my buildscripts could help 😄
Oh, thank you thank you! Its not quite the same, but the handling of it in the multi-module context might be enough clues to figure it out
your issue is that you defined a plugin version
iirc, you'd basically add that as a build script dependency or something, I don't remember the specifics though
Hm, ok. The problem was, when I supplied no version, it would produce: Plugin [id: 'io.papermc.paperweight.userdev'] was not found in any of the following sources:, however with the version, it resolves just fine
you need to add the library to the dependencies for the precompiled scripts
the entire notion is that it cannot pull that stuff in at that phase, it needs to be there earlier
but, it can apply it
Mmm, I may not be doing what I thought I was then...
I'm sorry, I'm feeling incredibly stupid right now...
https://pastes.io/trgadco2sk
https://pastes.io/holvor9bls
Am I even remotely on the right track here?
The dependencies for the precompiled scripts are declared in the build.gradle if I understand correctly?
The library that I need to add there though, that might be what I'm not getting right.
The second paste is the convention file, and you're saying I can apply the plugin there, if its already in the dependencies?
Anyone who could tell me why this build.gradle.kts starts to error when I reload after adding world guard as a dependancy gradle file: https://pastecord.com/tokosinawu.vbs
Warning: https://pastecord.com/vutyqojozy.apache
Error: https://pastecord.com/ifasositef.less
That should be the correct version I think
latest file on bukkit is 7.0.9-dist
I made a mistake with finding the core lol
Same error still Factory:main: Could not find com.sk89q.worldguard:worldguard-bukkit:7.0.9-dist.
Rest is same
remove the dist
I commit to master and then cherry pick to the other branches, fixing conflicts/making adjustments for things that differ
rebasing would end up making more conflicts in the long run due to how much they differ
the test-plugin is the one I rebase and force push
if you want to handle updating it, that's fine with me as long as you go through that process for the other branches
can compare some of the upstream/version update commits I've pushed in the past to see the differences; the main annoying thing is half use submodules and half don't, and half have mojangapi and half don't
When using gradle, what's the difference between gradle task: build and idea's build?
if IJs build button calls gradle, nothing
otherwise, it would be using IJs built in compiler which is entirely detatched
it does try to derive some aspects of the configuration from the build system, but, I wouldn't rely on it
I see. thank you
So, I set up a command in paper-plugin.yml, but getCommand() returns null
I think gradle may forgot to pack .yml into .jar
Can someone take a look?
what can’t use the command plugin with paper plugins
use the command map or a command framework
What’s a command map or a command framework?
declaration: package: org.bukkit.command, interface: CommandMap
or something like cloud
so i can't add command in a paper plugin?
Yes you can, but not in the "classic" way. Instead of CommandExecutor, you have to extend Command and optionally PluginIdentifiableCommand, for example: https://github.com/4drian3d/SimpleJumpPads/blob/main/src/main/java/io/github/_4drian3d/simplejumppads/commands/JumpPadCommand.java#L14
then...
Thank you so much for the clarification, I will look through it carefully
So I tried, but I got a java.lang.NoClassDefFoundError at line 10'
line 10 is the .register one
right sorry