Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
许可证maven插件第三方许可证FreeMarker模板中需要哪些数据?_Maven_Licensing_License Maven Plugin - Fatal编程技术网

许可证maven插件第三方许可证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

我正在使用生成一个列表。根据文档,我可以使用自定义FreeMarker模板来使用格式化文件,但是没有关于将传递到FreeMarker模板的数据的文档。上有一个指向现有模板的链接,但该链接已断开。

经过搜索,我找到了:

。。。
该项目没有依赖项。
${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') &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>