-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #304 from elballa/feature/303
Fix #303 Aggregate-add-third-party mojo is not including optional dependencies by default
- Loading branch information
Showing
5 changed files
with
191 additions
and
0 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
src/it/aggregate-add-third-party-include-optional/child1/pom.xml
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,58 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
#%L | ||
License Maven Plugin | ||
%% | ||
Copyright (C) 2019 Alessandro Ballarin | ||
%% | ||
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> | ||
|
||
<parent> | ||
<groupId>org.codehaus.mojo.license.test</groupId> | ||
<artifactId>test-aggregate-add-third-party-include-optional</artifactId> | ||
<version>1.0</version> | ||
</parent> | ||
<artifactId>test-aggregate-add-third-party-include-optional-child1</artifactId> | ||
|
||
<dependencies> | ||
|
||
<!-- use license 'Apache License, Version 2.0' --> | ||
<dependency> | ||
<groupId>com.jhlabs</groupId> | ||
<artifactId>filters</artifactId> | ||
<version>2.0.235</version> | ||
</dependency> | ||
|
||
<!-- use license 'The Apache Software License, Version 2.0' --> | ||
<dependency> | ||
<groupId>commons-logging</groupId> | ||
<artifactId>commons-logging</artifactId> | ||
<version>1.1.1</version> | ||
<optional>true</optional> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
</project> | ||
|
||
|
23 changes: 23 additions & 0 deletions
23
src/it/aggregate-add-third-party-include-optional/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,23 @@ | ||
### | ||
# #%L | ||
# License Maven Plugin | ||
# %% | ||
# Copyright (C) 2019 Alessandro Ballarin | ||
# %% | ||
# 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:aggregate-add-third-party | ||
invoker.failureBehavior=fail-at-end |
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,80 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
#%L | ||
License Maven Plugin | ||
%% | ||
Copyright (C) 2019 Alessandro Ballarin | ||
%% | ||
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>test-aggregate-add-third-party-include-optional</artifactId> | ||
<version>1.0</version> | ||
|
||
<modules> | ||
<module>child1</module> | ||
</modules> | ||
|
||
<name>Test: aggregate-add-third-party-include-optional</name> | ||
|
||
<packaging>pom</packaging> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<build> | ||
|
||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>license-maven-plugin</artifactId> | ||
<version>@pom.version@</version> | ||
<configuration> | ||
<verbose>true</verbose> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
|
||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>license-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>include-optional</id> | ||
<goals> | ||
<goal>aggregate-add-third-party</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
|
||
</build> | ||
|
||
</project> | ||
|
||
|
29 changes: 29 additions & 0 deletions
29
src/it/aggregate-add-third-party-include-optional/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,29 @@ | ||
/* | ||
* #%L | ||
* License Maven Plugin | ||
* %% | ||
* Copyright (C) 2019 Alessandro Ballarin | ||
* %% | ||
* 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, 'target/generated-sources/license/THIRD-PARTY.txt'); | ||
assert file.exists(); | ||
content = file.text; | ||
|
||
assert !content.contains('the project has no dependencies.'); | ||
assert content.contains('com.jhlabs:filters:2.0.235'); | ||
assert content.contains('commons-logging:commons-logging:1.1.1'); |
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