Skip to content

Commit

Permalink
Publish to maven central
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMichael committed Oct 14, 2023
1 parent 600d586 commit 21c0d2d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ If you just want to talk or need help with Classic4J feel free to join my

## How to add this to your project
### Gradle/Maven
To use Classic4J with Gradle/Maven you can use this [Maven server](https://maven.lenni0451.net/#/releases/de/florianmichael/Classic4J) or [Jitpack](https://jitpack.io/#FlorianMichael/Classic4J).
To use Classic4J with Gradle/Maven you can use this [Maven Central](https://mvnrepository.com/artifact/de.florianmichael/Classic4J), [Lenni0451 server](https://maven.lenni0451.net/#/releases/de/florianmichael/Classic4J) or [Jitpack](https://jitpack.io/#FlorianMichael/Classic4J).
You can also find instructions how to implement it into your build script there.

### Jar File
Expand Down
24 changes: 23 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id "java"
id "maven-publish"
id "signing"
}

archivesBaseName = "Classic4J"
Expand Down Expand Up @@ -53,6 +54,17 @@ publishing {
def snapshotsUrl = "https://maven.lenni0451.net/snapshots"
url = project.version.endsWith("SNAPSHOT") ? snapshotsUrl : releasesUrl

credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
}
}
maven {
name = "ossrh"
def releasesUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = project.version.endsWith("SNAPSHOT") ? snapshotsUrl : releasesUrl

credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
Expand Down Expand Up @@ -90,4 +102,14 @@ publishing {
}
}
}
}
}

signing {
setRequired false
sign configurations.archives
sign publishing.publications.maven
}

project.tasks.withType(PublishToMavenRepository).forEach {
it.dependsOn(project.tasks.withType(Sign))
}

0 comments on commit 21c0d2d

Please sign in to comment.