Skip to content

Commit

Permalink
[JBWS-4027] Move to gmavenplus plugin to allow upgrading to a recent …
Browse files Browse the repository at this point in the history
…Groovy version supporting JDK9.
  • Loading branch information
asoldano committed Mar 15, 2017
1 parent d86cbd5 commit c21eb55
Show file tree
Hide file tree
Showing 22 changed files with 356 additions and 212 deletions.
1 change: 1 addition & 0 deletions .mvn/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-DdownloadSources=true
138 changes: 110 additions & 28 deletions modules/testsuite/cxf-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@
<build>
<plugins>
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<executions>
<execution>
<id>testsuite-default</id>
Expand All @@ -103,15 +103,38 @@
<goal>execute</goal>
</goals>
<configuration>
<source>${basedir}/src/test/scripts/jbws-testsuite-default${additionalGroovyScriptSuffix}.groovy</source>
<scripts>
<script>file:///${basedir}/src/test/scripts/jbws-testsuite-default${additionalGroovyScriptSuffix}.groovy</script>
</scripts>
<properties>
<inputFile>${jboss.home}/standalone/configuration/standalone.xml</inputFile>
<outputFile>${jboss.home}/standalone/configuration/jbws-testsuite-default.xml</outputFile>
<serverLog>jbws-testsuite-default.log</serverLog>
<usersPropFile>${project.build.directory}/test-classes/jbossws-users.properties</usersPropFile>
<rolesPropFile>${project.build.directory}/test-classes/jbossws-roles.properties</rolesPropFile>
<keystorePath>${project.build.directory}/test-classes/test.keystore</keystorePath>
<testResourcesDir>${project.build.directory}/test-resources</testResourcesDir>
<property>
<name>inputFile</name>
<value>${jboss.home}/standalone/configuration/standalone.xml</value>
</property>
<property>
<name>outputFile</name>
<value>${jboss.home}/standalone/configuration/jbws-testsuite-default.xml</value>
</property>
<property>
<name>serverLog</name>
<value>jbws-testsuite-default.log</value>
</property>
<property>
<name>usersPropFile</name>
<value>${project.build.directory}/test-classes/jbossws-users.properties</value>
</property>
<property>
<name>rolesPropFile</name>
<value>${project.build.directory}/test-classes/jbossws-roles.properties</value>
</property>
<property>
<name>keystorePath</name>
<value>${project.build.directory}/test-classes/test.keystore</value>
</property>
<property>
<name>testResourcesDir</name>
<value>${project.build.directory}/test-resources</value>
</property>
</properties>
</configuration>
</execution>
Expand All @@ -122,13 +145,30 @@
<goal>execute</goal>
</goals>
<configuration>
<source>${basedir}/src/test/scripts/jbws-testsuite-ssl-mutual-auth${additionalGroovyScriptSuffix}.groovy</source>
<scripts>
<script>file:///${basedir}/src/test/scripts/jbws-testsuite-ssl-mutual-auth${additionalGroovyScriptSuffix}.groovy</script>
</scripts>
<properties>
<inputFile>${jboss.home}/standalone/configuration/standalone.xml</inputFile>
<outputFile>${jboss.home}/standalone/configuration/jbws-testsuite-ssl-mutual-auth.xml</outputFile>
<serverLog>jbws-testsuite-ssl-mutual-auth.log</serverLog>
<keystorePath>${project.build.directory}/test-classes/test.keystore</keystorePath>
<truststorePath>${project.build.directory}/test-classes/test.truststore</truststorePath>
<property>
<name>inputFile</name>
<value>${jboss.home}/standalone/configuration/standalone.xml</value>
</property>
<property>
<name>outputFile</name>
<value>${jboss.home}/standalone/configuration/jbws-testsuite-ssl-mutual-auth.xml</value>
</property>
<property>
<name>serverLog</name>
<value>jbws-testsuite-ssl-mutual-auth.log</value>
</property>
<property>
<name>keystorePath</name>
<value>${project.build.directory}/test-classes/test.keystore</value>
</property>
<property>
<name>truststorePath</name>
<value>${project.build.directory}/test-classes/test.truststore</value>
</property>
</properties>
</configuration>
</execution>
Expand All @@ -139,11 +179,30 @@
<goal>execute</goal>
</goals>
<configuration>
<source>${basedir}/src/test/scripts/jbws-testsuite-default-config-tests${additionalGroovyScriptSuffix}.groovy</source>
<scripts>
<script>file:///${basedir}/src/test/scripts/jbws-testsuite-default-config-tests${additionalGroovyScriptSuffix}.groovy</script>
</scripts>
<properties>
<inputFile>${jboss.home}/standalone/configuration/standalone.xml</inputFile>
<outputFile>${jboss.home}/standalone/configuration/jbws-testsuite-default-config-tests.xml</outputFile>
<serverLog>jbws-testsuite-default-config-tests.log</serverLog>
<property>
<name>inputFile</name>
<value>${jboss.home}/standalone/configuration/standalone.xml</value>
</property>
<property>
<name>outputFile</name>
<value>${jboss.home}/standalone/configuration/jbws-testsuite-default-config-tests.xml</value>
</property>
<property>
<name>usersPropFile</name>
<value>${project.build.directory}/test-classes/jbossws-users.properties</value>
</property>
<property>
<name>rolesPropFile</name>
<value>${project.build.directory}/test-classes/jbossws-roles.properties</value>
</property>
<property>
<name>serverLog</name>
<value>jbws-testsuite-default-config-tests.log</value>
</property>
</properties>
</configuration>
</execution>
Expand All @@ -154,15 +213,38 @@
<goal>execute</goal>
</goals>
<configuration>
<source>${basedir}/src/test/scripts/jbws-testsuite-jms-${jbossws.integration.target}.groovy</source>
<scripts>
<script>file:///${basedir}/src/test/scripts/jbws-testsuite-jms-${jbossws.integration.target}.groovy</script>
</scripts>
<properties>
<inputFile>${jboss.home}/standalone/configuration/standalone-full.xml</inputFile>
<outputFile>${jboss.home}/standalone/configuration/jbws-testsuite-jms-${jbossws.integration.target}.xml</outputFile>
<serverLog>jbws-testsuite-jms.log</serverLog>
<srcUsersProperties>${project.build.directory}/test-classes/jbws-application-users.properties</srcUsersProperties>
<destUsersProperties>${jboss.home}/standalone/configuration/jbws-application-users.properties</destUsersProperties>
<srcRolesProperties>${project.build.directory}/test-classes/jbws-application-roles.properties</srcRolesProperties>
<destRolesProperties>${jboss.home}/standalone/configuration/jbws-application-roles.properties</destRolesProperties>
<property>
<name>inputFile</name>
<value>${jboss.home}/standalone/configuration/standalone-full.xml</value>
</property>
<property>
<name>outputFile</name>
<value>${jboss.home}/standalone/configuration/jbws-testsuite-jms-${jbossws.integration.target}.xml</value>
</property>
<property>
<name>serverLog</name>
<value>jbws-testsuite-jms.log</value>
</property>
<property>
<name>srcUsersProperties</name>
<value>${project.build.directory}/test-classes/jbws-application-users.properties</value>
</property>
<property>
<name>destUsersProperties</name>
<value>${jboss.home}/standalone/configuration/jbws-application-users.properties</value>
</property>
<property>
<name>srcRolesProperties</name>
<value>${project.build.directory}/test-classes/jbws-application-roles.properties</value>
</property>
<property>
<name>destRolesProperties</name>
<value>${jboss.home}/standalone/configuration/jbws-application-roles.properties</value>
</property>
</properties>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
def root = new XmlParser().parse(project.properties['inputFile'])
def root = new XmlParser().parse(inputFile)

