Skip to content

Commit aa5b908

Browse files
authored
Merge pull request #361 from domaframework/nexus-publish-plugin
Use the nexus publish plugin
2 parents b5e9f54 + be991b8 commit aa5b908

File tree

6 files changed

+56
-64
lines changed

6 files changed

+56
-64
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ Build with Gradle
5757

5858
```groovy
5959
dependencies {
60-
implementation "org.seasar.doma:doma:2.29.1-SNAPSHOT"
61-
annotationProcessor "org.seasar.doma:doma-processor:2.29.1-SNAPSHOT"
60+
implementation "org.seasar.doma:doma:2.30.0-beta-1"
61+
annotationProcessor "org.seasar.doma:doma-processor:2.30.0-beta-1"
6262
}
6363
```
6464

build.gradle.kts

Lines changed: 47 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ plugins {
66
signing
77
id("com.diffplug.eclipse.apt") version "3.22.0"
88
id("com.diffplug.gradle.spotless") version "3.27.2"
9+
id("de.marcphilipp.nexus-publish") version "0.4.0"
910
id("net.researchgate.release") version "2.8.1"
1011
}
1112

@@ -62,6 +63,13 @@ val processorSourcesJar by tasks.registering(Jar::class) {
6263
from(sourceSets.main.get().allSource)
6364
}
6465

66+
val processorJavadocJar by tasks.registering(Jar::class) {
67+
dependsOn(javadoc)
68+
archiveAppendix.set("processor")
69+
archiveClassifier.set("javadoc")
70+
from(javadoc.get().destinationDir)
71+
}
72+
6573
val build by tasks.existing {
6674
val publishToMavenLocal by tasks.existing
6775
dependsOn(publishToMavenLocal)
@@ -83,67 +91,52 @@ dependencies {
8391
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.4.0")
8492
}
8593

94+
nexusPublishing {
95+
repositories {
96+
sonatype()
97+
}
98+
}
99+
86100
publishing {
87101
publications {
88-
val main = "main"
89-
val processor = "processor"
90-
create<MavenPublication>(main) {
102+
fun pomDefinition(publicationName: String): MavenPom.() -> Unit {
103+
return {
104+
val projectUrl: String by project
105+
name.set(publicationName)
106+
description.set("DAO Oriented Database Mapping Framework for Java 8+")
107+
url.set(projectUrl)
108+
licenses {
109+
license {
110+
name.set("The Apache Software License, Version 2.0")
111+
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
112+
}
113+
}
114+
developers {
115+
developer {
116+
id.set("nakamura-to")
117+
name.set("Toshihiro Nakamura")
118+
email.set("[email protected]")
119+
}
120+
}
121+
scm {
122+
val githubUrl: String by project
123+
connection.set("scm:git:${githubUrl}")
124+
developerConnection.set("scm:git:${githubUrl}")
125+
url.set(projectUrl)
126+
}
127+
}
128+
}
129+
create<MavenPublication>("main") {
91130
from(components["java"])
92-
pom(pomDefinition(main))
93-
repositories(repositoriesDefinition())
131+
pom(pomDefinition(name))
94132
}
95-
create<MavenPublication>(processor) {
96-
pom(pomDefinition(processor))
133+
create<MavenPublication>("processor") {
134+
pom(pomDefinition(name))
97135
val jar = processorJar.get()
98-
val sourcesJar = processorSourcesJar.get()
99136
artifactId = "${jar.archiveBaseName.get()}-${jar.archiveAppendix.get()}"
100137
artifact(jar)
101-
artifact(sourcesJar)
102-
repositories(repositoriesDefinition())
103-
}
104-
}
105-
}
106-
107-
fun pomDefinition(publicationName: String): MavenPom.() -> Unit {
108-
return {
109-
val projectUrl: String by project
110-
name.set(publicationName)
111-
description.set("DAO Oriented Database Mapping Framework for Java 8+")
112-
url.set(projectUrl)
113-
licenses {
114-
license {
115-
name.set("The Apache Software License, Version 2.0")
116-
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
117-
}
118-
}
119-
developers {
120-
developer {
121-
id.set("nakamura-to")
122-
name.set("Toshihiro Nakamura")
123-
email.set("[email protected]")
124-
}
125-
}
126-
scm {
127-
val githubUrl: String by project
128-
connection.set("scm:git:${githubUrl}")
129-
developerConnection.set("scm:git:${githubUrl}")
130-
url.set(projectUrl)
131-
}
132-
}
133-
}
134-
135-
fun repositoriesDefinition(): RepositoryHandler.() -> Unit {
136-
return {
137-
maven {
138-
val sonatypeSnapshotUrl: String by project
139-
val sonatypeUrl: String by project
140-
val sonatypeUsername: String by project
141-
val sonatypePassword: String by project
142-
url = uri(if (isSnapshot) sonatypeSnapshotUrl else sonatypeUrl)
143-
credentials {
144-
username = sonatypeUsername
145-
password = sonatypePassword
146-
}
138+
artifact(processorSourcesJar.get())
139+
artifact(processorJavadocJar.get())
147140
}
148141
}
149142
}

docs/build.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ Write your build.gradle as follows:
3535
.. code-block:: groovy
3636
3737
dependencies {
38-
implementation "org.seasar.doma:doma:2.29.1-SNAPSHOT"
39-
annotationProcessor "org.seasar.doma:doma-processor:2.29.1-SNAPSHOT"
38+
implementation "org.seasar.doma:doma:2.30.0-beta-1"
39+
annotationProcessor "org.seasar.doma:doma-processor:2.30.0-beta-1"
4040
}
4141
4242
To simplify your build.script, we recommend that you use the `Doma Compile Plugin`_.

docs/kotlin-support.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ Add the dependencies using the `kapt` and `implementation` configuration in your
9999
.. code-block:: groovy
100100
101101
dependencies {
102-
implementation "org.seasar.doma:doma:2.29.1-SNAPSHOT"
103-
kapt "org.seasar.doma:doma-processor:2.29.1-SNAPSHOT"
102+
implementation "org.seasar.doma:doma:2.30.0-beta-1"
103+
kapt "org.seasar.doma:doma-processor:2.30.0-beta-1"
104104
}
105105
106106
To simplify your build.script, we recommend you use

gradle.properties

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
group=org.seasar.doma
2-
version=2.29.1-SNAPSHOT
2+
version=2.30.0-beta-1
33
encoding=UTF-8
4+
systemProp.org.gradle.internal.publish.checksums.insecure=true
45
projectUrl=https://github.com/domaframework/doma
56
githubUrl[email protected]:domaframework/doma.git
6-
sonatypeUrl=https://oss.sonatype.org/service/local/staging/deploy/maven2/
7-
sonatypeSnapshotUrl=https://oss.sonatype.org/content/repositories/snapshots/
87
sonatypeUsername=
98
sonatypePassword=

src/main/java/org/seasar/doma/internal/Artifact.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public final class Artifact {
77

88
private static final String NAME = "Doma";
99

10-
private static final String VERSION = "2.29.1-SNAPSHOT";
10+
private static final String VERSION = "2.30.0-beta-1";
1111

1212
public static String getName() {
1313
return NAME;

0 commit comments

Comments
 (0)