added support for set jdk for adapter container

This commit is contained in:
vramik 2015-12-18 13:40:00 +01:00
parent 57ea0a3b42
commit 19471d07b8
2 changed files with 59 additions and 40 deletions

View file

@ -127,60 +127,49 @@
</plugins>
</build>
</profile>
<!-- <profile>
<id>community</id>
<properties>
<adapter.libs.eap6>${containers.home}/keycloak-eap6-adapter-dist</adapter.libs.eap6>
</properties>
<profile>
<id>adapter-jdk</id>
<activation>
<property>
<name>adapter.jdk</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
<executions>
<execution>
<id>unpack-as7-and-adapter</id>
<phase>generate-resources</phase>
<id>add-java-home-to-arquillian-xml</id>
<phase>process-resources</phase>
<goals>
<goal>unpack</goal>
<goal>transform</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-dist</artifactId>
<version>${jboss.version}</version>
<type>zip</type>
<outputDirectory>${containers.home}</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-eap6-adapter-dist</artifactId>
<version>${project.version}</version>
<type>zip</type>
<outputDirectory>${adapter.libs.eap6}</outputDirectory>
</artifactItem>
</artifactItems>
<transformationSets>
<transformationSet>
<dir>${project.build.directory}/dependency</dir>
<includes>
<include>arquillian.xml</include>
</includes>
<stylesheet>src/main/xslt/arquillian_jdk.xsl</stylesheet>
<parameters>
<parameter>
<name>javaHome</name>
<value>${adapter.jdk}</value>
</parameter>
</parameters>
<outputDir>${project.build.directory}/dependency</outputDir>
</transformationSet>
</transformationSets>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-dist</artifactId>
<version>${jboss.version}</version>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-eap6-adapter-dist</artifactId>
<type>zip</type>
</dependency>
</dependencies>
</profile>-->
</profile>
<profile>
<id>adapter-libs-provided</id>
<activation>

View file

@ -0,0 +1,30 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xalan="http://xml.apache.org/xalan"
xmlns:a="http://jboss.org/schema/arquillian"
version="2.0"
exclude-result-prefixes="xalan a">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" xalan:indent-amount="4" standalone="no"/>
<xsl:strip-space elements="*"/>
<xsl:param name="javaHome"/>
<xsl:template match="//*[local-name()='container' and @qualifier='app-server-eap6']/*[local-name()='configuration']">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
<property name="javaHome">
<xsl:value-of select="$javaHome"/>
</property>
</xsl:copy>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>