/**
* Fix logging: optionally remove CONSOLE handler and set a specific log file
Expand All @@ -8,7 +8,7 @@ def logHandlers = root.profile.subsystem.'root-logger'.handlers[0]
def consoleHandler = logHandlers.find{it.@name == 'CONSOLE'}
if (!project.properties['enableServerLoggingToConsole']) logHandlers.remove(consoleHandler)
def file = root.profile.subsystem.'periodic-rotating-file-handler'.file[0]
file.attributes()['path'] = project.properties['serverLog']
file.attributes()['path'] = serverLog
/**
* Add a security-domain block like this:
*
Expand All @@ -28,7 +28,7 @@ for (item in subsystems) {
if (item.name().getNamespaceURI().contains("urn:wildfly:elytron:")) {
securitySubsystem = item
for (element in item) {
if (element.name().getLocalPart().equals("security-domains")) {
if (element.name().getLocalPart() == 'security-domains') {
securityDomains = element
}
}
Expand All @@ -46,8 +46,8 @@ def realm = securityDomain.appendNode('realm',['name':'JBossWS','role-decoder':'
*/
def securityRealms = root.profile.subsystem.'security-realms'[0]
def propertiesRealm = securityRealms.appendNode('properties-realm', ['name':'JBossWS'])
def usersProperties = propertiesRealm.appendNode('users-properties',['path':project.properties['usersPropFile'], 'plain-text':'true'])
def groupsProperties = propertiesRealm.appendNode('groups-properties',['path':project.properties['rolesPropFile']])
def usersProperties = propertiesRealm.appendNode('users-properties',['path':usersPropFile, 'plain-text':'true'])
def groupsProperties = propertiesRealm.appendNode('groups-properties',['path':rolesPropFile])

