Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 81 lines (74 sloc) 2.025 kb
5c719a4 AMQP-83 - Add Gradle Support
Gunnar Hillert authored
1 apply plugin: 'maven'
2
3 ext.optionalDeps = []
4 ext.providedDeps = []
5
6 ext.optional = { optionalDeps << it }
7 ext.provided = { providedDeps << it }
8
9 install {
10 repositories.mavenInstaller {
11 customizePom(pom, project)
12 }
13 }
14
15 def customizePom(pom, gradleProject) {
16 pom.whenConfigured { generatedPom ->
17 // respect 'optional' and 'provided' dependencies
18 gradleProject.optionalDeps.each { dep ->
19 generatedPom.dependencies.find { it.artifactId == dep.name }?.optional = true
20 }
21 gradleProject.providedDeps.each { dep ->
22 generatedPom.dependencies.find { it.artifactId == dep.name }?.scope = 'provided'
23 }
24
25 // eliminate test-scoped dependencies (no need in maven central poms)
26 generatedPom.dependencies.removeAll { dep ->
27 dep.scope == 'test'
28 }
29
30 // add all items necessary for maven central publication
31 generatedPom.project {
32 name = gradleProject.description
33 description = gradleProject.description
34 url = 'https://github.com/SpringSource/spring-amqp'
35 organization {
36 name = 'SpringSource'
37 url = 'http://springsource.org'
38 }
39 licenses {
40 license {
41 name 'The Apache Software License, Version 2.0'
42 url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
43 distribution 'repo'
44 }
45 }
46 scm {
47 url = 'https://github.com/SpringSource/spring-amqp'
48 connection = 'scm:git:git://github.com/SpringSource/spring-amqp'
49 developerConnection = 'scm:git:ssh://git@github.com/SpringSource/spring-amqp.git'
50 }
51
52 developers {
53 developer {
54 id = 'dsyer'
55 name = 'Dave Syer'
56 email = 'dsyer@vmware.com'
57 }
58 developer {
59 id = 'markfisher'
60 name = 'Mark Fisher'
61 email = 'markfisher@vmware.com'
62 }
63 developer {
64 id = 'mpollack'
65 name = 'Mark Pollack'
66 email = 'mpollack@vmware.com'
67 }
68 developer {
69 id = 'jbrisbin'
70 name = 'Jon Brisbin'
71 email = 'jbrisbin@vmware.com'
72 }
73 developer {
74 id = 'tomas.lukosius'
75 name = 'Tomas Lukosius'
76 email = 'tomas.lukosius@opencredo.com'
77 }
78 }
79 }
80 }
81 }
Something went wrong with that request. Please try again.