Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Commit

Permalink
template for license as CSV
Browse files Browse the repository at this point in the history
  • Loading branch information
matthesrieke committed Jan 8, 2014
1 parent 924d4dc commit 29607d3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
37 changes: 37 additions & 0 deletions misc/licenses/license-as-csv.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<#-- To render the third-party file.
Available context :
- dependencyMap a collection of Map.Entry with
key are dependencies (as a MavenProject) (from the maven project)
values are licenses of each dependency (array of string)
- licenseMap a collection of Map.Entry with
key are licenses of each dependency (array of string)
values are all dependencies using this license
-->
<#function licenseFormat licenses>
<#assign result = ""/>
<#list licenses as license>
<#assign result = result + " (" +license + ")"/>
</#list>
<#assign result = result + "; "/>
<#return result>
</#function>
<#function artifactFormat p>
<#if p.name?index_of('Unnamed') &gt; -1>
<#return p.artifactId + "; " + p.groupId + ":" + p.artifactId + ":" + p.version + "; " + (p.url!"no url defined")>
<#else>
<#return p.name + "; " + p.groupId + ":" + p.artifactId + ":" + p.version + "; " + (p.url!"no url defined")>
</#if>
</#function>

<#if dependencyMap?size == 0>
The project has no dependencies.
<#else>
Lists of ${dependencyMap?size} third-party dependencies.
<#list dependencyMap as e>
<#assign project = e.getKey()/>
<#assign licenses = e.getValue()/>
${licenseFormat(licenses)} ${artifactFormat(project)}
</#list>
</#if>
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,7 @@
<version>1.5</version>
<configuration>
<useMissingFile>true</useMissingFile>
<!--<fileTemplate>misc/licenses/license-as-csv.ftl</fileTemplate>-->
</configuration>
<executions>
<execution>
Expand Down

0 comments on commit 29607d3

Please sign in to comment.