Minecrell / ServerListPlus

A flexible Minecraft plugin to customize the appearance of your server in the server list
https://git.io/slp
GNU General Public License v3.0
236 stars 60 forks source link

Weird question (Help appreciated) #324

Closed Andre601 closed 3 years ago

Andre601 commented 3 years ago

This is a weird question and for sure not really about SLP itself, but I can't either find a better place to ask, nor actual other software/plugins/examples to help me with this issue, so I would love it, if I still get some help with the problem I face.

The issue isn't directly with SLP, but rather with some of my projects. I use bintray to publish stuff, but now they're sundowning (Stop) in may this year. I thought of switching to CodeMC to publish my stuff on their Repo, but there's no example of how I would do this in gradle. The only software I found so far using both gradle and CodeMC is this project here. That said does this project use the kotlin version of Gradle, while mine use groovy, so I'm not sure how it would look on my end and how I could even set everything up.

Again, sorry for this out of scope question/request but I'm desperate to find a solution and couldn't find anything to help me here.

stephan-gh commented 3 years ago

With "publish stuff" you mean publishing to a Maven repository? Usually this isn't really special, both Maven and Gradle have upload/publishing plugins that just write the files to a local directory or some remote HTTP server. So you could make it available with GitHub pages (like here: https://github.com/Minecrell/repo.minecrell.net) or whereever else you want.

In case of HTTP servers like with CodeMC you usually need:

In case of SLP this is configured using Gradle properties and the maven-publish plugin / publishing block you can see in build.gradle.kts. On the CodeMC Jenkins the properties are configured like

Click me ![Screenshot_20210208_200333](https://user-images.githubusercontent.com/3035868/107268682-cf1e6f80-6a48-11eb-8ce1-90b611fc3ee2.png) ![Screenshot_20210208_200435](https://user-images.githubusercontent.com/3035868/107268735-e198a900-6a48-11eb-9e5d-47d3b130bbdd.png)

You can see in the Gradle guide that it looks fairly similar for Groovy: https://docs.gradle.org/current/userguide/publishing_maven.html

However, note that in Groovy, project properties are not accessed like val mavenUsername: String? by project, but rather directly (like project.mavenUsername, but you may need to add checks to project.hasProperty('mavenUsername') to handle the case when they are not defined (like the null checks in my Kotlin code).

Hope that helps a bit.

Andre601 commented 3 years ago

Thanks for the information...

I'm honestly a bit unsure how I would set everything up for my projects. One of those projects is multi modules and I distributed it like this:

I actually have 0 idea what is important to use and what isn't... I just have no real idea about how to use Gradle...

So if you don't mind would I appreciate your feedback about my current build.gradle setup that I used so far. https://github.com/botblock/JavaBotBlockAPI/blob/master/build.gradle

stephan-gh commented 3 years ago

Looks like Bintray was just using a MavenPublication. You can likely just continue using most of the configuration, you just need to set up publishing { repositories { ... } } appropriately with the credentials and maven repository. Then use the publish task instead of the bintray specific task.

Andre601 commented 3 years ago

Yeah... I sadly don't get any further and I can't think of any place to ask for more help...

I pushed the latest attempt, but it fails at line 192 (artifact sourceJar) but I think that even with fixing this will it not work.

Andre601 commented 3 years ago

I get some progress here but the latest build failed with this:

> Cannot perform signing task ':signMavenJavaPublication' because it has no configured signatory

I'm not sure what it means with that exactly. I have the following signing block defined:

signing {
    sign publishing.publications.mavenJava
}
Andre601 commented 3 years ago

I managed to get it to worth with the help of some other fellow devs. Thank you for your time and help.