https://github.com/cakemc-network/maven-repository-jlibrary
:sparkle: small lightweight maven-repository
https://github.com/cakemc-network/maven-repository-jlibrary
maven maven-publish maven-publishing maven-repository publication repository
Last synced: about 2 months ago
JSON representation
:sparkle: small lightweight maven-repository
- Host: GitHub
- URL: https://github.com/cakemc-network/maven-repository-jlibrary
- Owner: CakeMC-Network
- License: apache-2.0
- Created: 2025-01-14T21:34:25.000Z (4 months ago)
- Default Branch: develop
- Last Pushed: 2025-01-16T18:56:39.000Z (4 months ago)
- Last Synced: 2025-04-02T08:17:46.914Z (about 2 months ago)
- Topics: maven, maven-publish, maven-publishing, maven-repository, publication, repository
- Language: Kotlin
- Homepage:
- Size: 3 MB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# maven-repository-jlibrary
Small library for cakemc-cluster-deployment-system### Creating a publishing task and publishing our first file
publishing to the "custom" repository: (add this to the project you want to publish)
```kotlin
publishing {
publications {
create("deployment") {
from(components["kotlin"])// Include a source JAR (optional)
artifact(tasks.getByName("jar")) {
classifier = "sources"
}
}
}repositories {
maven {
name = "cluster-deployment"
url = uri("http://localhost:8080/")
isAllowInsecureProtocol = true
credentials {
username = "your-user-name"
password = "your-password"
}
}
}
}
```### Using the library and starting your first Maven-Server
````kotlin
package testingimport net.cakemc.repository.RepositorySystem
import net.cakemc.repository.credentials.RepositoryCredentials
import net.cakemc.repository.utils.GetRequestHandler
import net.cakemc.repository.utils.PublicationHandler
import java.nio.file.Pathobject RepositoryTest {
@JvmStatic
fun main(args: Array) {
val credentials = RepositoryCredentials("username", "password")val publicationHandler = object : PublicationHandler {
override fun accept(name: String, file: ByteArray) {
println("received file $name with size of ${file.size}")
}
}val getRequestHandler = object : GetRequestHandler {
override fun requestReceived(path: String) {
println("received get for file: $path")
}
}val repositorySystem = RepositorySystem.Builder()
.credentials(credentials)
.host("0.0.0.0")
.port(8080)
.directory(Path.of("./maven-repository"))
.publicationHandler(publicationHandler)
.getRequestHandler(getRequestHandler)
.build()repositorySystem.bind()
}
}
````