Skip to content

Commit 9f89ae8

Browse files
authored
Merge pull request #11 from mapstruct/issue7-mavenPublish
Issue7 maven publish
2 parents c797758 + eb60ebc commit 9f89ae8

File tree

12 files changed

+155
-38
lines changed

12 files changed

+155
-38
lines changed

annotations/build.gradle

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
apply plugin: "maven-publish"
2+
apply plugin: "signing"
3+
4+
dependencies {
5+
compileOnly 'org.springframework:spring-core:5.0.0.RELEASE'
6+
}
7+
8+
java {
9+
withJavadocJar()
10+
withSourcesJar()
11+
}
12+
13+
publishing {
14+
publications {
15+
mavenJava(MavenPublication) {
16+
artifactId = 'mapstruct-spring-annotations'
17+
from components.java
18+
versionMapping {
19+
usage('java-api') {
20+
fromResolutionOf('runtimeClasspath')
21+
}
22+
usage('java-runtime') {
23+
fromResolutionResult()
24+
}
25+
}
26+
pom {
27+
licenses {
28+
license {
29+
name = 'The Apache License, Version 2.0'
30+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
31+
}
32+
}
33+
developers {
34+
developer {
35+
id = 'RayBan'
36+
name = 'Raimund Klein'
37+
38+
}
39+
}
40+
scm {
41+
connection = 'scm:git:git://[email protected]:mapstruct/mapstruct-spring-extensions.git'
42+
developerConnection = 'scm:git:ssh://[email protected]:mapstruct/mapstruct-spring-extensions.git'
43+
}
44+
}
45+
}
46+
}
47+
repositories {
48+
maven {
49+
// change URLs to point to your repos, e.g. http://my.org/repo
50+
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
51+
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
52+
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
53+
}
54+
}
55+
}
56+
57+
signing {
58+
useGpgCmd()
59+
sign publishing.publications.mavenJava
60+
}
61+
62+
javadoc {
63+
if(JavaVersion.current().isJava9Compatible()) {
64+
options.addBooleanOption('html5', true)
65+
}
66+
options.links = [
67+
"https://docs.spring.io/spring/docs/5.0.0.RELEASE/javadoc-api/"
68+
]
69+
}

annotations/src/main/java/org/mapstruct/extensions/spring/SpringMapperConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import java.lang.annotation.Target;
77

