Skip to content

Commit

Permalink
[JBEAP-25435] Add licenses to the prospero feature packs
Browse files Browse the repository at this point in the history
  • Loading branch information
spyrkob committed Aug 22, 2023
1 parent 4b88aa9 commit d46f371
Show file tree
Hide file tree
Showing 11 changed files with 1,079 additions and 741 deletions.
93 changes: 93 additions & 0 deletions dist/common/src/main/licenses/licenses.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<licenseSummary>
<dependencies>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>staxmapper</artifactId>
<licenses>
<license>
<name>GNU Lesser General Public License v2.1 or later</name>
<url>http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html</url>
<distribution>repo</distribution>
</license>
</licenses>
</dependency>
<dependency>
<groupId>org.wildfly.channel</groupId>
<artifactId>channel-core</artifactId>
<licenses>
<license>
<name>Apache License 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
</dependency>
<dependency>
<groupId>org.wildfly.channel</groupId>
<artifactId>maven-resolver</artifactId>
<licenses>
<license>
<name>Apache License 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
</dependency>
<dependency>
<groupId>org.wildfly.prospero</groupId>
<artifactId>prospero-cli</artifactId>
<licenses>
<license>
<name>Apache License 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
</dependency>
<dependency>
<groupId>org.wildfly.prospero</groupId>
<artifactId>prospero-common</artifactId>
<licenses>
<license>
<name>Apache License 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
</dependency>
<dependency>
<groupId>org.wildfly.prospero</groupId>
<artifactId>prospero-common</artifactId>
<licenses>
<license>
<name>Apache License 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
</dependency>
<dependency>
<groupId>org.wildfly.prospero</groupId>
<artifactId>prospero-metadata</artifactId>
<licenses>
<license>
<name>Apache License 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
</dependency>
<dependency>
<groupId>org.wildfly.prospero</groupId>
<artifactId>prospero-core</artifactId>
<licenses>
<license>
<name>Apache License 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
</dependency>
</dependencies>
</licenseSummary>
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="html" encoding="utf-8" standalone="no" media-type="text/html" />
<xsl:param name="version"/>
<xsl:param name="product.release.name"/>
<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz '" />
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ!'" />

<xsl:template match="/">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" href="licenses.css"/>
</head>
<body>
<h2><xsl:value-of select="$product.release.name"/><xsl:text> </xsl:text><xsl:value-of select="substring-before($version, '-')"/></h2>
<p>The following material has been provided for informational purposes only, and should not be relied upon or construed as a legal opinion or legal advice.</p>
<!-- Read matching templates -->
<table>
<tr>
<th>Package Group</th>
<th>Package Artifact</th>
<th>Package Version</th>
<th>Remote Licenses</th>
<th>Local Licenses</th>
</tr>
<xsl:for-each select="licenseSummary/dependencies/dependency">
<xsl:sort select="concat(groupId, '.', artifactId)"/>
<xsl:variable name="GAV" select="concat(groupId, ':', artifactId, ':', version)"/>
<xsl:variable name="countOfPrevious" select="count(preceding-sibling::*[(concat(groupId, ':', artifactId, ':', version) = $GAV)])"/>
<xsl:if test="$countOfPrevious = 0">
<tr>
<td><xsl:value-of select="groupId"/></td>
<td><xsl:value-of select="artifactId"/></td>
<td><xsl:value-of select="version"/></td>
<td>
<xsl:for-each select="licenses/license">
<xsl:choose>
<xsl:when test="name = 'Public Domain'">
<xsl:value-of select="name"/><br/>
</xsl:when>
<xsl:otherwise>
<a href="{./url}"><xsl:value-of select="name"/></a><br/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</td>
<td>
<xsl:for-each select="licenses/license">
<xsl:variable name="filename">
<xsl:call-template name="remap-local-filename">
<xsl:with-param name="name" select="name" />
</xsl:call-template>
</xsl:variable>
<a href="{$filename}"><xsl:value-of select="$filename"/></a><br/>
</xsl:for-each>
</td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>

