|
1 |
| -apply plugin: "maven" |
| 1 | +apply plugin: "maven-publish" |
2 | 2 |
|
3 |
| -install { |
4 |
| - repositories.mavenInstaller { |
5 |
| - customizePom(pom, project) |
6 |
| - } |
| 3 | +publishing { |
| 4 | + publications { |
| 5 | + mavenJava(MavenPublication) { |
| 6 | + from components.java |
| 7 | + if (project.name != 'spring-js-resources') { |
| 8 | + artifact sourcesJar |
| 9 | + artifact javadocJar |
| 10 | + } |
| 11 | + versionMapping { |
| 12 | + usage('java-api') { |
| 13 | + fromResolutionOf('runtimeClasspath') |
| 14 | + } |
| 15 | + usage('java-runtime') { |
| 16 | + fromResolutionResult() |
| 17 | + } |
| 18 | + } |
| 19 | + pom { |
| 20 | + afterEvaluate { |
| 21 | + description = project.description |
| 22 | + name = project.description |
| 23 | + } |
| 24 | + url = "https://github.com/spring-projects/spring-webflow" |
| 25 | + organization { |
| 26 | + name = "Spring IO" |
| 27 | + url = "https://spring.io/projects/spring-webflow" |
| 28 | + } |
| 29 | + licenses { |
| 30 | + license { |
| 31 | + name = "The Apache Software License, Version 2.0" |
| 32 | + url = "https://www.apache.org/licenses/LICENSE-2.0.txt" |
| 33 | + distribution = "repo" |
| 34 | + } |
| 35 | + } |
| 36 | + scm { |
| 37 | + url = "https://github.com/spring-projects/spring-webflow" |
| 38 | + connection = "scm:git:git://github.com/spring-projects/spring-webflow" |
| 39 | + developerConnection = "scm:git:git://github.com/spring-projects/spring-webflow" |
| 40 | + } |
| 41 | + developers { |
| 42 | + developer { |
| 43 | + id = "rstoyanchev" |
| 44 | + name = "Rossen Stoyanchev" |
| 45 | + |
| 46 | + } |
| 47 | + } |
| 48 | + issueManagement { |
| 49 | + system = "Jira" |
| 50 | + url = "https://jira.spring.io/browse/SWF" |
| 51 | + } |
| 52 | + } |
| 53 | + } |
| 54 | + } |
7 | 55 | }
|
8 | 56 |
|
9 |
| -def customizePom(pom, gradleProject) { |
10 |
| - pom.whenConfigured { generatedPom -> |
11 |
| - // eliminate test-scoped dependencies (no need in maven central poms) |
12 |
| - generatedPom.dependencies.removeAll { dep -> |
13 |
| - dep.scope == "test" |
14 |
| - } |
15 |
| - |
16 |
| - // sort to make pom dependencies order consistent to ease comparison of older poms |
17 |
| - generatedPom.dependencies = generatedPom.dependencies.sort { dep -> |
18 |
| - "$dep.scope:$dep.groupId:$dep.artifactId" |
19 |
| - } |
20 |
| - |
21 |
| - // add all items necessary for maven central publication |
22 |
| - generatedPom.project { |
23 |
| - name = gradleProject.description |
24 |
| - description = gradleProject.description |
25 |
| - url = "https://github.com/spring-projects/spring-webflow" |
26 |
| - organization { |
27 |
| - name = "Spring IO" |
28 |
| - url = "https://spring.io/projects/spring-webflow" |
29 |
| - } |
30 |
| - licenses { |
31 |
| - license { |
32 |
| - name "The Apache Software License, Version 2.0" |
33 |
| - url "https://www.apache.org/licenses/LICENSE-2.0.txt" |
34 |
| - distribution "repo" |
35 |
| - } |
36 |
| - } |
37 |
| - scm { |
38 |
| - url = "https://github.com/spring-projects/spring-webflow" |
39 |
| - connection = "scm:git:git://github.com/spring-projects/spring-webflow" |
40 |
| - developerConnection = "scm:git:git://github.com/spring-projects/spring-webflow" |
41 |
| - } |
42 |
| - developers { |
43 |
| - developer { |
44 |
| - id = "rstoyanchev" |
45 |
| - name = "Rossen Stoyanchev" |
46 |
| - |
47 |
| - } |
48 |
| - } |
49 |
| - issueManagement { |
50 |
| - system = "Jira" |
51 |
| - url = "https://jira.spring.io/browse/SWF" |
52 |
| - } |
53 |
| - } |
54 |
| - } |
| 57 | +// Disable generation of Gradle Module Metadata for compatibility |
| 58 | +// with older versions of Spring Web Flow. |
| 59 | +tasks.withType(GenerateModuleMetadata) { |
| 60 | + enabled = false |
55 | 61 | }
|
0 commit comments