Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#201 - Reduce log level for unknown dependencies to debug to reduce l… #300

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

4 changes: 2 additions & 2 deletions src/it/ISSUE-154/postbuild.groovy
Expand Up @@ -22,8 +22,8 @@

file = new File(basedir, 'target/licenses.xml');
expectedFile = new File(basedir, 'expected_licenses.xml');
assert expectedFile.text.equals(file.text);
assert expectedFile.text.equals(file.text.replace("\r\n", "\n").replace('\r', '\n'));

licenseFile = new File(basedir, 'target/generated-resources/licenses/public domain - alternative.txt');
expectedLicenseTxt = new File(basedir, 'src/alternative.txt');
assert expectedLicenseTxt.text.equals(licenseFile.text);
assert expectedLicenseTxt.text.equals(licenseFile.text.replace("\r\n", "\n").replace('\r', '\n'));
2 changes: 1 addition & 1 deletion src/it/ISSUE-80/postbuild.groovy
Expand Up @@ -22,5 +22,5 @@

file = new File(basedir, 'target/licenses.xml');
expectedFile = new File(basedir, 'expected_licenses.xml');
assert expectedFile.text.equals(file.text);
assert expectedFile.text.equals(file.text.replace("\r\n", "\n").replace('\r', '\n'));
return true;
16 changes: 8 additions & 8 deletions src/it/download-licenses-configured/postbuild.groovy
Expand Up @@ -39,7 +39,7 @@ return {

final Path expectedLicensesXml = basePath.resolve('licenses-'+ id +'.expected.xml')
final Path licensesXml = outputBase.resolve('licenses.xml')
assert expectedLicensesXml.text.equals(licensesXml.text)
assert expectedLicensesXml.text.equals(licensesXml.text.replace("\r\n", "\n").replace('\r', '\n'))
return true
}() && {
final String id = 'since-1.18'
Expand All @@ -55,7 +55,7 @@ return {

final Path expectedLicensesXml = basePath.resolve('licenses-'+ id +'.expected.xml')
final Path licensesXml = outputBase.resolve('licenses.xml')
assert expectedLicensesXml.text.equals(licensesXml.text)
assert expectedLicensesXml.text.equals(licensesXml.text.replace("\r\n", "\n").replace('\r', '\n'))
return true
}() && {
final String id = 'artifact-filters-url'
Expand All @@ -66,7 +66,7 @@ return {

final Path expectedLicensesXml = basePath.resolve('licenses-'+ id +'.expected.xml')
final Path licensesXml = outputBase.resolve('licenses.xml')
assert expectedLicensesXml.text.equals(licensesXml.text)
assert expectedLicensesXml.text.equals(licensesXml.text.replace("\r\n", "\n").replace('\r', '\n'))
return true
}() && {
final String id = 'no-download'
Expand All @@ -82,7 +82,7 @@ return {

final Path expectedLicensesXml = basePath.resolve('licenses-'+ id +'.expected.xml')
final Path licensesXml = outputBase.resolve('licenses.xml')
assert expectedLicensesXml.text.equals(licensesXml.text)
assert expectedLicensesXml.text.equals(licensesXml.text.replace("\r\n", "\n").replace('\r', '\n'))
return true
}() && {
final String id = 'delete-orphans'
Expand All @@ -101,15 +101,15 @@ return {

final Path expectedLicensesXml = basePath.resolve('licenses-'+ id +'.expected.xml')
final Path licensesXml = outputBase.resolve('licenses.xml')
assert expectedLicensesXml.text.equals(licensesXml.text)
assert expectedLicensesXml.text.equals(licensesXml.text.replace("\r\n", "\n").replace('\r', '\n'))
return true
}() && {
final String id = 'insert-versions'
final Path outputBase = basePath.resolve('target/' + id)

final Path expectedLicensesXml = basePath.resolve('licenses-'+ id +'.expected.xml')
final Path licensesXml = outputBase.resolve('licenses.xml')
assert expectedLicensesXml.text.equals(licensesXml.text)
assert expectedLicensesXml.text.equals(licensesXml.text.replace("\r\n", "\n").replace('\r', '\n'))
return true
}() && {
final String id = 'content-sanitizers'
Expand All @@ -118,12 +118,12 @@ return {
final Path asl2 = outputBase.resolve('licenses/apache-license-2.0-apache-2.0.txt')
assert Files.exists(asl2)
final Path expectedAsl2 = basePath.resolve('src/license/'+ id +'/apache-2.0.expected.txt')
assert expectedAsl2.text.equals(asl2.text)
assert expectedAsl2.text.equals(asl2.text.replace("\r\n", "\n").replace('\r', '\n'))

final Path bsdAsm = outputBase.resolve('licenses/bsd-3-clause-asm-bsd3-asm.txt')
assert Files.exists(bsdAsm)
final Path expectedBsdAsm = basePath.resolve('src/license/'+ id +'/bsd3-asm.expected.txt')
assert expectedBsdAsm.text.equals(bsdAsm.text)
assert expectedBsdAsm.text.equals(bsdAsm.text.replace("\r\n", "\n").replace('\r', '\n'))

return true
}()
6 changes: 3 additions & 3 deletions src/it/download-licenses-file-names/postbuild.groovy
Expand Up @@ -47,7 +47,7 @@ return {

final Path expectedLicensesXml = basePath.resolve('licenses-'+ id +'.expected.xml')
final Path licensesXml = outputBase.resolve('licenses.xml')
assert expectedLicensesXml.text.equals(licensesXml.text)
assert expectedLicensesXml.text.equals(licensesXml.text.replace("\r\n", "\n").replace('\r', '\n'))
return true
}() && {
final String id = 'spdx'
Expand All @@ -67,7 +67,7 @@ return {

final Path expectedLicensesXml = basePath.resolve('licenses-'+ id +'.expected.xml')
final Path licensesXml = outputBase.resolve('licenses.xml')
assert expectedLicensesXml.text.equals(licensesXml.text)
assert expectedLicensesXml.text.equals(licensesXml.text.replace("\r\n", "\n").replace('\r', '\n'))
return true
}() && {

Expand All @@ -89,7 +89,7 @@ return {

final Path expectedLicensesXml = basePath.resolve('licenses-'+ id +'.expected.xml')
final Path licensesXml = outputBase.resolve('licenses.xml')
assert expectedLicensesXml.text.equals(licensesXml.text)
assert expectedLicensesXml.text.equals(licensesXml.text.replace("\r\n", "\n").replace('\r', '\n'))

final Path foo = basePath.resolve('target/cleanLicDir/licenses/foo.txt')
assert !Files.exists(foo)
Expand Down
4 changes: 2 additions & 2 deletions src/it/download-licenses-force/postbuild.groovy
Expand Up @@ -36,11 +36,11 @@ assert lgpl21.text.contains('Version 2.1, February 1999')

final Path expectedLicensesXml = basePath.resolve('licenses.expected.xml')
final Path licensesXml = basePath.resolve('target/generated-resources/licenses.xml')
assert expectedLicensesXml.text.equals(licensesXml.text)
assert expectedLicensesXml.text.equals(licensesXml.text.replace("\r\n", "\n").replace('\r', '\n'))

final Path expectedLicensesErrorsXml = basePath.resolve('licenses-errors.expected.xml')
final Path licensesErrorsXml = basePath.resolve('target/generated-resources/licenses-errors.xml')
assert expectedLicensesErrorsXml.text.equals(licensesErrorsXml.text)
assert expectedLicensesErrorsXml.text.equals(licensesErrorsXml.text.replace("\r\n", "\n").replace('\r', '\n'))

final Path log = basePath.resolve('build.log')
assert Files.exists(log)
Expand Down
2 changes: 1 addition & 1 deletion src/it/download-licenses-proxy/postbuild.groovy
Expand Up @@ -31,4 +31,4 @@ assert asl2.text.contains('Proxied via LittleProxy')

final Path expectedLicensesXml = basePath.resolve('licenses.expected.xml')
final Path licensesXml = basePath.resolve('target/generated-resources/licenses.xml')
assert expectedLicensesXml.text.equals(licensesXml.text)
assert expectedLicensesXml.text.equals(licensesXml.text.replace("\r\n", "\n").replace('\r', '\n'))
23 changes: 23 additions & 0 deletions src/it/file-does-not-exist-in-project-debug/invoker.properties
@@ -0,0 +1,23 @@
###
# #%L
# License Maven Plugin
# %%
# Copyright (C) 2008 - 2011 CodeLutin, Codehaus, Tony Chemit
# %%
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Lesser Public License for more details.
#
# You should have received a copy of the GNU General Lesser Public
# License along with this program. If not, see
# <http://www.gnu.org/licenses/lgpl-3.0.html>.
# #L%
###
invoker.goals=clean license:add-third-party
invoker.failureBehavior=fail-fast
@@ -0,0 +1 @@
commons-logging--commons-logging--1.1.1=The Apache Software License, Version 2.0
@@ -0,0 +1 @@
org.apache.commons--commons-lang3--3.3.2=The Apache Software License, Version 2.0
82 changes: 82 additions & 0 deletions src/it/file-does-not-exist-in-project-debug/pom.xml
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
License Maven Plugin
%%
Copyright (C) 2008 - 2011 CodeLutin, Codehaus, Tony Chemit
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Lesser Public License for more details.

You should have received a copy of the GNU General Lesser Public
License along with this program. If not, see
<http://www.gnu.org/licenses/lgpl-3.0.html>.
#L%
-->

<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>org.codehaus.mojo.license.test</groupId>
<artifactId>file-does-not-exist-in-project-debug</artifactId>
<version>1.0</version>

<name>License Test :: file-does-not-exist-in-project-debug</name>

<url>no-url</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<license.verbose>true</license.verbose>
</properties>

<dependencies>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>

<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20070829</version>
</dependency>
</dependencies>


<build>

<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>@pom.version@</version>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<configuration>
<useMissingFile>true</useMissingFile>
<missingFile>missing-licenses.properties</missingFile>
<licenseMergesFile>licenses.properties</licenseMergesFile>
<unkownFileRemedy>debug</unkownFileRemedy>
</configuration>
</plugin>
</plugins>
</build>
</project>
27 changes: 27 additions & 0 deletions src/it/file-does-not-exist-in-project-debug/postbuild.groovy
@@ -0,0 +1,27 @@
/*
* #%L
* License Maven Plugin
* %%
* Copyright (C) 2008 - 2011 CodeLutin, Codehaus, Tony Chemit
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L%
*/
file = new File(basedir, "build.log")
assert file.exists()
content = file.text
assert !content.contains("dependency [org.apache.commons--commons-lang3--3.3.2] does not exist in project, remove it from the missing file.")

return true
23 changes: 23 additions & 0 deletions src/it/file-does-not-exist-in-project-fail/invoker.properties
@@ -0,0 +1,23 @@
###
# #%L
# License Maven Plugin
# %%
# Copyright (C) 2008 - 2011 CodeLutin, Codehaus, Tony Chemit
# %%
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Lesser Public License for more details.
#
# You should have received a copy of the GNU General Lesser Public
# License along with this program. If not, see
# <http://www.gnu.org/licenses/lgpl-3.0.html>.
# #L%
###
invoker.goals=clean license:add-third-party
invoker.buildResult = failure
@@ -0,0 +1 @@
commons-logging--commons-logging--1.1.1=The Apache Software License, Version 2.0
@@ -0,0 +1 @@
org.apache.commons--commons-lang3--3.3.2=The Apache Software License, Version 2.0
82 changes: 82 additions & 0 deletions src/it/file-does-not-exist-in-project-fail/pom.xml
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
License Maven Plugin
%%
Copyright (C) 2008 - 2011 CodeLutin, Codehaus, Tony Chemit
%%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Lesser Public License for more details.

You should have received a copy of the GNU General Lesser Public
License along with this program. If not, see
<http://www.gnu.org/licenses/lgpl-3.0.html>.
#L%
-->

<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>org.codehaus.mojo.license.test</groupId>
<artifactId>file-does-not-exist-in-project-fail</artifactId>
<version>1.0</version>

<name>License Test :: file-does-not-exist-in-project-fail</name>

<url>no-url</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<license.verbose>true</license.verbose>
</properties>

<dependencies>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>

<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20070829</version>
</dependency>
</dependencies>


<build>

<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>@pom.version@</version>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<configuration>
<useMissingFile>true</useMissingFile>
<missingFile>missing-licenses.properties</missingFile>
<licenseMergesFile>licenses.properties</licenseMergesFile>
<unkownFileRemedy>failFast</unkownFileRemedy>
</configuration>
</plugin>
</plugins>
</build>
</project>