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
  • Loading branch information
AB-xdev committed Jul 23, 2024
1 parent 42b3808 commit 0c82e16
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 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
*/
@Parameter(property = "license.addOutputDirectoryAsResourceDir", defaultValue = "true")
private boolean addOutputDirectoryAsResourceDir;

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

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

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

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

0 comments on commit 0c82e16

Please sign in to comment.