-
Notifications
You must be signed in to change notification settings - Fork 137
/
create_dependencies_list.sh
executable file
·43 lines (38 loc) · 1.79 KB
/
create_dependencies_list.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
#*******************************************************************************
# Copyright (c) 2021, 2022 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0
#
# SPDX-License-Identifier: EPL-2.0
#*******************************************************************************
DASH_LICENSE_JAR=$1
shift
if [ ! -f "$DASH_LICENSE_JAR" ]; then
echo "This script can be used to update the DEPENDENCIES"
echo "file with the result of checking the Hono maven"
echo "dependencies using the Dash License Tool."
echo ""
echo "Usage: $0 <org.eclipse.dash.licenses jar path> [<other dash-tool parameters>..]"
exit 1
fi
HONO_MAVEN_DEPS="legal/src/main/resources/legal/hono-maven.deps"
DEPENDENCIES="legal/src/main/resources/legal/DEPENDENCIES"
# The spotbugs artifacts are being used with scope "provided", i.e. they are not copied to the
# container images and are not used/required during runtime and thus constitute something like
# a "works-with" dependency. It therefore seems ok to simply exclude them from the license check
# even though they are LGPL 2.1.
mvn dependency:list \
-DexcludeGroupIds=org.eclipse.hono,org.junit,com.github.spotbugs \
-Pmetrics-prometheus,build-docker-image,build-native-image,build-cli-native-executable | \
grep -Poh "\S+:(runtime|compile|provided)" | \
sed -e 's/^\(.*\)\:.*$/\1/' | \
sort | \
uniq > $HONO_MAVEN_DEPS
java -Dorg.eclipse.dash.timeout=60 -jar "${DASH_LICENSE_JAR}" -batch 90 -summary ${DEPENDENCIES} ${HONO_MAVEN_DEPS} "$@"
sort -o ${DEPENDENCIES} ${DEPENDENCIES}