Skip to content

Commit

Permalink
Fix distribution licenses (#1525)
Browse files Browse the repository at this point in the history
It's really painful to have to rename the file whenever a dependency is upgraded, so enhance support for various licenses.
  • Loading branch information
gnodet committed May 17, 2024
1 parent de4e335 commit ac4debe
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 73 deletions.
17 changes: 11 additions & 6 deletions apache-maven/src/main/appended-resources/META-INF/LICENSE.vm
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ subject to the terms and conditions of the following licenses:
#* *##set ( $spdx = 'EPL-1.0' )
#* *##elseif ( $license.url.contains( "www.apache.org/licenses/LICENSE-2.0" ) )
#* *##set ( $spdx = 'Apache-2.0' )
#* *##elseif ( $license.name == "BSD-2-Clause" || $license.name == "The BSD 2-Clause License"
|| $license.url.contains("www.opensource.org/licenses/bsd-license") )
#* *##set ( $spdx = 'BSD-2-Clause' )
#* *##elseif ( $license.name == "BSD-3-Clause"
|| $license.url.contains("opensource.org/licenses/BSD-3-Clause") )
#* *##set ( $spdx = 'BSD-3-Clause' )
#* *##elseif ( $license.name == "Public Domain" )
#* *##set ( $spdx = 'Public-Domain' )
#* *##elseif ( $license.name == "CDDL + GPLv2 with classpath exception" )
#* *##set ( $spdx = 'CDDL+GPLv2-with-classpath-exception' )
#* *##else
#* *### unrecognized license will require analysis to know obligations
#* *##set ( $spdx = 'unrecognized' )
Expand All @@ -60,12 +70,7 @@ subject to the terms and conditions of the following licenses:
#* *###
#* *### copy license file to lib/$artifactId.license
#* *##set ( $licFile = $directory + '/' + $project.artifact.artifactId + '.license' )
#* *##if ( $spdx == "MIT" || $spdx == "unrecognized" )
#* *### MIT license contains date and copyright that makes the file specific to each artifact
#* *##set ( $downloaded = $locator.getResourceAsFile( "licenses/${spdx}-${project.artifact.artifactId}-${project.artifact.version}.txt", "licenses/${licFile}" ) )
#* *##else
#* *##set ( $downloaded = $locator.getResourceAsFile( "licenses/${spdx}.txt", "licenses/${licFile}" ) )
#* *##end
#* *##set ( $downloaded = $locator.getResourceAsFile( "licenses/${spdx}.txt", "licenses/${licFile}" ) )

#* *### add dependency info to output

Expand Down
24 changes: 24 additions & 0 deletions apache-maven/src/main/appended-resources/licenses/BSD-2-Clause.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Copyright <YEAR> <COPYRIGHT HOLDER>

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
“AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 changes: 28 additions & 0 deletions apache-maven/src/main/appended-resources/licenses/BSD-3-Clause.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Copyright <YEAR> <COPYRIGHT HOLDER>

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
“AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Copyright (c) 2004-2023 QOS.ch
All rights reserved.
Copyright <YEAR> <COPYRIGHT HOLDER>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit ac4debe

Please sign in to comment.