-
Notifications
You must be signed in to change notification settings - Fork 28
/
build.gradle
183 lines (162 loc) · 6.59 KB
/
build.gradle
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
173
174
175
176
177
178
179
180
181
182
183
ext.pluginClassNames='com.dtolabs.rundeck.plugin.overthere.OTWinRMNodeExecutor,com.dtolabs.rundeck.plugin.overthere.OTWinRMFileCopier'
defaultTasks 'clean','build'
version = '1.3.8'
ext.rundeckPluginVersion= '1.1'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'project-report'
sourceCompatibility = 1.6
archivesBaseName = "rundeck-winrm-plugin"
ext.rundeckVersion='2.3.2'
task wrapper(type: Wrapper) {
gradleVersion = '2.8'
}
configurations{
//declare custom pluginLibs configuration to include only libs for this plugin
pluginLibs
//declare compile to extend from pluginLibs so it inherits the dependencies
compile{
extendsFrom pluginLibs
}
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
pluginLibs(group: 'com.xebialabs.overthere', name: 'overthere', version: '5.0.2'){
exclude( module: 'bcprov-jdk15on')
exclude( module: 'jzlib')
exclude( module: 'sshj')
exclude( module: 'commons-net')
exclude( module: 'servlet-api')
exclude( module: 'xom')
exclude( module: 'jdom')
exclude( module: 'dom4j')
exclude( module: 'jaxen')
exclude( module: 'icu4j')
exclude( module: 'jcl-over-slf4j')
exclude( module: 'slf4j-api')
}
// bump version brought by com.xebialabs.overthere, which is affected by CVE-2018-1000613
pluginLibs ("org.bouncycastle:bcpkix-jdk15on:1.62") {
exclude ( group: "org.bouncycastle", module: "bcprov-jdk15on")
}
compile(group: 'org.rundeck', name: 'rundeck-core', version: rundeckVersion)
}
// task to copy plugin libs to output/lib dir
task copyToLib(type: Copy) {
into "$buildDir/output/lib"
from configurations.pluginLibs
}
jar {
from "$buildDir/output"
metaInf {
from "LICENSE.txt"
from("thirdparty"){
include "*"
}
}
manifest {
def libList = configurations.pluginLibs.collect {'lib/' + it.name}.join(' ')
attributes 'Rundeck-Plugin-File-Version': version,
'Rundeck-Plugin-Version': rundeckPluginVersion,
'Rundeck-Plugin-Archive': 'true',
'Rundeck-Plugin-Classnames': pluginClassNames,
'Rundeck-Plugin-Libs': "${libList}",
'Rundeck-Plugin-Name' : 'Rundeck WinRM',
'Rundeck-Plugin-Description' : 'Rundeck Node Executor and File Copier plugins that uses WinRM to connect to Windows and execute commands. It uses the OverThere Library to provide the WinRM implementation, and uses Basic authentication over HTTPS.',
'Rundeck-Plugin-Rundeck-Compatibility-Version': '2.3.2+',
'Rundeck-Plugin-Tags': 'java,node executor,file copier,WinRM,Windows',
'Rundeck-Plugin-License': 'Apache 2.0',
'Rundeck-Plugin-Source-Link': 'https://github.com/rundeck-plugins/rundeck-winrm-plugin',
'Rundeck-Plugin-Target-Host-Compatibility': 'all',
'Rundeck-Plugin-Author': 'Rundeck, Inc.'
}
}
//set jar task to depend on copyToLib
jar.dependsOn(copyToLib)
apply plugin: 'maven'
task mappings << {
println conf2ScopeMappings.mappings
}
conf2ScopeMappings.addMapping 1, configurations.pluginLibs, 'compile'
conf2ScopeMappings.addMapping 1, configurations.compile, 'provided'
task createPom << {
def libList = configurations.pluginLibs.collect {'lib/' + it.name}.join(' ')
pom {
project {
parent{
artifactId 'rundeck-plugins-parent'
groupId 'org.rundeck-plugins'
version '2'
}
artifactId 'rundeck-winrm-plugin'
groupId "org.rundeck-plugins"
inceptionYear '2011'
packaging 'jar'
version version
name "Rundeck WinRM NodeExecutor Plugin"
url 'http://rundeck.org'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
properties {
'plugin.release.version'('2.5.1')
}
scm{
connection 'scm:git:[email protected]:rundeck-plugins/rundeck-winrm-plugin.git'
developerConnection 'scm:git:[email protected]:rundeck-plugins/rundeck-winrm-plugin.git'
url '[email protected]:rundeck-plugins/rundeck-winrm-plugin.git'
tag 'HEAD'
}
}
}.withXml {
asNode().appendNode('build').with {
appendNode('plugins').with {
appendNode('plugin').with {
appendNode('artifactId', 'maven-compiler-plugin')
appendNode('version', '2.3.2')
appendNode('configuration').with {
appendNode('source', '1.6')
appendNode('target', '1.6')
}
}
appendNode('plugin').with {
appendNode('artifactId', 'maven-assembly-plugin')
appendNode('version', '2.2.2')
appendNode('executions').appendNode('execution').with {
appendNode('id', 'make-assembly')
appendNode('phase', 'package')
appendNode('goals').with {
appendNode('goal', 'single')
}
}
appendNode('configuration').with {
appendNode('appendAssemblyId', 'false')
appendNode('descriptors').with {
appendNode('descriptor', 'src/main/assembly/jar.xml')
}
appendNode('archive').with {
appendNode('manifestEntries').with {
appendNode('Rundeck-Plugin-Version', this.rundeckPluginVersion)
appendNode('Rundeck-Plugin-File-Version', this.version)
appendNode('Rundeck-Plugin-Archive', 'true')
appendNode('Rundeck-Plugin-Classnames', this.pluginClassNames)
appendNode('Rundeck-Plugin-Libs', libList)
}
}
}
}
appendNode('plugin').with {
appendNode('artifactId', 'maven-release-plugin')
appendNode('version', '${plugin.release.version}')
}
}
}
}.writeTo("pom.xml")
}