Maven publish
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -4,7 +4,7 @@
|
|||||||
<component name="FrameworkDetectionExcludesConfiguration">
|
<component name="FrameworkDetectionExcludesConfiguration">
|
||||||
<file type="web" url="file://$PROJECT_DIR$" />
|
<file type="web" url="file://$PROJECT_DIR$" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_15" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
<component name="accountSettings">
|
<component name="accountSettings">
|
||||||
|
|||||||
102
build.gradle.kts
102
build.gradle.kts
@@ -1,5 +1,7 @@
|
|||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm") version "1.9.23"
|
kotlin("jvm") version "1.9.23"
|
||||||
|
id("maven-publish")
|
||||||
|
id("signing")
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "nl.astraeus"
|
group = "nl.astraeus"
|
||||||
@@ -17,6 +19,102 @@ tasks.test {
|
|||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin {
|
extra["PUBLISH_GROUP_ID"] = group
|
||||||
jvmToolchain(17)
|
extra["PUBLISH_VERSION"] = version
|
||||||
|
extra["PUBLISH_ARTIFACT_ID"] = name
|
||||||
|
|
||||||
|
// Stub secrets to let the project sync and build without the publication values set up
|
||||||
|
val signingKeyId: String? by project
|
||||||
|
val signingPassword: String? by project
|
||||||
|
val signingSecretKeyRingFile: String? by project
|
||||||
|
val ossrhUsername: String? by project
|
||||||
|
val ossrhPassword: String? by project
|
||||||
|
|
||||||
|
extra["signing.keyId"] = signingKeyId
|
||||||
|
extra["signing.password"] = signingPassword
|
||||||
|
extra["signing.secretKeyRingFile"] = signingSecretKeyRingFile
|
||||||
|
extra["ossrhUsername"] = ossrhUsername
|
||||||
|
extra["ossrhPassword"] = ossrhPassword
|
||||||
|
|
||||||
|
val javadocJar by tasks.registering(Jar::class) {
|
||||||
|
archiveClassifier.set("javadoc")
|
||||||
|
}
|
||||||
|
|
||||||
|
val sourcesJar by tasks.registering(Jar::class) {
|
||||||
|
archiveClassifier.set("sources") // This sets the classifier to 'sources'
|
||||||
|
from(sourceSets.main.get().allSource) // Assumes you are using the 'main' source set
|
||||||
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
maven {
|
||||||
|
name = "releases"
|
||||||
|
// change to point to your repo, e.g. http://my.org/repo
|
||||||
|
setUrl("https://reposilite.astraeus.nl/releases")
|
||||||
|
credentials {
|
||||||
|
val reposiliteUsername: String? by project
|
||||||
|
val reposilitePassword: String? by project
|
||||||
|
|
||||||
|
username = reposiliteUsername
|
||||||
|
password = reposilitePassword
|
||||||
|
}
|
||||||
|
}
|
||||||
|
maven {
|
||||||
|
name = "snapshots"
|
||||||
|
// change to point to your repo, e.g. http://my.org/repo
|
||||||
|
setUrl("https://reposilite.astraeus.nl/snapshots")
|
||||||
|
credentials {
|
||||||
|
val reposiliteUsername: String? by project
|
||||||
|
val reposilitePassword: String? by project
|
||||||
|
|
||||||
|
username = reposiliteUsername
|
||||||
|
password = reposilitePassword
|
||||||
|
}
|
||||||
|
}
|
||||||
|
maven {
|
||||||
|
name = "sonatype"
|
||||||
|
setUrl("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2")
|
||||||
|
credentials {
|
||||||
|
username = ossrhUsername
|
||||||
|
password = ossrhPassword
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
publications {
|
||||||
|
create<MavenPublication>("mavenKotlin") {
|
||||||
|
artifact(javadocJar.get())
|
||||||
|
artifact(tasks.jar.get())
|
||||||
|
artifact(sourcesJar.get())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
publications.withType<MavenPublication> {
|
||||||
|
// Provide artifacts information requited by Maven Central
|
||||||
|
pom {
|
||||||
|
name.set("simple-persistence-kotlin")
|
||||||
|
description.set("Simple persistence in Kotlin")
|
||||||
|
//url.set("https://github.com/rnentjes/komponent")
|
||||||
|
|
||||||
|
licenses {
|
||||||
|
license {
|
||||||
|
name.set("MIT")
|
||||||
|
url.set("https://opensource.org/licenses/MIT")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
developers {
|
||||||
|
developer {
|
||||||
|
id.set("rnentjes")
|
||||||
|
name.set("Rien Nentjes")
|
||||||
|
email.set("info@nentjes.com")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
scm {
|
||||||
|
url.set("https://gitea.astraeus.nl/rnentjes/simple-persistence-kotlin")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
signing {
|
||||||
|
sign(publishing.publications)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,6 @@ public class TestPersistenceJava {
|
|||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
persistent.transaction((t) -> {
|
persistent.transaction((t) -> {
|
||||||
List<Person> persons = t.findByIndex(
|
List<Person> persons = t.findByIndex(
|
||||||
Person.class,
|
Person.class,
|
||||||
|
|||||||
Reference in New Issue
Block a user