Skip to content

Commit def7980

Browse files
committed
Added plugins maven-publish and signing, still missing signing information.
1 parent c797758 commit def7980

File tree

4 files changed

+129
-1
lines changed

4 files changed

+129
-1
lines changed

annotations/build.gradle

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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+
from components.java
17+
versionMapping {
18+
usage('java-api') {
19+
fromResolutionOf('runtimeClasspath')
20+
}
21+
usage('java-runtime') {
22+
fromResolutionResult()
23+
}
24+
}
25+
pom {
26+
licenses {
27+
license {
28+
name = 'The Apache License, Version 2.0'
29+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
30+
}
31+
}
32+
developers {
33+
developer {
34+
name = 'Raimund Klein'
35+
}
36+
}
37+
scm {
38+
connection = 'scm:git:git://[email protected]:mapstruct/mapstruct-spring-extensions.git'
39+
developerConnection = 'scm:git:ssh://[email protected]:mapstruct/mapstruct-spring-extensions.git'
40+
}
41+
}
42+
}
43+
}
44+
repositories {
45+
maven {
46+
// change URLs to point to your repos, e.g. http://my.org/repo
47+
def releasesRepoUrl = "$buildDir/repos/releases"
48+
def snapshotsRepoUrl = "$buildDir/repos/snapshots"
49+
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
50+
}
51+
}
52+
}
53+
54+
signing {
55+
sign publishing.publications.mavenJava
56+
}
57+
58+
javadoc {
59+
if(JavaVersion.current().isJava9Compatible()) {
60+
options.addBooleanOption('html5', true)
61+
}
62+
options.links = [
63+
"https://docs.oracle.com/javase/8/docs/api/",
64+
"https://docs.spring.io/spring/docs/5.0.0.RELEASE/javadoc-api/"
65+
]
66+
}

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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ 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

1517
group = 'org.mapstruct.extensions'

extensions/build.gradle

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
apply plugin: "maven-publish"
2+
apply plugin: "signing"
3+
14
dependencies {
25
implementation project(":annotations")
36
implementation 'org.mapstruct:mapstruct:1.4.0-SNAPSHOT'
@@ -10,3 +13,60 @@ dependencies {
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+
from components.java
26+
versionMapping {
27+
usage('java-api') {
28+
fromResolutionOf('runtimeClasspath')
29+
}
30+
usage('java-runtime') {
31+
fromResolutionResult()
32+
}
33+
}
34+
pom {
35+
licenses {
36+
license {
37+
name = 'The Apache License, Version 2.0'
38+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
39+
}
40+
}
41+
developers {
42+
developer {
43+
name = 'Raimund Klein'
44+
}
45+
}
46+
scm {
47+
connection = 'scm:git:git://[email protected]:mapstruct/mapstruct-spring-extensions.git'
48+
developerConnection = 'scm:git:ssh://[email protected]:mapstruct/mapstruct-spring-extensions.git'
49+
// url = 'http://example.com/my-library/'
50+
}
51+
}
52+
}
53+
}
54+
repositories {
55+
maven {
56+
// change URLs to point to your repos, e.g. http://my.org/repo
57+
def releasesRepoUrl = "$buildDir/repos/releases"
58+
def snapshotsRepoUrl = "$buildDir/repos/snapshots"
59+
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
60+
}
61+
}
62+
}
63+
64+
signing {
65+
sign publishing.publications.mavenJava
66+
}
67+
68+
javadoc {
69+
if(JavaVersion.current().isJava9Compatible()) {
70+
options.addBooleanOption('html5', true)
71+
}
72+
}

0 commit comments

Comments
 (0)