-
Notifications
You must be signed in to change notification settings - Fork 96
Expand file tree
/
Copy pathbuild.gradle
More file actions
172 lines (146 loc) · 5.6 KB
/
build.gradle
File metadata and controls
172 lines (146 loc) · 5.6 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
plugins {
id 'pl.allegro.tech.build.axion-release' version '1.17.2'
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
}
group = 'org.rundeck.plugins'
ext.publishName = "Ansible Integration ${project.version}"
ext.githubSlug = 'rundeck-plugins/ansible-plugin'
ext.developers = [
[id: 'rundeck', name: 'Rundeck Engineering', email: 'product@rundeck.com']
]
ext.rundeckPluginVersion = '1.2'
ext.pluginClassNames = [
'com.rundeck.plugins.ansible.plugin.AnsibleResourceModelSourceFactory',
'com.rundeck.plugins.ansible.plugin.AnsibleNodeExecutor',
'com.rundeck.plugins.ansible.plugin.AnsibleFileCopier',
'com.rundeck.plugins.ansible.plugin.AnsiblePlaybookWorkflowStep',
'com.rundeck.plugins.ansible.plugin.AnsiblePlaybookInlineWorkflowStep',
'com.rundeck.plugins.ansible.plugin.AnsibleModuleWorkflowStep',
'com.rundeck.plugins.ansible.plugin.AnsiblePlaybookWorflowNodeStep',
'com.rundeck.plugins.ansible.plugin.AnsiblePlaybookInlineWorkflowNodeStep',
'com.rundeck.plugins.ansible.logging.AnsibleSetStatsFilterPlugin',
'com.rundeck.plugins.ansible.plugin.AnsiblePluginGroup'
].join(',')
apply plugin: 'java'
apply plugin: 'groovy'
// Maven Central (Sonatype) requires -sources.jar and -javadoc.jar on close; same as attribute-match java.gradle
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withSourcesJar()
withJavadocJar()
}
// Lombok @Builder inner types break strict javadoc; Central still requires a -javadoc.jar artifact
tasks.withType(Javadoc).configureEach {
failOnError = false
options.encoding = 'UTF-8'
}
scmVersion {
ignoreUncommittedChanges = false
tag {
prefix = '' // NO "v" prefix - see PLUGIN_TAGGING_ARCHITECTURE.md
versionSeparator = ''
}
}
version = scmVersion.version // Dynamic version from git tag
repositories {
mavenLocal()
maven {
name = 'Central Portal Snapshots'
url = 'https://central.sonatype.com/repository/maven-snapshots/'
content {
includeGroup('org.rundeck')
}
} // Must be FIRST for Grails 7 development
maven {
name = 'Central Portal Snapshots'
url = 'https://central.sonatype.com/repository/maven-snapshots/'
// Only search this repository for org.rundeck snapshots
content {
includeGroup('org.rundeck')
}
}
mavenCentral()
}
configurations {
pluginLibs
// Security: Force resolution of vulnerable dependencies
all {
resolutionStrategy {
force 'org.apache.commons:commons-lang3:3.20.0'
force 'org.apache.commons:commons-compress:1.28.0'
force 'org.jetbrains.kotlin:kotlin-stdlib:2.1.0'
// Exclude old commons-lang to prevent conflicts
exclude group: 'commons-lang', module: 'commons-lang'
}
}
implementation {
extendsFrom pluginLibs
}
}
dependencies {
pluginLibs libs.gson
// rundeck-core: compileOnly so SNAPSHOT is not in published POM; testImplementation for tests
compileOnly libs.rundeck.core
testImplementation libs.rundeck.core
implementation libs.groovy.all
pluginLibs libs.jackson.core
pluginLibs libs.jackson.dataformat.yaml
implementation libs.snakeyaml
// Security: Explicit inclusion of secure versions
implementation libs.commons.lang3
implementation libs.commons.compress
compileOnly libs.lombok
annotationProcessor libs.lombok
testCompileOnly libs.lombok
testAnnotationProcessor libs.lombok
testImplementation libs.spock.core
testImplementation libs.bytebuddy
testImplementation libs.objenesis
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
// Java 17+ module access for cglib/Spock mocking
jvmArgs = [
'--add-opens=java.base/java.lang=ALL-UNNAMED',
'--add-opens=java.base/java.util=ALL-UNNAMED',
'--add-opens=java.base/java.lang.reflect=ALL-UNNAMED',
'--add-opens=java.base/java.io=ALL-UNNAMED',
'--add-opens=java.base/java.net=ALL-UNNAMED'
]
}
task copyToLib(type: Copy) {
into "$buildDir/output/lib"
from configurations.pluginLibs
}
jar {
from "$buildDir/output"
manifest {
def libList = configurations.pluginLibs.collect{'lib/' + it.name}.join(' ')
attributes 'Rundeck-Plugin-Name' : 'Ansible Integration'
attributes 'Rundeck-Plugin-Description' : 'This plugin brings basic Ansible support to Rundeck. It imports hosts from Ansible\'s inventory, including a bunch of facts, and can run modules and playbooks. There is also a node executor and file copier for your project.'
attributes 'Rundeck-Plugin-Rundeck-Compatibility-Version': '3.0.1+'
attributes 'Rundeck-Plugin-Tags': 'java,node executor,resource model,workflow step,ansible'
attributes 'Rundeck-Plugin-License': 'MIT'
attributes 'Rundeck-Plugin-Source-Link': 'https://github.com/rundeck-plugins/ansible-plugin'
attributes 'Rundeck-Plugin-Target-Host-Compatibility': 'all'
attributes 'Rundeck-Plugin-Author': 'David Kirstein'
attributes 'Rundeck-Plugin-Classnames': pluginClassNames
attributes 'Rundeck-Plugin-File-Version': version
attributes 'Rundeck-Plugin-Version': rundeckPluginVersion
attributes 'Rundeck-Plugin-Archive': 'true'
attributes 'Rundeck-Plugin-Libs': "${libList}"
attributes 'Rundeck-Plugin-URL': 'https://github.com/rundeck-plugins/ansible-plugin'
}
dependsOn(copyToLib)
}
nexusPublishing {
packageGroup = 'org.rundeck.plugins'
repositories {
sonatype {
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
}
}
}
apply from: "${rootDir}/gradle/publishing.gradle"