diff --git a/distribution/adapters/as7-eap6-adapter/eap6-adapter-zip/assembly.xml b/distribution/adapters/as7-eap6-adapter/eap6-adapter-zip/assembly.xml index 96ea486c75..dc6cfb3e40 100755 --- a/distribution/adapters/as7-eap6-adapter/eap6-adapter-zip/assembly.xml +++ b/distribution/adapters/as7-eap6-adapter/eap6-adapter-zip/assembly.xml @@ -52,6 +52,9 @@ src/main/resources/licenses/${product.slot} docs/licenses-${product.slot}-adapter + + licenses.xml + target/licenses diff --git a/distribution/adapters/as7-eap6-adapter/eap6-adapter-zip/pom.xml b/distribution/adapters/as7-eap6-adapter/eap6-adapter-zip/pom.xml index 7e4c5266d1..6bd3df4d91 100755 --- a/distribution/adapters/as7-eap6-adapter/eap6-adapter-zip/pom.xml +++ b/distribution/adapters/as7-eap6-adapter/eap6-adapter-zip/pom.xml @@ -90,35 +90,9 @@ - - maven-resources-plugin - - - licenses-copy-common - process-resources - - - - - org.codehaus.gmaven - groovy-maven-plugin - - - licenses-append-product - process-resources - - - - - org.codehaus.mojo - xml-maven-plugin - - - licenses-generate-html - process-resources - - + org.keycloak + keycloak-distribution-licenses-maven-plugin diff --git a/distribution/adapters/as7-eap6-adapter/eap6-adapter-zip/src/main/resources/licenses/common b/distribution/adapters/as7-eap6-adapter/eap6-adapter-zip/src/main/resources/licenses/common deleted file mode 120000 index 7293e4c95d..0000000000 --- a/distribution/adapters/as7-eap6-adapter/eap6-adapter-zip/src/main/resources/licenses/common +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../feature-packs/server-feature-pack/src/main/resources/licenses/common \ No newline at end of file diff --git a/distribution/adapters/fuse-adapter-zip/assembly.xml b/distribution/adapters/fuse-adapter-zip/assembly.xml index fa9cd46682..bc0f148f1a 100644 --- a/distribution/adapters/fuse-adapter-zip/assembly.xml +++ b/distribution/adapters/fuse-adapter-zip/assembly.xml @@ -36,6 +36,9 @@ src/main/resources/licenses/${product.slot} docs/licenses-${product.slot}-adapter + + licenses.xml + target/licenses diff --git a/distribution/adapters/fuse-adapter-zip/pom.xml b/distribution/adapters/fuse-adapter-zip/pom.xml index a6950c3f2c..fdb345aa71 100644 --- a/distribution/adapters/fuse-adapter-zip/pom.xml +++ b/distribution/adapters/fuse-adapter-zip/pom.xml @@ -168,35 +168,9 @@ - - maven-resources-plugin - - - licenses-copy-common - process-resources - - - - - org.codehaus.gmaven - groovy-maven-plugin - - - licenses-append-product - process-resources - - - - - org.codehaus.mojo - xml-maven-plugin - - - licenses-generate-html - process-resources - - + org.keycloak + keycloak-distribution-licenses-maven-plugin diff --git a/distribution/adapters/fuse-adapter-zip/src/main/resources/licenses/common b/distribution/adapters/fuse-adapter-zip/src/main/resources/licenses/common deleted file mode 120000 index 559fec1d1e..0000000000 --- a/distribution/adapters/fuse-adapter-zip/src/main/resources/licenses/common +++ /dev/null @@ -1 +0,0 @@ -../../../../../../feature-packs/server-feature-pack/src/main/resources/licenses/common \ No newline at end of file diff --git a/distribution/adapters/js-adapter-zip/assembly.xml b/distribution/adapters/js-adapter-zip/assembly.xml index e30752e35a..01d555b8df 100755 --- a/distribution/adapters/js-adapter-zip/assembly.xml +++ b/distribution/adapters/js-adapter-zip/assembly.xml @@ -39,6 +39,9 @@ src/main/resources/licenses/${product.slot} docs/licenses-${product.slot}-adapter + + licenses.xml + target/licenses diff --git a/distribution/adapters/js-adapter-zip/pom.xml b/distribution/adapters/js-adapter-zip/pom.xml index ebab8696b1..67f67697c3 100755 --- a/distribution/adapters/js-adapter-zip/pom.xml +++ b/distribution/adapters/js-adapter-zip/pom.xml @@ -83,35 +83,9 @@ - - maven-resources-plugin - - - licenses-copy-common - process-resources - - - - - org.codehaus.gmaven - groovy-maven-plugin - - - licenses-append-product - process-resources - - - - - org.codehaus.mojo - xml-maven-plugin - - - licenses-generate-html - process-resources - - + org.keycloak + keycloak-distribution-licenses-maven-plugin diff --git a/distribution/adapters/js-adapter-zip/src/main/resources/licenses/common b/distribution/adapters/js-adapter-zip/src/main/resources/licenses/common deleted file mode 120000 index 559fec1d1e..0000000000 --- a/distribution/adapters/js-adapter-zip/src/main/resources/licenses/common +++ /dev/null @@ -1 +0,0 @@ -../../../../../../feature-packs/server-feature-pack/src/main/resources/licenses/common \ No newline at end of file diff --git a/distribution/adapters/wildfly-adapter/assembly.xml b/distribution/adapters/wildfly-adapter/assembly.xml index 5f0646282c..69b8728bfd 100755 --- a/distribution/adapters/wildfly-adapter/assembly.xml +++ b/distribution/adapters/wildfly-adapter/assembly.xml @@ -70,6 +70,9 @@ src/main/resources/licenses/${product.slot} docs/licenses-${product.slot}-adapter + + licenses.xml + target/licenses diff --git a/distribution/adapters/wildfly-adapter/pom.xml b/distribution/adapters/wildfly-adapter/pom.xml index edf58f123c..68c15cfdb5 100644 --- a/distribution/adapters/wildfly-adapter/pom.xml +++ b/distribution/adapters/wildfly-adapter/pom.xml @@ -80,35 +80,9 @@ - - maven-resources-plugin - - - licenses-copy-common - process-resources - - - - - org.codehaus.gmaven - groovy-maven-plugin - - - licenses-append-product - process-resources - - - - - org.codehaus.mojo - xml-maven-plugin - - - licenses-generate-html - process-resources - - + org.keycloak + keycloak-distribution-licenses-maven-plugin diff --git a/distribution/adapters/wildfly-adapter/src/main/resources/licenses/common b/distribution/adapters/wildfly-adapter/src/main/resources/licenses/common deleted file mode 120000 index 559fec1d1e..0000000000 --- a/distribution/adapters/wildfly-adapter/src/main/resources/licenses/common +++ /dev/null @@ -1 +0,0 @@ -../../../../../../feature-packs/server-feature-pack/src/main/resources/licenses/common \ No newline at end of file diff --git a/distribution/feature-packs/server-feature-pack/assembly.xml b/distribution/feature-packs/server-feature-pack/assembly.xml index e18d383652..c93393873d 100644 --- a/distribution/feature-packs/server-feature-pack/assembly.xml +++ b/distribution/feature-packs/server-feature-pack/assembly.xml @@ -60,6 +60,9 @@ src/main/resources/licenses/${product.slot} content/docs/licenses-${product.slot} + + licenses.xml + target/licenses diff --git a/distribution/feature-packs/server-feature-pack/pom.xml b/distribution/feature-packs/server-feature-pack/pom.xml index f306277e24..73f7da9242 100644 --- a/distribution/feature-packs/server-feature-pack/pom.xml +++ b/distribution/feature-packs/server-feature-pack/pom.xml @@ -767,38 +767,9 @@ - - - maven-resources-plugin - - - licenses-copy-common - process-resources - - - - - - org.codehaus.gmaven - groovy-maven-plugin - - - licenses-append-product - process-resources - - - - - - org.codehaus.mojo - xml-maven-plugin - - - licenses-generate-html - process-resources - - + org.keycloak + keycloak-distribution-licenses-maven-plugin diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/licenses/common/append-product-licenses.groovy b/distribution/feature-packs/server-feature-pack/src/main/resources/licenses/common/append-product-licenses.groovy deleted file mode 100644 index 00e6d4d77c..0000000000 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/licenses/common/append-product-licenses.groovy +++ /dev/null @@ -1,60 +0,0 @@ -import java.nio.file.FileSystem -import java.nio.file.FileSystems -import java.nio.file.Files -import java.nio.file.Path -import java.nio.file.attribute.PosixFilePermissions - -import groovy.xml.XmlUtil - -// Insert nodes into the xml file for the filtered dependencies in the active -// maven project. Also create individual license files for the new xml nodes, -// by copying one full copy, and symlinks to that copy for the rest. - -FileSystem fs = FileSystems.default - -Path licensesXmlFile = fs.getPath(properties['xmlFile']) -log.info("File ${properties['licenseFile']} will be copied for use as common individual license file") -Node root = new XmlParser().parse(licensesXmlFile.toFile()) -Node dependencies = root.dependencies[0] - -Path licenseFileRoot = licensesXmlFile.parent -Path licenseFile = null - -def matched = false -session.currentProject.dependencyArtifacts.toSorted().each { artifact -> - if (artifact.groupId == properties['groupId']) { - matched = true - - def dependency = dependencies.appendNode('dependency') - dependency.appendNode('groupId', artifact.groupId) - dependency.appendNode('artifactId', artifact.artifactId) - dependency.appendNode('version', artifact.version) - def licenses = dependency.appendNode('licenses') - def license = licenses.appendNode('license') - license.appendNode('name', properties['licenseName']) - license.appendNode('url', properties['licenseUrl']) - - def newFilename = "${artifact.groupId},${artifact.artifactId},${artifact.version},${properties['licenseName']}.txt" - Path newFile = licenseFileRoot.resolve(newFilename) - if (licenseFile == null) { - log.info("==> ${newFilename}") - Path original = fs.getPath(properties['licenseFile']) - Files.copy(original, newFile) - // Drop any weird mode setting the original file might have - Files.setPosixFilePermissions(newFile, PosixFilePermissions.fromString("rw-rw-r--")) - licenseFile = newFile - } else { - log.info(" -> ${newFilename}") - Files.createSymbolicLink(newFile, licenseFile.fileName); - } - } -} - -if (!matched) { - fail("No project direct dependencies matched groupId ${properties['groupId']}") -} - -log.info("Updating XML ${properties['xmlFile']}") -licensesXmlFile.withWriter("utf-8") { writer -> - XmlUtil.serialize(root, writer) -} diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/licenses/common/keycloak-components-license.html b/distribution/feature-packs/server-feature-pack/src/main/resources/licenses/common/keycloak-components-license.html deleted file mode 120000 index 932b8d9e9b..0000000000 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/licenses/common/keycloak-components-license.html +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../../License.html \ No newline at end of file diff --git a/distribution/licenses-common/assembly.xml b/distribution/licenses-common/assembly.xml new file mode 100644 index 0000000000..55ec80953f --- /dev/null +++ b/distribution/licenses-common/assembly.xml @@ -0,0 +1,45 @@ + + + + licenses-common + + + zip + + + ${artifactId} + + + + src/main/resources + + + ** + + + + + + + ../../License.html + keycloak-components-license.html + 0664 + + + + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/licenses/common/download-license-files.sh b/distribution/licenses-common/download-license-files.sh similarity index 100% rename from distribution/feature-packs/server-feature-pack/src/main/resources/licenses/common/download-license-files.sh rename to distribution/licenses-common/download-license-files.sh diff --git a/distribution/licenses-common/pom.xml b/distribution/licenses-common/pom.xml new file mode 100644 index 0000000000..fdac51fd99 --- /dev/null +++ b/distribution/licenses-common/pom.xml @@ -0,0 +1,46 @@ + + + + 4.0.0 + + keycloak-distribution-parent + org.keycloak + 3.4.1.Final-SNAPSHOT + + + keycloak-distribution-licenses-common + jar + Keycloak Distribution Licenses Common + + + + + keycloak-licenses-common + ../../ + + License.html + + + + keycloak-licenses-common + src/main/resources + + + + + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/licenses/common/licenses.css b/distribution/licenses-common/src/main/resources/licenses.css similarity index 100% rename from distribution/feature-packs/server-feature-pack/src/main/resources/licenses/common/licenses.css rename to distribution/licenses-common/src/main/resources/licenses.css diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/licenses/common/licenses.xsl b/distribution/licenses-common/src/main/resources/licenses.xsl similarity index 100% rename from distribution/feature-packs/server-feature-pack/src/main/resources/licenses/common/licenses.xsl rename to distribution/licenses-common/src/main/resources/licenses.xsl diff --git a/distribution/maven-plugins/licenses-processor/pom.xml b/distribution/maven-plugins/licenses-processor/pom.xml new file mode 100644 index 0000000000..02ceaa03cc --- /dev/null +++ b/distribution/maven-plugins/licenses-processor/pom.xml @@ -0,0 +1,53 @@ + + + + 4.0.0 + + keycloak-distribution-maven-plugins-parent + org.keycloak + 3.4.1.Final-SNAPSHOT + + + keycloak-distribution-licenses-maven-plugin + maven-plugin + Keycloak Licenses Processor Maven Plugin + Performs multiple operations on a license xml to produce release-ready files + + + + org.keycloak + keycloak-distribution-licenses-common + ${project.version} + runtime + + + + + + + org.codehaus.gmavenplus + gmavenplus-plugin + + + org.apache.maven.plugins + maven-plugin-plugin + + + + + diff --git a/distribution/maven-plugins/licenses-processor/src/main/groovy/LicenseProcessMojo.groovy b/distribution/maven-plugins/licenses-processor/src/main/groovy/LicenseProcessMojo.groovy new file mode 100644 index 0000000000..d015d4afa3 --- /dev/null +++ b/distribution/maven-plugins/licenses-processor/src/main/groovy/LicenseProcessMojo.groovy @@ -0,0 +1,124 @@ +import java.nio.file.FileSystem +import java.nio.file.FileSystems +import java.nio.file.Files +import java.nio.file.Path +import java.nio.file.StandardCopyOption +import java.nio.file.attribute.PosixFilePermissions +import javax.xml.transform.Transformer +import javax.xml.transform.TransformerFactory +import javax.xml.transform.stream.StreamResult +import javax.xml.transform.stream.StreamSource + +import org.apache.maven.plugin.AbstractMojo +import org.apache.maven.plugins.annotations.LifecyclePhase +import org.apache.maven.plugins.annotations.Mojo +import org.apache.maven.plugins.annotations.Parameter +import org.apache.maven.project.MavenProject + +import groovy.xml.XmlUtil + +@Mojo(name="process", defaultPhase=LifecyclePhase.PROCESS_RESOURCES) +class LicenseProcessMojo extends AbstractMojo { + + @Parameter(defaultValue='${project}', readonly=true) + private MavenProject project + + void execute() { + FileSystem fs = FileSystems.default + + // Property configuration with defaults + def outputDirectoryRaw = project.properties['outputDirectory'] ?: "${project.build.directory}/licenses" + def xmlFileSource = project.properties['xmlFileSource'] ?: "${project.basedir}/src/main/resources/licenses/${project.properties['product.slot']}/licenses.xml" + def licenseName = project.properties['licenseName'] ?: "Apache Software License 2.0" + def licenseUrl = project.properties['licenseUrl'] ?: "https://raw.githubusercontent.com/keycloak/keycloak/${project.version}/License.html" + def groupId = project.properties['groupId'] ?: "org.keycloak" + + Path outputDirectory = fs.getPath(outputDirectoryRaw) + Files.createDirectories(outputDirectory) + + // Load license data XML for modification + Path licensesXmlFile = fs.getPath(xmlFileSource) + Node root = new XmlParser().parse(licensesXmlFile.toFile()) + Node dependencies = root.dependencies[0] + + // For each direct dependency, append those matching the groupId filter + log.info("Appending first party dependency license data") + Path licenseFileRoot = outputDirectory + Path licenseFile = null + def matched = false + project.dependencyArtifacts.toSorted().each { artifact -> + if (artifact.groupId == groupId) { + matched = true + + def dependency = dependencies.appendNode('dependency') + dependency.appendNode('groupId', artifact.groupId) + dependency.appendNode('artifactId', artifact.artifactId) + dependency.appendNode('version', artifact.version) + def licenses = dependency.appendNode('licenses') + def license = licenses.appendNode('license') + license.appendNode('name', licenseName) + license.appendNode('url', licenseUrl) + + def newFilename = "${artifact.groupId},${artifact.artifactId},${artifact.version},${licenseName}.txt" + Path newFile = licenseFileRoot.resolve(newFilename) + if (licenseFile == null) { + log.info("==> ${newFilename}") + InputStream original = this.class.getResourceAsStream("keycloak-licenses-common/License.html") + Files.copy(original, newFile, StandardCopyOption.REPLACE_EXISTING) + licenseFile = newFile + } else { + log.info(" -> ${newFilename}") + try { + Files.createSymbolicLink(newFile, licenseFile.fileName); + } catch ( IOException e ) { + log.debug("Can't create symbolic link, assuming due to lack of OS support") + // Assume we're on Windows and the user doesn't have + // SeCreateSymbolicLinkPrivilege and/or NTFS. Fallback to + // writing something similar to what git would with + // core.symlinks disabled. + newFile.withWriter('utf-8') { writer -> + writer.writeLine licenseFile.fileName.toString() + } + } + } + } + } + if (!matched) { + fail("No project direct dependencies matched groupId ${groupId}") + } + + // Write out XML with appended data to new path + Path outputLicensesXmlFile = outputDirectory.resolve("licenses.xml") + log.info("Writing XML to ${outputLicensesXmlFile}") + outputLicensesXmlFile.withWriter("utf-8") { writer -> + XmlUtil.serialize(root, writer) + } + + // Copy misc. files from the resource jar + ["licenses.xsl", "licenses.css"].each { filename -> + InputStream input = this.class.getResourceAsStream("keycloak-licenses-common/${filename}") + Path out = outputDirectory.resolve(filename) + Files.copy(input, out, StandardCopyOption.REPLACE_EXISTING) + } + + // Generate HTML by applying XSLT to XML. Have to switch to the Java + // libraries for XSLT support. + Path outputHtmlFile = outputDirectory.resolve("licenses.html") + log.info("Writing transformed HTML to ${outputHtmlFile}") + Transformer transformer + L:{ + InputStream input = this.class.getResourceAsStream("keycloak-licenses-common/licenses.xsl") + transformer = TransformerFactory.newInstance().newTemplates(new StreamSource(input)).newTransformer() + } + transformer.setParameter("productname", project.properties['product.name.full']) + transformer.setParameter("version", project.version) + outputLicensesXmlFile.withInputStream() { inStream -> + def input = new StreamSource(inStream) + outputHtmlFile.withOutputStream() { outStream -> + def out = new StreamResult(outStream) + transformer.transform(input, out) + } + } + } + +} diff --git a/distribution/maven-plugins/pom.xml b/distribution/maven-plugins/pom.xml new file mode 100644 index 0000000000..5b4e38b085 --- /dev/null +++ b/distribution/maven-plugins/pom.xml @@ -0,0 +1,105 @@ + + + + 4.0.0 + + keycloak-distribution-parent + org.keycloak + 3.4.1.Final-SNAPSHOT + + + keycloak-distribution-maven-plugins-parent + pom + Keycloak Distribution Maven Plugins Parent + + + + org.codehaus.groovy + groovy-all + 2.4.12 + + + org.apache.maven + maven-plugin-api + 3.3.9 + provided + + + org.apache.maven + maven-core + 3.3.9 + provided + + + org.apache.maven.plugin-tools + maven-plugin-annotations + 3.4 + provided + + + + + licenses-processor + + + + + + + org.codehaus.gmavenplus + gmavenplus-plugin + 1.6 + + + compile-groovy + + addSources + addTestSources + generateStubs + compile + removeStubs + generateTestStubs + compileTests + removeTestStubs + + + + + + org.apache.maven.plugins + maven-plugin-plugin + + + generate-descriptor + + descriptor + + + + generate-help + + helpmojo + + + + + + + + + diff --git a/distribution/pom.xml b/distribution/pom.xml index 6be6ce8de4..ba73b2a27c 100755 --- a/distribution/pom.xml +++ b/distribution/pom.xml @@ -39,6 +39,8 @@ adapters saml-adapters feature-packs + licenses-common + maven-plugins server-dist server-overlay diff --git a/distribution/saml-adapters/as7-eap6-adapter/eap6-adapter-zip/assembly.xml b/distribution/saml-adapters/as7-eap6-adapter/eap6-adapter-zip/assembly.xml index 8e1e5d0248..ed1631740e 100755 --- a/distribution/saml-adapters/as7-eap6-adapter/eap6-adapter-zip/assembly.xml +++ b/distribution/saml-adapters/as7-eap6-adapter/eap6-adapter-zip/assembly.xml @@ -49,6 +49,9 @@ src/main/resources/licenses/${product.slot} docs/licenses-${product.slot}-adapter + + licenses.xml + target/licenses diff --git a/distribution/saml-adapters/as7-eap6-adapter/eap6-adapter-zip/pom.xml b/distribution/saml-adapters/as7-eap6-adapter/eap6-adapter-zip/pom.xml index 04624c3cd9..660b9b79b0 100755 --- a/distribution/saml-adapters/as7-eap6-adapter/eap6-adapter-zip/pom.xml +++ b/distribution/saml-adapters/as7-eap6-adapter/eap6-adapter-zip/pom.xml @@ -90,35 +90,9 @@ - - maven-resources-plugin - - - licenses-copy-common - process-resources - - - - - org.codehaus.gmaven - groovy-maven-plugin - - - licenses-append-product - process-resources - - - - - org.codehaus.mojo - xml-maven-plugin - - - licenses-generate-html - process-resources - - + org.keycloak + keycloak-distribution-licenses-maven-plugin diff --git a/distribution/saml-adapters/as7-eap6-adapter/eap6-adapter-zip/src/main/resources/licenses/common b/distribution/saml-adapters/as7-eap6-adapter/eap6-adapter-zip/src/main/resources/licenses/common deleted file mode 120000 index 7293e4c95d..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/eap6-adapter-zip/src/main/resources/licenses/common +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../feature-packs/server-feature-pack/src/main/resources/licenses/common \ No newline at end of file diff --git a/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/assembly.xml b/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/assembly.xml index 9ff9e623f5..41ffac3755 100755 --- a/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/assembly.xml +++ b/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/assembly.xml @@ -50,6 +50,9 @@ src/main/resources/licenses/${product.slot} docs/licenses-${product.slot}-adapter + + licenses.xml + target/licenses diff --git a/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/pom.xml b/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/pom.xml index 1bb3912cac..d8317bcb13 100755 --- a/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/pom.xml +++ b/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/pom.xml @@ -87,35 +87,9 @@ - - maven-resources-plugin - - - licenses-copy-common - process-resources - - - - - org.codehaus.gmaven - groovy-maven-plugin - - - licenses-append-product - process-resources - - - - - org.codehaus.mojo - xml-maven-plugin - - - licenses-generate-html - process-resources - - + org.keycloak + keycloak-distribution-licenses-maven-plugin diff --git a/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/src/main/resources/licenses/common b/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/src/main/resources/licenses/common deleted file mode 120000 index 7293e4c95d..0000000000 --- a/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/src/main/resources/licenses/common +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../feature-packs/server-feature-pack/src/main/resources/licenses/common \ No newline at end of file diff --git a/misc/DependencyLicenseInformation.md b/misc/DependencyLicenseInformation.md index 8a5ce1bf00..404e964387 100644 --- a/misc/DependencyLicenseInformation.md +++ b/misc/DependencyLicenseInformation.md @@ -84,7 +84,7 @@ After modifying a license XML, you must run `download-license-files.sh` against Example command line: ``` -$ common/download-license-files.sh rh-sso/licenses.xml +$ distribution/licenses-common/download-license-files.sh distribution/feature-packs/server-feature-pack/src/main/resources/licenses/rh-sso/licenses.xml ``` The following shell commands must be available for the script to work: diff --git a/pom.xml b/pom.xml index 29e4feb578..62065df8df 100755 --- a/pom.xml +++ b/pom.xml @@ -1535,112 +1535,17 @@ frontend-maven-plugin ${frontend.plugin.version} - - maven-resources-plugin + org.keycloak + keycloak-distribution-licenses-maven-plugin + ${project.version} - licenses-copy-common + process-licenses - copy-resources + process - - none - - ${project.build.directory}/licenses - - - - ${project.basedir}/src/main/resources/licenses/common - - licenses.xsl - licenses.css - - - - - ${project.basedir}/src/main/resources/licenses/${product.slot} - - licenses.xml - - - - - - - - - - org.codehaus.gmaven - groovy-maven-plugin - 2.0 - - - org.codehaus.groovy - groovy-all - 2.4.12 - - - - - licenses-append-product - - execute - - - none - - ${project.basedir}/src/main/resources/licenses/common/append-product-licenses.groovy - - org.keycloak - ${project.build.directory}/licenses/licenses.xml - Apache Software License 2.0 - https://raw.githubusercontent.com/keycloak/keycloak/${project.version}/License.html - ${project.basedir}/src/main/resources/licenses/common/keycloak-components-license.html - - - - - - - org.codehaus.mojo - xml-maven-plugin - 1.0.1 - - - licenses-generate-html - - transform - - - none - - - - ${project.build.directory}/licenses - - licenses.xml - - ${project.build.directory}/licenses/licenses.xsl - ${project.build.directory}/licenses - - - .html - - - - - productname - ${product.name.full} - - - version - ${project.version} - - - - - + process-resources