-
Notifications
You must be signed in to change notification settings - Fork 590
Expand file tree
/
Copy pathbuild.gradle
More file actions
99 lines (85 loc) · 3.39 KB
/
build.gradle
File metadata and controls
99 lines (85 loc) · 3.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
* Copyright Terracotta, Inc.
* Copyright IBM Corp. 2024, 2025
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id 'io.github.gradle-nexus.publish-plugin'
//OWASP Security Vulnerability Detection
id 'org.owasp.dependencycheck'
id 'com.jfrog.artifactory'
}
wrapper {
distributionType = Wrapper.DistributionType.ALL
}
allprojects {
version = findProperty('overrideVersion') ?: ehcacheVersion
}
nexusPublishing {
packageGroup = 'org.ehcache'
repositories {
sonatype {
username = sonatypeUser
password = sonatypePwd
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
}
}
// Sonatype is often very slow in these operations:
transitionCheckOptions {
delayBetween = Duration.ofSeconds((findProperty('delayBetweenRetriesInSeconds') ?: '10') as int)
maxRetries = (findProperty('numberOfRetries') ?: '100') as int
}
}
assert JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17) : 'The Ehcache 3 build requires Java 17+ to run'
dependencyCheck {
failBuildOnCVSS = 0
suppressionFile = 'config/owasp-supressions.xml'
skipConfigurations.addAll('checkstyle', 'spotbugs', 'xjcClasspath', 'jakartaXjcClasspath', 'commonXjcClasspath')
skipProjects.addAll(':docs', ':demos:00-NoCache', ':demos:01-CacheAside')
formats = ['HTML', 'JUNIT']
nvd {
apiKey = project.hasProperty('nvdApiKey') ? project.property('nvdApiKey') : System.getenv("NVD_API_KEY")
validForHours = 24 // Cache NVD data for 24 hours
}
analyzers {
// Disable analyzers that aren't needed
assemblyEnabled = false
ossIndexEnabled = false
}
}
tasks.register('check') {
dependsOn dependencyCheckAggregate
}
if (project.hasProperty('overrideVersion') && project.property('overrideVersion').toString().contains("-internal")) {
artifactoryPublish.skip = true
artifactory {
contextUrl = "https://na.artifactory.swg-devops.com/artifactory" // Replace with your Artifactory URL
publish {
repository {
releaseRepoKey = "hyc-webmriab-team-tc01-os-releases-maven-local"
snapshotRepoKey = "hyc-webmriab-team-tc01-os-snapshots-maven-local" // The Artifactory repository key to publish to
username = project.findProperty("artifactory_user") ?: System.getenv("ARTIFACTORY_DEPLOY_USERNAME")
password = project.findProperty("artifactory_password") ?: System.getenv("ARTIFACTORY_DEPLOY_PASSWORD")
}
defaults {
publications('mavenJava')
}
buildInfo {
buildName = "hyc-webmriab-team-tc01/terracotta/${rootProject.name}"
buildNumber = rootProject.findProperty("buildNumber") ?: '' + new Random(System.currentTimeMillis()).nextInt(20000)
}
}
}
}