#publish a lib

1 messages · Page 1 of 1 (latest)

hollow wing
#

Hey, I made a library and I want to allow people to import it into projects with maven/gradle, how can I do that?

autumn elbowBOT
#

<@&987246399047479336> please have a look, thanks.

#

Here is an AI assisted attempt to answer your question 🤖. Maybe it helps! In any case, a human is on the way 👍. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.

#
TJ-Bot
Hey, I made a library and I want to allow people to import it into projects with maven/gradle, how can I do that?

To publish your library for others to import into their projects using Maven or Gradle, you will need to follow these steps:

  1. Hosting: You can host your library on a public repository like Maven Central, JCenter, or your own repository server.

  2. Build system configuration: For Maven, you will need to configure the pom.xml file with your library's metadata and dependencies. For Gradle, you will need to configure the build.gradle file with similar information.

  3. Versioning: Make sure to assign a version number to your library according to semantic versioning principles.

  4. Packaging: Package your library in a format that can be easily imported by other projects, such as a JAR file.

  5. Documentation: Provide clear documentation on how to import and use your library in projects.

  6. Publish: Once everything is set up, you can publish your library by running the appropriate command for the repository you are using (e.g., mvn deploy for Maven Central).

By following these steps, you can make it easy for other developers to import and use your library in their Java projects with Maven or Gradle.

queen zealot
#

with a proper pom.xml / gradle.build file

#

after that u have to upload it somewhere

#

if u have it on github releases, people can easily get hands on it using jitpack.io

#

if u want them to be able to get hands on it with the default settings u need to upload it to maven-central

#

which is a bit cumbersome

#

it also requires ownership verification, but thats usually simple and just takes a day or two

hollow wing
spare socket
tired cloud
#

They have integration now with github auth to automatically validate and give a github.io domain/repository. As for custom domains i think mine was nearly instant, possibly 10 minutes or something. U just have to update a DNS entry and click the button saying "yeah go check it"

raw mauve
#

share the library here? just curious

hollow wing
raw mauve
#

ah

#

so small thing

#

generally, if possible, deploy libraries in a place where all their dependencies are available

#

so if its a minecraft thing maven central may/may not be appropriate

#

since spigot isn't on maven central

hollow wing
#

yes, that's why I think I'll just put it on github with a packaage, but I'd have to post it already...