Skip to content

Commit

Permalink
Added an option to control if output directory is added as resource d…
Browse files Browse the repository at this point in the history
…irectory (#580)

* Added an option to control if output directory is added as resource directory

* Bump project to 2.5.0

---------

Co-authored-by: Slawomir Jaranowski <s.jaranowski@gmail.com>
  • Loading branch information
AB-xdev and slawekjaranowski authored Sep 13, 2024
1 parent a331569 commit 4b98153
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</parent>

<artifactId>license-maven-plugin</artifactId>
<version>2.4.1-SNAPSHOT</version>
<version>2.5.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>

<name>License Maven Plugin</name>
Expand Down Expand Up @@ -137,7 +137,7 @@

<!-- the same version as in Maven core -->
<maven-resolver.version>1.4.1</maven-resolver.version>
<project.build.outputTimestamp>2024-01-23T22:42:18Z</project.build.outputTimestamp>
<project.build.outputTimestamp>2024-09-13T18:50:14Z</project.build.outputTimestamp>
</properties>

<dependencyManagement>
Expand Down
15 changes: 14 additions & 1 deletion src/main/java/org/codehaus/mojo/license/AddThirdPartyMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ public class AddThirdPartyMojo extends AbstractAddThirdPartyMojo implements Mave
@Parameter(property = "license.skipAddThirdParty", defaultValue = "false")
private boolean skipAddThirdParty;

/**
* Add the output directory as resource directory.
* <p>
* If this is set to <code>false</code> the generated files are no longer added automatically to the final artifact.
* </p>
*
* @since 2.5.0
*/
@Parameter(property = "license.addOutputDirectoryAsResourceDir", defaultValue = "true")
private boolean addOutputDirectoryAsResourceDir;

// ----------------------------------------------------------------------
// Private Fields
// ----------------------------------------------------------------------
Expand Down Expand Up @@ -184,7 +195,9 @@ protected void doAction() throws Exception {
getHelper().attachThirdPartyDescriptor(missingFile);
}

addResourceDir(outputDirectory, "**/*.txt");
if (addOutputDirectoryAsResourceDir) {
addResourceDir(outputDirectory, "**/*.txt");
}
}

// ----------------------------------------------------------------------
Expand Down

0 comments on commit 4b98153

Please sign in to comment.