<xsl:template name="remap-local-filename">
<xsl:param name="name"/>
<xsl:choose>
<xsl:when test="$name = 'BSD 2-clause &quot;Simplified&quot; License'">
<xsl:text>bsd 2-clause simplified license.html</xsl:text>
</xsl:when>
<xsl:when test="$name = 'BSD 3-Clause &quot;New&quot; or &quot;Revised&quot; License'">
<xsl:text>bsd 3-clause new or revised license.html</xsl:text>
</xsl:when>
<xsl:when test="$name = 'Creative Commons Attribution 2.5'">
<xsl:text>creative commons attribution 2.5.html</xsl:text>
</xsl:when>
<xsl:when test="$name = 'FSF All Permissive License'">
<xsl:text>fsf all permissive license.html</xsl:text>
</xsl:when>
<xsl:when test="$name = 'Indiana University Extreme! Lab Software License 1.1.1'">
<xsl:text>indiana university extreme lab software license 1.1.1.html</xsl:text>
</xsl:when>
<xsl:when test="$name = 'MIT-0'">
<xsl:text>mit-0.html</xsl:text>
</xsl:when>
<xsl:when test="$name = 'Mozilla Public License 2.0'">
<xsl:text>mozilla public license 2.0.html</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(translate($name, $uppercase, $lowercase), '.txt')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- foobar -->
</xsl:stylesheet>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<package-spec xmlns="urn:jboss:galleon:package:2.0" name="docs.licenses"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" ?>

<tasks xmlns="urn:wildfly:wildfly-feature-pack-tasks:3.1">
<transform stylesheet="docs/licenses/prospero-licenses.xsl" src="docs/licenses/${prospero.dist.name}-feature-pack-licenses.xml" output="docs/licenses/${prospero.dist.name}-feature-pack-licenses.html" feature-pack-properties="true" phase="FINALIZING"/>
<delete path="docs/licenses/prospero-licenses.xsl"/>
<line-endings phase="FINALIZING">
<unix>
<filter pattern="docs?licenses?${prospero.dist.name}-feature-pack-licenses.html" include="true"/>
</unix>
</line-endings>
</tasks>
24 changes: 24 additions & 0 deletions dist/standalone-galleon-pack/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,30 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.wildfly.maven.plugins</groupId>
<artifactId>licenses-plugin</artifactId>
<inherited>false</inherited>
<executions>
<execution>
<id>update-licenses-xml</id>
<goals>
<goal>insert-versions</goal>
</goals>
<phase>process-resources</phase>
<configuration>
<generateVersionProperty>true</generateVersionProperty>
<sortByGroupIdAndArtifactId>true</sortByGroupIdAndArtifactId>
<licensesConfigFiles>
<licensesConfigFile>../common/src/main/licenses/licenses.xml</licensesConfigFile>
</licensesConfigFiles>
<licensesOutputFile>${project.build.directory}/resources/content/docs/licenses/${prospero.dist.name}-feature-pack-licenses.xml</licensesOutputFile>
<excludedGroups>org.prospero</excludedGroups>
<excludedArtifacts>prospero-dist-common</excludedArtifacts>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.wildfly.galleon-plugins</groupId>
<artifactId>wildfly-galleon-maven-plugin</artifactId>
Expand Down
3 changes: 2 additions & 1 deletion dist/standalone-galleon-pack/wildfly-feature-pack-build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<build xmlns="urn:wildfly:feature-pack-build:3.0" producer="org.wildfly.prospero:prospero-standalone-galleon-pack">
<build xmlns="urn:wildfly:feature-pack-build:3.2" producer="org.wildfly.prospero:prospero-standalone-galleon-pack">
<default-packages>
<package name="docs.licenses"/>
<package name="org.jboss.prospero"/>
<package name="org.jboss.prospero-dep"/>
</default-packages>
Expand Down
24 changes: 24 additions & 0 deletions dist/wildfly-galleon-pack/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,30 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.wildfly.maven.plugins</groupId>
<artifactId>licenses-plugin</artifactId>
<inherited>false</inherited>
<executions>
<execution>
<id>update-licenses-xml</id>
<goals>
<goal>insert-versions</goal>
</goals>
<phase>process-resources</phase>
<configuration>
<generateVersionProperty>true</generateVersionProperty>
<sortByGroupIdAndArtifactId>true</sortByGroupIdAndArtifactId>
<licensesConfigFiles>
<licensesConfigFile>../common/src/main/licenses/licenses.xml</licensesConfigFile>
</licensesConfigFiles>
<licensesOutputFile>${project.build.directory}/resources/packages/docs.licenses/content/docs/licenses/${prospero.dist.name}-feature-pack-licenses.xml</licensesOutputFile>
<excludedGroups>org.prospero</excludedGroups>
<excludedArtifacts>prospero-dist-common</excludedArtifacts>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.wildfly.galleon-plugins</groupId>
<artifactId>wildfly-galleon-maven-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
</dependency>
</dependencies>
<default-packages>
<package name="docs.licenses"/>
<package name="org.jboss.prospero"/>
<package name="org.jboss.prospero-dep"/>
</default-packages>
Expand Down
Loading

0 comments on commit d46f371

Please sign in to comment.