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

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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