-
Notifications
You must be signed in to change notification settings - Fork 21
/
third-party-file-csv.ftl
53 lines (48 loc) · 1.72 KB
/
third-party-file-csv.ftl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<#--
#%L
License Maven Plugin
%%
Copyright (C) 2012 Codehaus, Tony Chemit
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Lesser Public License for more details.
You should have received a copy of the GNU General Lesser Public
License along with this program. If not, see
<http://www.gnu.org/licenses/lgpl-3.0.html>.
#L%
-->
<#-- 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>
<#return p.groupId + ":" + p.artifactId + ";" + p.version + ";">
</#function>
<#if dependencyMap?size == 0>
The project has no dependencies.
<#else>
<#list dependencyMap as e>
<#assign project = e.getKey()/>
<#assign licenses = e.getValue()/>
${artifactFormat(project)}${licenseFormat(licenses)}
</#list>
</#if>