Verified Commit b3faccb3 authored by mo's avatar mo
Browse files

Update maven/gradle offline tests

* Let maven figure out the version of the license plugin that it is compatible with
* Print the error when the setup fails
* Add tests for multiple versions of maven and java
* Install packages into a project specific directory to prevent cross test pollution
* Specify the list of supported Maven versions
* Update CHANGELOG and bump the version
parent e1bb260b
......@@ -30,5 +30,5 @@ build-mvn-pkg:
image: maven:3.3.9-jdk-8
stage: build
script:
- cd spec/fixtures/java/example/ && mvn deploy -s settings.xml
- cd spec/fixtures/java/maven/example/ && mvn deploy -s settings.xml
allow_failure: true
# GitLab License management changelog
## v3.19.1
- Choose a version of the `org.codehaus.mojo:license-maven-plugin:aggregate-download-licenses` that is compatible with the version of Maven used by the project. (!195)
- Print error messages to the console when a scan fails. (!195)
## v3.19.0
- Include the latest LTS of the .NET SDK in the Docker image. (!191)
......
......@@ -8,7 +8,7 @@ GIT
PATH
remote: .
specs:
license-management (3.19.0)
license-management (3.19.1)
license_finder (~> 6.6.0)
GEM
......
......@@ -80,7 +80,7 @@ The following table shows which languages and package managers are supported.
| .NET | [.NET Core CLI][dotnet_core], [Nuget][nuget] |
| C/C++ | [Conan][conan] |
| Go | [Go modules][gomod], [Godep][godep], go get |
| Java | [Gradle][gradle], [Maven][maven] |
| Java | [Gradle][gradle], [Maven v3.2.5+)][maven] |
| JavaScript | [npm][npm], [yarn][yarn], [Bower][bower] |
| PHP | [composer][composer] |
| Python | [pip][pip], [pipenv][pipenv] |
......
......@@ -25,7 +25,7 @@ module LicenseFinder
[
package_management_command,
"-e",
"org.codehaus.mojo:license-maven-plugin:2.0.0:aggregate-download-licenses",
"org.codehaus.mojo:license-maven-plugin:aggregate-download-licenses",
"-Dlicense.excludedScopes=#{@ignored_groups.to_a.join(',')}",
"-Dorg.slf4j.simpleLogger.log.org.codehaus.mojo.license=debug",
ENV.fetch('MAVEN_CLI_OPTS', '-DskipTests')
......
......@@ -79,14 +79,13 @@ module License
end
def record(stdout, stderr, status)
logger.debug(stdout) if present?(stdout)
return unless present?(stderr)
severity = status.success? ? Logger::DEBUG : Logger::ERROR
flush(stdout, severity)
flush(stderr, severity)
end
if status.success?
logger.debug(stderr)
else
logger.error(stderr)
end
def flush(message, severity)
logger.add(severity, message) if present?(message)
end
def collapsible_section(header)
......
......@@ -2,6 +2,6 @@
module License
module Management
VERSION = '3.19.0'
VERSION = '3.19.1'
end
end
......@@ -17,6 +17,7 @@ ids:
CC0 1.0 Universal: CC0-1.0
CC01: CC0-1.0
CDDL1: CDDL-1.0
CDDL 1.1: CDDL-1.1
COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0: CDDL-1.0
Common Development and Distribution License 1.1: CDDL-1.1
Common Public License Version 1.0: CPL-1.0
......
......@@ -35,7 +35,7 @@
"dependencies": [
{
"name": "cli",
"version": "6.14.6",
"version": "6.14.7",
"package_manager": "bower",
"path": "bower.json",
"licenses": [
......
......@@ -21,22 +21,40 @@ frontend www-https
bind *:443 ssl crt wildcard.test.pem
acl goproxy-backend ssl_fc_sni goproxy.test
acl maven-backend ssl_fc_sni maven.test
acl npm-backend ssl_fc_sni npm.test
acl nuget-backend ssl_fc_sni nuget.test
acl pypi-backend ssl_fc_sni pypi.test
acl rubygems-backend ssl_fc_sni rubygems.test
http-request replace-header Host .* api.nuget.org if nuget-backend
http-request replace-header Host .* proxy.golang.org if goproxy-backend
http-request replace-header Host .* pypi.org if pypi-backend
http-request replace-header Host .* registry.npmjs.org if npm-backend
http-request replace-header Host .* repo1.maven.org if maven-backend
http-request replace-header Host .* rubygems.org if rubygems-backend
use_backend goproxy-backend if goproxy-backend
use_backend maven-backend if maven-backend
use_backend npm-backend if npm-backend
use_backend nuget-backend if nuget-backend
use_backend pypi-backend if pypi-backend
use_backend rubygems-backend if rubygems-backend
backend goproxy-backend
server www1 proxy.golang.org:443 ssl verify none
backend maven-backend
server www1 repo1.maven.org:443 ssl verify none
backend npm-backend
server www1 registry.npmjs.org:443 ssl verify none
backend nuget-backend
server www1 api.nuget.org:443 ssl verify none
backend pypi-backend
server www1 pypi.org:443 ssl verify none
backend rubygems-backend
server www1 rubygems.org:443 ssl verify none
......@@ -6,7 +6,7 @@ apply plugin: "java"
ext { mavenHost = System.getenv('PRIVATE_MAVEN_HOST') }
repositories {
maven { url "https://$mavenHost/artifactory/mvn/" }
maven { url "https://$mavenHost/maven2/" }
}
dependencies {
......
-----BEGIN CERTIFICATE-----
MIID7jCCAtagAwIBAgIJAI21kFz1PLI3MA0GCSqGSIb3DQEBCwUAMIGLMQswCQYD
VQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQg
V2lkZ2l0cyBQdHkgTHRkMUQwQgYDVQQDDDtnaXRsYWItYWlyZ2FwLWp2bS51cy13
ZXN0MS1iLmMuZ3JvdXAtc2VjdXJlLWE4OWZlNy5pbnRlcm5hbDAeFw0yMDA0MTcw
NjE4NTFaFw0yMTA0MTcwNjE4NTFaMIGLMQswCQYDVQQGEwJBVTETMBEGA1UECAwK
U29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMUQw
QgYDVQQDDDtnaXRsYWItYWlyZ2FwLWp2bS51cy13ZXN0MS1iLmMuZ3JvdXAtc2Vj
dXJlLWE4OWZlNy5pbnRlcm5hbDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
ggEBAK7lgNeL7Z6pj/vNLDw0QWuv6VKhY6jqd6Rdd03FJ1kG6pG4iUREhaH6UKjF
IYBFQFHtH+WJV78nU3D5WQayAhKxPJMPeLfVmeBxO+3rFtVCylgkytqJEP4fEkwP
lOyiUWVa6pcRkdijE5Y9pi+7buagZMZoCyQITiVOgqMsTwuxUDmuhDZQx8cmyfiq
zV7STaKVYx4h7P7p5cOhXaMPg7mKbCEIjrRfxcA4BZTlFOt+/8uyqQDfTXarl4gp
buv/zSzZtrFbsyc0MmTY40foKkMuTKHwbaVjoRqiqYzGyEhBuSYdaNQMTHWAGl4e
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m7jCF3hasOoCivM5ifSmdXSBqmnmaQUErEhF+g9VIl696dR4H+47ewTmDc+2uzvP
FFEfV/gC7QLIhMlpYJUn2/y4SgPjp08zJqulDDZL++srUqFktfiKyehriQXBn1M8
JsW9G0at1fufKpFIgQWve0QtE1haBF+g6SGXQ/+guZnw5stUJ7ksFheJu4WsEPIx
vtRkKZ60p/Hpq7tmO5UG5fKK1tuyBSj3vxewBBYtgH23h7/c7KxoeDIOnyNRshoA
7Dg=
-----END CERTIFICATE-----
......@@ -13,9 +13,9 @@
<version>1.0</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
</dependencies>
</project>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.gitlab.secure</groupId>
<artifactId>license-scanning</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>example</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>com.gitlab.secure</groupId>
<artifactId>example</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
</dependencies>
</project>
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-maven-3.5.3-bin.zip
#!/bin/sh
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="`/usr/libexec/java_home`"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
if [ -z "$M2_HOME" ] ; then
PRG="$0"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
saveddir=`pwd`
M2_HOME=`dirname "$PRG"`/..
M2_HOME=`cd "$M2_HOME" && pwd`
cd "$saveddir"
fi
if $cygwin ; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --unix "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`which java`"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
find_maven_basedir() {
if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
if [ -d "${wdir}" ]; then
wdir=`cd "$wdir/.."; pwd`
fi
done
echo "${basedir}"
}
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
BASE_DIR=`find_maven_basedir "$(pwd)"`
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
echo $MAVEN_PROJECTBASEDIR
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --path --windows "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.2.3.1</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>barcodes</artifactId>
<version>7.0.0</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>font-asian</artifactId>
<version>7.0.0</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>forms</artifactId>
<version>7.0.0</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>hyph</artifactId>
<version>7.0.0</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>io</artifactId>
<version>7.0.0</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>kernel</artifactId>
<version>7.0.0</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>layout</artifactId>
<version>7.0.0</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>pdfa</artifactId>
<version>7.0.0</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>sign</artifactId>
<version>7.0.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
package com.example.demo;
import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.web.bind.annotation.*;
@SpringBootApplication
@RestController
public class DemoApplication {
@GetMapping("/")
String home() {
return "Spring is here!";
}
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
package com.example.demo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.junit4.SpringRunner;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(SpringRunner.class)