##
## Licensed to the Apache Software Foundation (ASF) under one
## or more contributor license agreements.  See the NOTICE file
## distributed with this work for additional information
## regarding copyright ownership.  The ASF licenses this file
## to you under the Apache License, Version 2.0 (the
## "License"); you may not use this file except in compliance
## with the License.  You may obtain a copy of the License at
##
##  http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing,
## software distributed under the License is distributed on an
## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
## KIND, either express or implied.  See the License for the
## specific language governing permissions and limitations
## under the License.
##


Apache Maven includes a number of components and libraries with separate 
copyright notices and license terms. Your use of those components are 
subject to the terms and conditions of the following licenses: 
##
#set ( $apacheMavenGroupIds = [ "org.apache.maven", "org.apache.maven.wagon", "org.apache.maven.resolver",
                                "org.apache.maven.shared" ] )
#set ( $MITLicenseNames = [ "MIT License", "MIT license", "The MIT License" ] )
#foreach ( $project in $projects )
#**##foreach ( $license in $project.licenses)
#*  *##set ( $groupId = $project.artifact.groupId )
#*  *##set ( $directory = 'lib' )
#*  *##if ( !$apacheMavenGroupIds.contains( $groupId ) )
#*    *### 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' )
#*    *##elseif ( $MITLicenseNames.contains( $license.name ) )
#*      *##set ( $spdx = 'MIT' )
#*    *##elseif ( $license.name == "Eclipse Public License, Version 1.0" )
#*      *##set ( $spdx = 'EPL-1.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
#*    *###
#*    *### Classworlds is in boot directory, not in lib
#*    *##if ( $project.artifact.artifactId == "plexus-classworlds" )
#*      *##set ( $directory = 'boot' )
#*    *##end
#*    *###
#*    *### copy license file to lib/$artifactId.license
#*    *##set ( $licFile = $directory + '/' + $project.artifact.artifactId + '.license' )
#*    *##if ( $spdx == "MIT" )
#*      *### 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
#*    *### add dependency info to output

- $directory/${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  $license.url ($licFile)

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