1

I am using license:aggregate-add-third-party to generate the THIRD-PARTY.txt file with the license details of all the dependencies. that works without any issue.

I also have purchased licenses for couple of Javascript libraries. I want to include the details of these javascript libraries into the THIRD-PARTY.txt file which i generated via pom call using maven license plugin.

Is there any way in the maven license plugin to include extra details of some external licenses?

UserASR
  • 2,015
  • 4
  • 24
  • 47

2 Answers2

1

Yes, this can be done. Inside pom.xml you add:

<configuration>
    <fileTemplate>${project.basedir}/src/main/resources/template.ftl</fileTemplate>
</configuration>

and then create file template.ftl into resources dir with following contents:

<#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>
List of third-party dependencies:

<#list dependencyMap as e>
<#assign project = e.getKey()/>
<#assign licenses = e.getValue()/>
${licenseFormat(licenses)} ${artifactFormat(project)}
</#list>

They you add your own info to this file (to the end). The file is a Freemarker template.

Master Drools
  • 728
  • 6
  • 18
0

The only solution i have is to perform a sed on the THIRD-PARTY.txt file to add additional license deatils.

UserASR
  • 2,015
  • 4
  • 24
  • 47