88
/**
9-
* Marks a class or interface as configuration source for the Spring additions. There can be only <em>one</em>
9+
* Marks a class or interface as configuration source for the Spring extension. There can be only <em>one</em>
1010
* annotated type in each compiled module.
1111
*
1212
* @author Raimund Klein

build.gradle

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,24 @@ plugins {
1010
// Apply the java-library plugin to add support for Java Library
1111
id 'java-library'
1212
id 'jacoco'
13+
id 'maven-publish'
14+
id 'signing'
1315
}
1416

15-
group = 'org.mapstruct.extensions'
16-
version = '0.0.1'
17-
1817
allprojects {
1918
repositories {
2019
jcenter()
2120
mavenCentral()
22-
maven {
23-
url "https://oss.sonatype.org/content/repositories/snapshots"
24-
}
2521
}
2622
}
2723

2824
subprojects {
2925
apply plugin: "java-library"
3026
apply plugin: "jacoco"
3127

28+
group = 'org.mapstruct.extensions.spring'
29+
version = '0.0.1-SNAPSHOT'
30+
3231
dependencies {
3332
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.1'
3433
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.1'
@@ -59,6 +58,6 @@ subprojects {
5958
}
6059

6160
wrapper {
62-
gradleVersion = '6.3'
61+
gradleVersion = '6.7.1'
6362
}
6463

examples/classname/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ dependencies {
44
implementation project(":annotations")
55
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
66
compileOnly 'javax.annotation:jsr250-api:1.0'
7-
implementation 'org.mapstruct:mapstruct:1.4.0-SNAPSHOT'
8-
annotationProcessor 'org.mapstruct:mapstruct-processor:1.4.0-SNAPSHOT'
7+
implementation 'org.mapstruct:mapstruct:1.4.0.Final'
8+
annotationProcessor 'org.mapstruct:mapstruct-processor:1.4.0.Final'
99
implementation 'org.springframework:spring-core:5.0.0.RELEASE'
1010
implementation 'org.springframework:spring-context:5.0.0.RELEASE'
1111
testImplementation 'org.springframework:spring-test:5.0.0.RELEASE'

examples/noconfig/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ dependencies {
33
implementation project(":examples:model")
44
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
55
compileOnly 'javax.annotation:jsr250-api:1.0'
6-
implementation 'org.mapstruct:mapstruct:1.4.0-SNAPSHOT'
7-
annotationProcessor 'org.mapstruct:mapstruct-processor:1.4.0-SNAPSHOT'
6+
implementation 'org.mapstruct:mapstruct:1.4.0.Final'
7+
annotationProcessor 'org.mapstruct:mapstruct-processor:1.4.0.Final'
88
implementation 'org.springframework:spring-core:5.0.0.RELEASE'
99
implementation 'org.springframework:spring-context:5.0.0.RELEASE'
1010
testImplementation 'org.springframework:spring-test:5.0.0.RELEASE'

examples/packagename-and-classname/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ dependencies {
44
implementation project(":annotations")
55
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
66
compileOnly 'javax.annotation:jsr250-api:1.0'
7-
implementation 'org.mapstruct:mapstruct:1.4.0-SNAPSHOT'
8-
annotationProcessor 'org.mapstruct:mapstruct-processor:1.4.0-SNAPSHOT'
7+
implementation 'org.mapstruct:mapstruct:1.4.0.Final'
8+
annotationProcessor 'org.mapstruct:mapstruct-processor:1.4.0.Final'
99
implementation 'org.springframework:spring-core:5.0.0.RELEASE'
1010
implementation 'org.springframework:spring-context:5.0.0.RELEASE'
1111
testImplementation 'org.springframework:spring-test:5.0.0.RELEASE'

examples/packagename/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ dependencies {
44
implementation project(":examples:model")
55
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
66
compileOnly 'javax.annotation:jsr250-api:1.0'
7-
implementation 'org.mapstruct:mapstruct:1.4.0-SNAPSHOT'
8-
annotationProcessor 'org.mapstruct:mapstruct-processor:1.4.0-SNAPSHOT'
7+
implementation 'org.mapstruct:mapstruct:1.4.0.Final'
8+
annotationProcessor 'org.mapstruct:mapstruct-processor:1.4.0.Final'
99
implementation 'org.springframework:spring-core:5.0.0.RELEASE'
1010
implementation 'org.springframework:spring-context:5.0.0.RELEASE'
1111
testImplementation 'org.springframework:spring-test:5.0.0.RELEASE'

extensions/build.gradle

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,74 @@
1+
apply plugin: "maven-publish"
2+
apply plugin: "signing"
3+
14
dependencies {
25
implementation project(":annotations")
3-
implementation 'org.mapstruct:mapstruct:1.4.0-SNAPSHOT'
46
implementation 'com.squareup:javapoet:1.12.1'
57
implementation 'org.apache.commons:commons-lang3:3.10'
68

9+
testImplementation 'org.mapstruct:mapstruct:1.4.0.Final'
710
testImplementation 'org.assertj:assertj-core:3.15.0'
811
testImplementation 'commons-io:commons-io:2.6'
912
testImplementation 'com.google.guava:guava:28.2-jre'
1013
testImplementation 'org.mockito:mockito-junit-jupiter:3.3.3'
1114
testImplementation 'org.springframework:spring-core:5.0.0.RELEASE'
1215
}
16+
17+
java {
18+
withJavadocJar()
19+
withSourcesJar()
20+
}
21+
22+
publishing {
23+
publications {
24+
mavenJava(MavenPublication) {
25+
artifactId = 'mapstruct-spring-extensions'
26+
from components.java
27+
versionMapping {
28+
usage('java-api') {
29+
fromResolutionOf('runtimeClasspath')
30+
}
31+
usage('java-runtime') {
32+
fromResolutionResult()
33+
}
34+
}
35+
pom {
36+
licenses {
37+
license {
38+
name = 'The Apache License, Version 2.0'
39+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
40+
}
41+
}
42+
developers {
43+
developer {
44+
name = 'Raimund Klein'
45+
}
46+
}
47+
scm {
48+
connection = 'scm:git:git://github.com/mapstruct/mapstruct-spring-extensions.git'
49+
developerConnection = 'scm:git:git://github.com/mapstruct/mapstruct-spring-extensions.git'
50+
url = 'https://github.com/mapstruct/mapstruct-spring-extensions'
51+
}
52+
}
53+
}
54+
}
55+
repositories {
56+
maven {
57+
// change URLs to point to your repos, e.g. http://my.org/repo
58+
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
59+
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
60+
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
61+
}
62+
}
63+
}
64+
65+
signing {
66+
useGpgCmd()
67+
sign publishing.publications.mavenJava
68+
}
69+
70+
javadoc {
71+
if(JavaVersion.current().isJava9Compatible()) {
72+
options.addBooleanOption('html5', true)
73+
}
74+
}

gradle/wrapper/gradle-wrapper.jar

509 Bytes
Binary file not shown.
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Sat Mar 28 09:48:39 GMT 2020
2-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
31
distributionBase=GRADLE_USER_HOME
42
distributionPath=wrapper/dists
5-
zipStorePath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
64
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)