-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fixes #413 In the result mapping we need to use "GAV" to be compatible with the other classes in the plugin. While the exclude/includeArtifacts should still use the Artifact#getId, since the getDependencyTrail also uses that format, which is considered when we exclude all the transitive deps of excluded artifacts. Note that the added it is based on the already existing download-licenses-include-exclude-types, but with a small change in the settings to use excludeTransitiveDependencies instead. --------- Co-authored-by: Attila Puskas <attila.puskas@casrd.net> Co-authored-by: Slawomir Jaranowski <s.jaranowski@gmail.com>
- Loading branch information
1 parent
d5d48c4
commit a86c98e
Showing
5 changed files
with
124 additions
and
2 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
src/it/download-licenses-exclude-transitive-deps/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
invoker.goals = clean validate -X |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?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/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.codehaus.mojo.license</groupId> | ||
<artifactId>it-test</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<name>Integration Test</name> | ||
<url>http://maven.apache.org</url> | ||
<description> | ||
Check default execution. | ||
</description> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.wildfly</groupId> | ||
<artifactId>wildfly-ejb-client-bom</artifactId> | ||
<type>pom</type> | ||
<version>9.0.1.Final</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.13.1</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>license-maven-plugin</artifactId> | ||
<version>@pom.version@</version> | ||
<executions> | ||
<execution> | ||
<id>exclude-pom</id> | ||
<goals> | ||
<goal>download-licenses</goal> | ||
</goals> | ||
<phase>validate</phase> | ||
<configuration> | ||
<excludeTransitiveDependencies>true</excludeTransitiveDependencies> | ||
<excludedTypes>pom</excludedTypes> | ||
<licensesOutputDirectory>${project.build.directory}/generated-resources/licenses</licensesOutputDirectory> | ||
<licensesOutputFile>${project.build.directory}/generated-resources/licenses.xml</licensesOutputFile> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
51 changes: 51 additions & 0 deletions
51
src/it/download-licenses-exclude-transitive-deps/postbuild.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* #%L | ||
* License Maven Plugin | ||
* %% | ||
* Copyright (C) 2008 - 2011 CodeLutin, Codehaus, Tony Chemit, 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% | ||
*/ | ||
def assertExistsFile(file) | ||
{ | ||
if ( !file.exists() || file.isDirectory() ) | ||
{ | ||
println(file.getAbsolutePath() + " file is missing or a directory.") | ||
assert false | ||
} | ||
assert true | ||
} | ||
|
||
def assertNotExistsFile(file) | ||
{ | ||
if ( file.exists() ) | ||
{ | ||
println(file.getAbsolutePath() + " file should not exists.") | ||
assert false | ||
} | ||
assert true | ||
} | ||
|
||
file = new File(basedir, 'target/generated-resources/licenses/eclipse public license 1.0 - epl-v10.html'); | ||
assertExistsFile(file); | ||
|
||
file = new File(basedir, 'target/generated-resources/licenses/lgpl - lgpl-2.1.txt'); | ||
assertNotExistsFile(file); | ||
|
||
file = new File(basedir, 'target/generated-resources/licenses.xml'); | ||
assertExistsFile(file); | ||
|
||
return true; |
15 changes: 15 additions & 0 deletions
15
...download-licenses-exclude-transitive-deps/src/main/java/org/codehaus/mojo/HelloWorld.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.codehaus.mojo; | ||
|
||
public class HelloWorld | ||
{ | ||
|
||
/** | ||
* @param args | ||
*/ | ||
public static void main( String[] args ) | ||
{ | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters