@@ -12,14 +12,12 @@ apply plugin: 'java'
1212apply plugin : ' eclipse'
1313apply plugin : ' maven'
1414apply plugin : ' maven-publish'
15- apply plugin : ' signing'
1615
1716// In this section you declare where to find the dependencies of your project
1817repositories {
1918 // Use jcenter for resolving your dependencies.
2019 // You can declare any Maven/Ivy/file repository here.
2120 jcenter()
22- mavenCentral()
2321}
2422
2523dependencies {
@@ -50,7 +48,8 @@ def pomConfig = {
5048publishing {
5149
5250 publications {
53- maven(MavenPublication ) {
51+
52+ maven(MavenPublication ) {
5453
5554 groupId ' com.microsoft.graph'
5655
@@ -69,51 +68,9 @@ publishing {
6968 }
7069
7170 }
72-
73- mavenJava(MavenPublication ) {
74- customizePom(pom)
75- groupId ' com.microsoft.graph'
76- artifactId ' microsoft-graph'
77- version " ${ mavenMajorVersion} .${ mavenMinorVersion} .${ mavenPatchVersion}${ mavenArtifactSuffix} "
78- from components. java
79- pom. withXml {
80- def pomFile = file(" ${ project.buildDir} /generated-pom.xml" )
81- writeTo(pomFile)
82- def pomAscFile = signing. sign(pomFile). signatureFiles[0 ]
83- artifact(pomAscFile) {
84- classifier = null
85- extension = ' pom.asc'
86- }
87- }
88- artifact(sourceJar) {
89- classifier = ' sources'
90- }
91- artifact(javadocJar) {
92- classifier = ' javadoc'
93- }
94- project. tasks. signArchives. signatureFiles. each {
95- artifact(it) {
96- def matcher = it. file =~ / -(sources|javadoc)\. jar\. asc$/
97- if (matcher. find()){
98- classifier = matcher. group(1 )
99- }
100- else {
101- classifier = null
102- }
103- extension = ' jar.asc'
104- }
105- }
106- }
107- }
108- repositories {
109- maven {
110- url " https://oss.sonatype.org/content/repositories/snapshots"
111- credentials {
112- username = project. property(' sonatypeUsername' )
113- password = project. property(' sonatypePassword' )
114- }
115- }
71+
11672 }
73+
11774}
11875
11976task sourceJar (type : Jar ) {
@@ -190,66 +147,6 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
190147}
191148
192149artifacts {
193- archives jar
194150 archives sourceJar
195151 archives javadocJar
196152}
197-
198- signing {
199- sign configurations. archives
200- }
201-
202- def customizePom (pom ) {
203- pom. withXml {
204- def root = asNode()
205-
206- root. dependencies. removeAll { dep ->
207- dep. scope == " test"
208- }
209-
210- root. children(). last() + {
211- resolveStrategy = Closure . DELEGATE_FIRST
212-
213- description ' Microsoft Graph SDK'
214- name ' Microsoft Graph Java SDK'
215- url ' https://github.com/microsoftgraph/msgraph-sdk-java'
216- organization {
217- name ' Microsoft'
218- url ' https://github.com/microsoftgraph/msgraph-sdk-java'
219- }
220- issueManagement {
221- system ' GitHub'
222- url ' https://github.com/microsoftgraph/msgraph-sdk-java/issues'
223- }
224- licenses {
225- license {
226- name " MIT License"
227- url " http://opensource.org/licenses/MIT"
228- distribution " repo"
229- }
230- }
231- scm {
232- url ' https://github.com/microsoftgraph/msgraph-sdk-java'
233- connection ' scm:git:git://github.com/microsoftgraph/msgraph-sdk-java.git'
234- developerConnection
' scm:git:ssh://[email protected] :microsoftgraph/msgraph-sdk-java.git' 235- }
236- developers {
237- developer {
238- name ' Microsoft'
239- }
240- }
241- }
242- }
243- }
244-
245- model {
246- tasks. generatePomFileForMavenJavaPublication {
247- destination = file(" $buildDir /generated-pom.xml" )
248- }
249- tasks. publishMavenJavaPublicationToMavenLocal {
250- dependsOn project. tasks. signArchives
251- }
252- tasks. publishMavenJavaPublicationToMavenRepository {
253- dependsOn project. tasks. signArchives
254- }
255- }
0 commit comments