|
1 | 1 | buildscript { |
2 | 2 | ext { |
3 | | - springBootVersion = '2.2.5.RELEASE' |
4 | | - } |
5 | | - repositories { |
6 | | - mavenCentral() |
7 | | - maven { |
8 | | - url = 'https://oss.sonatype.org/content/repositories/snapshots/' |
9 | | - } |
10 | | - } |
11 | | - dependencies { |
12 | | - classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") |
13 | | - classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1' |
14 | | - classpath 'org.owasp:dependency-check-gradle:7.1.1' |
15 | | - classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.21.1" |
| 3 | + osisVersion = '2.0.0' |
| 4 | + vaultclientVersion = '1.0.0-SNAPSHOT' |
| 5 | + springBootVersion = '2.7.5' |
16 | 6 | } |
17 | 7 | } |
18 | 8 |
|
19 | 9 | plugins { |
20 | 10 | id 'java' |
21 | | - id 'maven-publish' |
| 11 | + id 'java-library' |
22 | 12 | id 'pmd' |
23 | | - id "com.github.spotbugs" version "4.6.0" |
24 | | - id 'com.github.ksoichiro.console.reporter' version '0.6.2' |
25 | | - id 'io.codearte.nexus-staging' version '0.21.1' |
| 13 | + id 'org.springframework.boot' version "${springBootVersion}" |
| 14 | + id 'io.spring.dependency-management' version '1.1.0' |
| 15 | + id 'com.github.spotbugs' version '5.0.12' |
| 16 | + id 'com.github.ksoichiro.console.reporter' version '0.6.3' // jacoco report (code coverage) |
| 17 | + id 'io.github.gradle-nexus.publish-plugin' version '1.1.0' // gradle nexus publish-plugin |
| 18 | + id 'org.owasp.dependencycheck' version '7.1.1' |
26 | 19 | } |
27 | 20 |
|
28 | | -group = 'com.scality' |
29 | | -description = 'osis.scality' |
30 | | -sourceCompatibility = '1.8' |
| 21 | +dependencies { |
| 22 | + implementation project('osis-app') |
| 23 | +} |
31 | 24 |
|
| 25 | +bootJar { |
| 26 | + mainClass = 'com.scality.osis.Application' |
| 27 | +} |
32 | 28 |
|
33 | | -dependencies { |
34 | | - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' |
35 | | - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' |
36 | | - compile project('osis-app') |
| 29 | +jar { |
| 30 | + classifier = '' |
| 31 | +} |
| 32 | + |
| 33 | +// to upload the bootJar instead of jar |
| 34 | +configurations { |
| 35 | + [apiElements, runtimeElements].each { |
| 36 | + it.outgoing.artifacts.removeIf { it.buildDependencies.getDependencies(null).contains(jar) } |
| 37 | + it.outgoing.artifact(bootJar) |
| 38 | + } |
37 | 39 | } |
38 | 40 |
|
39 | 41 | allprojects { |
40 | | - apply plugin: 'java' |
| 42 | + group = 'com.scality' |
| 43 | + sourceCompatibility = JavaVersion.VERSION_17 |
| 44 | + |
| 45 | + apply plugin: 'java-library' |
41 | 46 | apply plugin: 'maven-publish' |
| 47 | + apply plugin: 'signing' |
42 | 48 | apply plugin: 'org.owasp.dependencycheck' |
43 | 49 |
|
44 | 50 | apply from: "$rootDir/spotbugs.gradle" |
45 | 51 | apply from: "$rootDir/pmd.gradle" |
46 | 52 | apply from: "$rootDir/jacoco.gradle" |
47 | 53 | apply from: "$rootDir/upload-artifact.gradle" |
48 | 54 |
|
| 55 | + dependencies { |
| 56 | + // vaultclient |
| 57 | + implementation "com.scality:vaultclient:$vaultclientVersion" |
| 58 | + |
| 59 | + // Spring boot |
| 60 | + implementation "org.springframework.boot:spring-boot-starter-webflux:$springBootVersion" |
| 61 | + implementation "org.springframework.boot:spring-boot-starter-hateoas:$springBootVersion" |
| 62 | + implementation "org.springframework.boot:spring-boot-starter-data-jpa:$springBootVersion" |
| 63 | + implementation "org.springframework.boot:spring-boot-starter-security:$springBootVersion" |
| 64 | + implementation "org.springframework.boot:spring-boot-starter-data-redis:$springBootVersion" |
| 65 | + implementation "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" |
| 66 | + testImplementation "org.springframework.boot:spring-boot-starter-test:$springBootVersion" |
| 67 | + |
| 68 | + implementation 'io.springfox:springfox-swagger2:3.0.0' |
| 69 | + implementation 'io.springfox:springfox-swagger-ui:3.0.0' |
| 70 | + implementation 'javax.validation:validation-api:2.0.1.Final' |
| 71 | + implementation 'org.apache.commons:commons-lang3:3.12.0' |
| 72 | + implementation 'io.jsonwebtoken:jjwt:0.9.1' |
| 73 | + implementation 'com.amazonaws:aws-java-sdk-s3:1.12.328' |
| 74 | + implementation 'com.amazonaws:aws-java-sdk-sts:1.12.328' |
| 75 | + implementation 'com.amazonaws:aws-java-sdk-iam:1.12.328' |
| 76 | + } |
49 | 77 |
|
50 | 78 | repositories { |
51 | 79 | mavenLocal() |
52 | 80 | mavenCentral() |
53 | | - jcenter() |
54 | | - maven { |
55 | | - url = 'https://repo.maven.apache.org/maven2' |
56 | | - } |
57 | 81 | maven { |
58 | 82 | url = 'https://oss.sonatype.org/content/repositories/snapshots/' |
59 | 83 | } |
60 | 84 | } |
61 | | -} |
62 | | - |
63 | | -repositories { |
64 | | - mavenCentral() |
65 | | -} |
66 | | - |
67 | | -apply plugin: 'org.springframework.boot' |
68 | | -apply plugin: 'io.spring.dependency-management' |
69 | | -apply plugin: 'java' |
70 | | -apply plugin: 'idea' |
71 | | - |
72 | | -bootJar { |
73 | | - mainClassName = 'com.scality.osis.Application' |
74 | | - enabled = true |
75 | | -} |
76 | | - |
77 | | -jar { |
78 | | - manifest { |
79 | | - attributes 'Main-Class': 'com.scality.osis.Application' |
80 | | - } |
81 | | - from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } |
82 | | -} |
83 | | - |
84 | | -subprojects { |
85 | | - apply plugin: 'io.spring.dependency-management' |
86 | | - apply plugin: 'java' |
87 | | - apply plugin: 'idea' |
88 | | - |
89 | | - sourceCompatibility = 1.8 |
90 | | - targetCompatibility = 1.8 |
91 | 85 |
|
92 | | - tasks.withType(Javadoc).all { enabled = false } |
93 | | -} |
94 | | - |
95 | | -sourceSets { |
96 | | - main { |
97 | | - resources { |
98 | | - srcDirs = ["$projectDir/src/main/resources"] |
| 86 | + configurations { |
| 87 | + version = "${osisVersion}" |
| 88 | + if (!project.hasProperty('release')) { |
| 89 | + project.setVersion(project.getVersion() + '-SNAPSHOT') |
99 | 90 | } |
100 | 91 | } |
101 | | -} |
102 | 92 |
|
103 | | -configure(allprojects) { |
104 | | - version = '1.5.0' |
105 | | - if (!project.hasProperty('release')) { |
106 | | - project.setVersion(project.getVersion() + '-SNAPSHOT') |
| 93 | + test { |
| 94 | + useJUnitPlatform() |
107 | 95 | } |
108 | 96 |
|
109 | | - ext { |
110 | | - springBootVersion = '2.2.5.RELEASE' |
| 97 | + tasks.withType(JavaCompile) { |
| 98 | + options.encoding = 'UTF-8' |
111 | 99 | } |
112 | | - dependencies { |
113 | | - compile "org.springframework.boot:spring-boot-starter-webflux:$springBootVersion" |
114 | | - compile "org.springframework.boot:spring-boot-starter-hateoas:$springBootVersion" |
115 | | - compile "org.springframework.boot:spring-boot-starter-data-jpa:$springBootVersion" |
116 | | - compile "org.springframework.boot:spring-boot-starter-security:$springBootVersion" |
117 | | - compile "org.springframework.boot:spring-boot-starter-data-redis:$springBootVersion" |
118 | | - compile "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion" |
119 | | - testImplementation("org.springframework.boot:spring-boot-starter-test:$springBootVersion") { |
120 | | - exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' |
121 | | - } |
122 | | - compile 'io.springfox:springfox-swagger2:2.8.0' |
123 | | - compile 'io.springfox:springfox-swagger-ui:2.8.0' |
124 | | - compile 'javax.xml.bind:jaxb-api:2.2.11' |
125 | | - compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.5' |
126 | | - compile 'org.openapitools:jackson-databind-nullable:0.1.0' |
127 | | - compile 'javax.validation:validation-api:2.0.1.Final' |
128 | | - compile 'org.hsqldb:hsqldb:2.3.2' |
129 | | - compile 'org.postgresql:postgresql:42.2.25' |
130 | | - compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.11.0' |
131 | | - compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-xml', version: '2.11.0' |
132 | | - compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.9' |
133 | | - compile 'io.jsonwebtoken:jjwt:0.9.1' |
134 | | - implementation 'org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE' |
135 | | - implementation 'com.scality:vaultclient:0.5.0' |
136 | | - implementation 'com.amazonaws:aws-java-sdk-s3:1.11.914' |
137 | | - implementation 'com.amazonaws:aws-java-sdk-sts:1.11.914' |
138 | | - implementation 'com.amazonaws:aws-java-sdk-iam:1.11.914' |
139 | | - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' |
140 | | - } |
141 | | -} |
142 | | - |
143 | | -tasks.withType(JavaCompile) { |
144 | | - options.encoding = 'UTF-8' |
145 | | -} |
146 | | - |
147 | | -test { |
148 | | - useJUnitPlatform() |
149 | 100 | } |
150 | 101 |
|
151 | | -jar { |
152 | | - enabled = true |
153 | | -} |
154 | | - |
155 | | -tasks.withType(JavaCompile) { |
156 | | - options.encoding = 'UTF-8' |
157 | | -} |
158 | | - |
159 | | -publishing { |
160 | | - publications { |
161 | | - mavenJava(MavenPublication) { |
162 | | - groupId 'com.scality' |
163 | | - artifactId 'osis' |
164 | | - |
165 | | - from components.java |
166 | | - |
167 | | - } |
168 | | - } |
169 | | - |
| 102 | +// task used by the gradle nexus publish-plugin |
| 103 | +nexusPublishing { |
170 | 104 | repositories { |
171 | | - mavenLocal() |
172 | | - mavenCentral() |
173 | | - jcenter() |
174 | | - maven { |
175 | | - url = 'https://repo.maven.apache.org/maven2' |
176 | | - } |
177 | | - maven { |
178 | | - url = 'https://oss.sonatype.org/content/repositories/snapshots/' |
| 105 | + sonatype { |
| 106 | + username = sonatypeUsername |
| 107 | + password = sonatypePassword |
179 | 108 | } |
180 | 109 | } |
181 | 110 | } |
0 commit comments