/* <http>
* <http-authentication-factory name="JBossWS" http-server-mechanism-factory="global" security-domain="JBossWS">
Expand All @@ -59,7 +59,7 @@ def groupsProperties = propertiesRealm.appendNode('groups-properties',['path':pr
*/
def httpAuthen = null
for (element in securitySubsystem) {
if (element.name().getLocalPart().equals("http")) {
if (element.name().getLocalPart() == 'http') {
httpAuthen = element
break
}
Expand Down Expand Up @@ -88,5 +88,5 @@ def appSecurityDomain = undertowAppSecurityDomains.appendNode('application-secur
def writer = new StringWriter()
writer.println('<?xml version="1.0" encoding="UTF-8"?>')
new XmlNodePrinter(new PrintWriter(writer)).print(root)
def f = new File(project.properties['outputFile'])
def f = new File(outputFile)
f.write(writer.toString())
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
def root = new XmlParser().parse(project.properties['inputFile'])
def root = new XmlParser().parse(inputFile)

/**
* Fix logging: optionally remove CONSOLE handler and set a specific log file
Expand All @@ -8,7 +8,7 @@ def logHandlers = root.profile.subsystem.'root-logger'.handlers[0]
def consoleHandler = logHandlers.find{it.@name == 'CONSOLE'}
if (!project.properties['enableServerLoggingToConsole']) logHandlers.remove(consoleHandler)
def file = root.profile.subsystem.'periodic-rotating-file-handler'.file[0]
file.attributes()['path'] = project.properties['serverLog']
file.attributes()['path'] = serverLog

/**
* Add a security-domain block like this:
Expand All @@ -30,7 +30,7 @@ def securityDomains = null
for (item in subsystems) {
if (item.name().getNamespaceURI().contains("urn:jboss:domain:security:")) {
for (element in item) {
if (element.name().getLocalPart().equals("security-domains")) {
if (element.name().getLocalPart() == 'security-domains') {
securityDomains = element
}
}
Expand All @@ -41,8 +41,8 @@ def securityDomain = securityDomains.appendNode('security-domain', ['name':'JBos
def authentication = securityDomain.appendNode('authentication')
def loginModule = authentication.appendNode('login-module', ['code':'UsersRoles','flag':'required'])
loginModule.appendNode('module-option', ['name':'unauthenticatedIdentity','value':'anonymous'])
loginModule.appendNode('module-option', ['name':'usersProperties','value':project.properties['usersPropFile']])
loginModule.appendNode('module-option', ['name':'rolesProperties','value':project.properties['rolesPropFile']])
loginModule.appendNode('module-option', ['name':'usersProperties','value':usersPropFile])
loginModule.appendNode('module-option', ['name':'rolesProperties','value':rolesPropFile])

/**
* Save the configuration to a new file
Expand All @@ -51,5 +51,5 @@ loginModule.appendNode('module-option', ['name':'rolesProperties','value':projec
def writer = new StringWriter()
writer.println('<?xml version="1.0" encoding="UTF-8"?>')
new XmlNodePrinter(new PrintWriter(writer)).print(root)
def f = new File(project.properties['outputFile'])
def f = new File(outputFile)
f.write(writer.toString())
Loading

0 comments on commit c21eb55

Please sign in to comment.