license-maven-plugin icon indicating copy to clipboard operation
license-maven-plugin copied to clipboard

licenseMergesUrl File Format for add-third-party

Open shubham-pandey95 opened this issue 2 years ago • 2 comments

The documentation doesn't provide any example for licenseMergesUrl file format when invoked via CLI. I have tried a text as well as properties file having the following value:

Apache 2.0|ASL, version 2|http://www.apache.org/licenses/LICENSE-2.0.txt|http://asm.ow2.org/license.html|The Apache License, Version 2.0|Apache License|Apache License Version 2|Apache License Version 2.0|Apache Software License - Version 2.0|Apache 2.0 License|Apache License 2.0|ASL|Apache 2|Apache-2.0|the Apache License, ASL Version 2.0|The Apache Software License, Version 2.0|Apache License, Version 2.0|Apache Public License 2.0
BSD|The BSD 3-Clause License|The BSD License|Modified BSD License|New BSD License|New BSD license|Two-clause BSD-style license|BSD licence|BSD New|The New BSD License|BSD 3-Clause|BSD 3-clause
MIT|MIT License|The MIT License
LGPL|LGPL, version 2.1|GNU Library or Lesser General Public License (LGPL) V2.1|GNU Lesser General Public License (LGPL), Version 2.1|GNU Lesser General Public License, Version 2.1|LGPL 2.1
CDDL|CDDL+GPL|CDDL+GPL License|CDDL + GPLv2 with classpath exception|CDDL License|CDDL 1.0|CDDL 1.1|COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0|Common Development and Distribution License (CDDL) v1.0
EPL|Eclipse Public License - Version 1.0
GPL|GPL2 w/ CPE|GPLv2+CE|GNU General Public Library

This doesn't produce the desired output as licenses are not merged. Can you please provide more information about the format of this file?

shubham-pandey95 avatar Aug 31 '21 21:08 shubham-pandey95

This doesn't produce the desired output as licenses are not merged

Are you sure the file is read at all? I had the same problem and thought the format is wrong. But the actual problem was that i specified a file path instead of an url for the property.

I figured it out after looking into the source code: https://github.com/mojohaus/license-maven-plugin/blob/01fd9a1c560fb608e721de0cb1673a29805a40cd/src/main/java/org/codehaus/mojo/license/AbstractAddThirdPartyMojo.java#L767-L776

and the UrlRequester.

To get the absoIute url to your project inside the pom you can use the project.basedir property. (i.e. file:///${project.basedir}/path/to/license.merges).

infeo avatar Apr 20 '22 09:04 infeo

Regardless of the used configuration property, the file format specification/example is missing.

tukez avatar Nov 13 '23 14:11 tukez