Created
December 9, 2015 21:24
-
-
Save williamchan/ebe74ecf59df73580c24 to your computer and use it in GitHub Desktop.
Format for third-party file returned by License Maven Plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#-- For formatting third-party file returned by License Maven Plugin. | |
Format is semicolon-delimited: license; name; groupId; artifactId; version; url | |
--> | |
<#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') > -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> | |
<#list dependencyMap as e> | |
<#assign project = e.getKey()/> | |
<#assign licenses = e.getValue()/> | |
${licenseFormat(licenses)} ${artifactFormat(project)} | |
</#list> | |
</#if> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment