许可证maven插件第三方许可证FreeMarker模板中需要哪些数据?
我正在使用生成一个列表。根据文档,我可以使用自定义FreeMarker模板来使用格式化文件,但是没有关于将传递到FreeMarker模板的数据的文档。上有一个指向现有模板的链接,但该链接已断开。经过搜索,我找到了:许可证maven插件第三方许可证FreeMarker模板中需要哪些数据?,maven,licensing,license-maven-plugin,Maven,Licensing,License Maven Plugin,我正在使用生成一个列表。根据文档,我可以使用自定义FreeMarker模板来使用格式化文件,但是没有关于将传递到FreeMarker模板的数据的文档。上有一个指向现有模板的链接,但该链接已断开。经过搜索,我找到了: 。。。 该项目没有依赖项。 ${dependencMap?size}第三方依赖项的列表。 ${licenseFormat(许可证)}${artifactFormat(项目)} 它使用这个 ... <#-- To render the third-party file. A
。。。
该项目没有依赖项。
${dependencMap?size}第三方依赖项的列表。
${licenseFormat(许可证)}${artifactFormat(项目)}
它使用这个
...
<#-- 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>
<#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>
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>