Skip to content

Commit

Permalink
[MNG-6771] simplified and documented script
Browse files Browse the repository at this point in the history
  • Loading branch information
hboutemy committed Nov 16, 2019
1 parent a9a3732 commit da54c28
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions apache-maven/src/main/appended-resources/META-INF/LICENSE.vm
Original file line number Diff line number Diff line change
Expand Up @@ -29,43 +29,42 @@ subject to the terms and conditions of the following licenses:
#**##foreach ( $license in $project.licenses)
#* *##set ( $groupId = $project.artifact.groupId )
#* *##if ( !$apacheMavenGroupIds.contains( $groupId ) )
#* *##set ( $artId = $project.artifact.artifactId )
#* *##set ( $url = $license.url )
#* *##set ( $spdx = false )
#* *##set ( $includeLicense = true )
#* *### advertise about each non-Maven dependency
#* *###
#* *### infer SPDX license code
#* *##if ( $license.name == "COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0" )
#* *##set ( $spdx = 'CDDL-1.0' )
#* *##end
#* *##if ( $MITLicenseNames.contains( $license.name ) )
#* *##elseif ( $MITLicenseNames.contains( $license.name ) )
#* *##set ( $spdx = 'MIT' )
#* *##end
#* *##if ( $license.name == "Eclipse Public License, Version 1.0" )
#* *##elseif ( $license.name == "Eclipse Public License, Version 1.0" )
#* *##set ( $spdx = 'EPL-1.0' )
#* *##end
#* *##if ( $license.url.contains( "www.apache.org/licenses/LICENSE-2.0" ) )
#* *##elseif ( $license.url.contains( "www.apache.org/licenses/LICENSE-2.0" ) )
#* *##set ( $spdx = 'ASL-2.0' )
#* *##else
#* *### unrecognized license will require analysis to know obligations
#* *##set ( $spdx = 'unrecognized' )
#* *##end
#* *###
#* *### fix project urls that are wrong in pom
#* *##if ( $project.url.startsWith( "http://www.eclipse.org/sisu/" ) )
#* *##set ( $project.url = 'https://www.eclipse.org/sisu/' )
#* *##elseif ( $project.url.startsWith( "https://github.com/google/guava/" ) )
#* *##set ( $project.url = 'https://github.com/google/guava/' )
#* *##elseif ( $project.url.startsWith( "https://github.com/google/guice/" ) )
#* *##set ( $project.url = 'https://github.com/google/guice/' )
#* *##end
#* *##if ( $includeLicense )
#* *##if ( $url || $spdx )
#* *##set ( $licFile = 'lib/' + $artId + '.license' )
#* *##if ( $spdx )
#* *##set ( $downloaded = $locator.getResourceAsFile( "licenses/${spdx}.txt", "licenses/${licFile}" ) )
#* *##else
#* *##set ( $downloaded = $locator.getResourceAsFile( $url, "licenses/${licFile}" ) )
#* *##end
#* *##end
#* *###
#* *### copy license file to lib/$artifactId.license
#* *##set ( $licFile = 'lib/' + $project.artifact.artifactId + '.license' )
#* *##set ( $downloaded = $locator.getResourceAsFile( "licenses/${spdx}.txt", "licenses/${licFile}" ) )
#* *### add dependency info to output

- lib/${project.artifact.artifactId}-${project.artifact.version}.jar: $project.artifact.toString().replace( ':eclipse-plugin:', ':jar:' )
$project.name
#if ( $project.url )Project URL: ${project.url}#end

License: $license.name#if ( $spdx ) ($spdx)#end#if ( $url ) $url ($licFile)#end
License: $license.name#if ( $spdx ) ($spdx)#end $license.url ($licFile)

#* *##end
#* *##end
#**##end
#end

0 comments on commit da54c28

Please sign in to comment.