@@ -81,14 +81,14 @@ class SilverpeasSetupPlugin implements Plugin<Project> {
81
81
Task jbossConf = project. tasks. create(CONFIGURE_JBOSS . name, JBossConfigurationTask ) {
82
82
it. driversDir = extension. installation. dsDriversDir. get()
83
83
it. config = extension. config
84
- it. jboss = jBossServer
85
- it. settings = extension. settings
84
+ it. jboss = jBossServer
85
+ it. settings = extension. settings
86
86
}
87
87
88
88
Task silverpeasConf = project. tasks. create(CONFIGURE_SILVERPEAS . name, SilverpeasConfigurationTask ) {
89
89
it. silverpeasHome = extension. silverpeasHome
90
- it. config = extension. config
91
- it. settings = extension. settings
90
+ it. config = extension. config
91
+ it. settings = extension. settings
92
92
}. dependsOn(construction)
93
93
94
94
Task configuration = project. tasks. create(CONFIGURE . name) {
@@ -101,8 +101,8 @@ class SilverpeasSetupPlugin implements Plugin<Project> {
101
101
}. dependsOn(construction)
102
102
103
103
Task migration = project. tasks. create(MIGRATE . name, SilverpeasMigrationTask ) {
104
- it. migration = extension. migration
105
- it. settings = extension. settings
104
+ it. migration = extension. migration
105
+ it. settings = extension. settings
106
106
}. dependsOn(configuration)
107
107
108
108
project. tasks. create(INSTALL . name, SilverpeasInstallationTask ) {
@@ -121,30 +121,32 @@ class SilverpeasSetupPlugin implements Plugin<Project> {
121
121
* @param project the Gradle project that uses the plugin
122
122
* @param extension the project extension of the plugin
123
123
*/
124
- private void setUpGradleAssemblingTaskForThisPlugin (Project project ,
125
- SilverpeasSetupExtension extension ) {
124
+ private static void setUpGradleAssemblingTaskForThisPlugin (Project project ,
125
+ SilverpeasSetupExtension extension ) {
126
126
try {
127
127
Task assemble = project. tasks. getByName(ASSEMBLE . name). doLast {
128
128
if (! extension. installation. distDir. get(). exists()) {
129
129
extension. installation. distDir. get(). mkdirs()
130
130
}
131
131
SilverpeasBuilder builder = new SilverpeasBuilder (project, FileLogger . getLogger(delegate. name))
132
132
builder. driversDir = extension. installation. dsDriversDir. get()
133
- builder. silverpeasHome = extension. silverpeasHome
133
+ builder. silverpeasHome = extension. silverpeasHome. get()
134
134
builder. settings = extension. settings
135
135
builder. extractSoftwareBundles(extension. installation. bundles,
136
136
extension. installation. distDir. get())
137
137
}
138
138
assemble. description = ' Assemble all the software bundles that made Silverpeas'
139
- assemble. onlyIf { ! extension. installation. distDir. get(). exists() &&
140
- ! extension. installation. dsDriversDir. get(). exists()
139
+ assemble. onlyIf {
140
+ ! extension. installation. distDir. get(). exists() &&
141
+ ! extension. installation. dsDriversDir. get(). exists()
141
142
}
142
143
assemble. outputs. upToDateWhen {
143
144
extension. installation. distDir. get(). exists() &&
144
145
extension. installation. dsDriversDir. get(). exists()
145
146
}
146
147
} catch (UnknownTaskException e) {
147
148
// nothing to do
149
+ println e. message
148
150
}
149
151
}
150
152
@@ -155,12 +157,12 @@ class SilverpeasSetupPlugin implements Plugin<Project> {
155
157
* @param project the Gradle project
156
158
* @param extension the project extension of the plugin
157
159
*/
158
- private void setUpGradleBuildTaskForThisPlugin (Project project ,
159
- SilverpeasSetupExtension extension ) {
160
+ private static void setUpGradleBuildTaskForThisPlugin (Project project ,
161
+ SilverpeasSetupExtension extension ) {
160
162
try {
161
163
Task build = project. tasks. getByName(BUILD . name). doLast {
162
164
SilverpeasBuilder builder = new SilverpeasBuilder (project, FileLogger . getLogger(delegate. name))
163
- builder. silverpeasHome = extension. silverpeasHome
165
+ builder. silverpeasHome = extension. silverpeasHome. get()
164
166
builder. settings = extension. settings
165
167
builder. developmentMode = extension. installation. developmentMode. get()
166
168
builder. generateSilverpeasApplication(extension. installation. distDir. get())
@@ -180,6 +182,7 @@ class SilverpeasSetupPlugin implements Plugin<Project> {
180
182
}
181
183
} catch (UnknownTaskException e) {
182
184
// nothing to do
185
+ println e. message
183
186
}
184
187
}
185
188
@@ -190,7 +193,7 @@ class SilverpeasSetupPlugin implements Plugin<Project> {
190
193
* @return the project extension of the plugin
191
194
*/
192
195
private SilverpeasSetupExtension createSilverpeasSetupExtention (Project project ) {
193
- def extension = project. extensions. create(EXTENSION , SilverpeasSetupExtension , project)
196
+ SilverpeasSetupExtension extension = project. extensions. create(EXTENSION , SilverpeasSetupExtension , project)
194
197
extension. settings = loadConfigurationProperties(extension. config. configurationHome. get())
195
198
completeSettings(extension. settings, extension)
196
199
encryptAdminPassword(extension. settings)
@@ -205,8 +208,8 @@ class SilverpeasSetupPlugin implements Plugin<Project> {
205
208
* @param jBossServer the JBoss server wrapper to initialize with some of the plugin's input
206
209
* properties exposed to the project.
207
210
*/
208
- private void initializePluginParameters (Project project ,
209
- JBossServer jBossServer ) {
211
+ private static void initializePluginParameters (Project project ,
212
+ JBossServer jBossServer ) {
210
213
project. afterEvaluate { Project currentProject , ProjectState state ->
211
214
SilverpeasSetupExtension extension =
212
215
(SilverpeasSetupExtension ) currentProject. extensions. getByName(EXTENSION )
@@ -228,7 +231,7 @@ class SilverpeasSetupPlugin implements Plugin<Project> {
228
231
* the String value.
229
232
* @param extension the project extension of the plugin
230
233
*/
231
- private void registerManagedBeansForScripts (SilverpeasSetupExtension extension ) {
234
+ private static void registerManagedBeansForScripts (SilverpeasSetupExtension extension ) {
232
235
SilverpeasSetupService setupService = new SilverpeasSetupService (extension. settings)
233
236
String . metaClass. asPath = { Paths . get(setupService. expanseVariables(delegate. toString())) }
234
237
ManagedBeanContainer . registry()
@@ -266,7 +269,7 @@ class SilverpeasSetupPlugin implements Plugin<Project> {
266
269
* @param settings the settings to complete/
267
270
* @param extension the project extension of the plugin
268
271
*/
269
- private void completeSettings (Map settings , SilverpeasSetupExtension extension ) {
272
+ private static void completeSettings (Map< String , String > settings , SilverpeasSetupExtension extension ) {
270
273
settings. SILVERPEAS_HOME = normalizePath(extension. silverpeasHome. path)
271
274
settings. MIGRATION_HOME = normalizePath(extension. migration. homeDir. get(). path)
272
275
settings. CONFIGURATION_HOME = normalizePath(extension. config. configurationHome. get(). path)
@@ -320,7 +323,7 @@ class SilverpeasSetupPlugin implements Plugin<Project> {
320
323
* Replaces the administrator password set in the specified settings by its encrypted counterpart.
321
324
* @param settings the settings with the administrator password.
322
325
*/
323
- private void encryptAdminPassword (Map settings ) {
326
+ private static void encryptAdminPassword (Map< String , String > settings ) {
324
327
Encryption encryption = EncryptionFactory . instance. createDefaultEncryption()
325
328
settings. SILVERPEAS_ADMIN_PASSWORD = encryption. encrypt(settings. SILVERPEAS_ADMIN_PASSWORD )
326
329
}
@@ -330,7 +333,7 @@ class SilverpeasSetupPlugin implements Plugin<Project> {
330
333
* @param project the Gradle project
331
334
* @param loggingProperties the logging properties.
332
335
*/
333
- private void initLogging (Project project , SilverpeasLoggingProperties loggingProperties ) {
336
+ private static void initLogging (Project project , SilverpeasLoggingProperties loggingProperties ) {
334
337
String timestamp = new Date (). format(' yyyyMMdd_HHmmss' )
335
338
if (! loggingProperties. logDir. exists()) {
336
339
loggingProperties. logDir. mkdirs()
0 commit comments