Skip to content

Document that skipIfEmpty wins over forceCreation - #585

Merged
elharo merged 1 commit into
apache:masterfrom
AzazelSensei:docs-560-skipifempty-forcecreation
Aug 26, 2026
Merged

Document that skipIfEmpty wins over forceCreation#585
elharo merged 1 commit into
apache:masterfrom
AzazelSensei:docs-560-skipifempty-forcecreation

Conversation

@AzazelSensei

Copy link
Copy Markdown

execute() returns on skipIfEmpty before it looks at forceCreation. elharo asked to keep that and write it down, so I only touched the two parameter javadocs.

  • Addresses just this docs issue
  • I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004


/**
* Skip creating empty archives.
* When {@code true}, an empty classes directory skips packaging even if {@link #forceCreation} is also {@code true}.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what "an empty classes directory skips packaging" means. This feels like the wrong subject for the verb. Rewrite.

@@ -119,6 +119,8 @@ public abstract class AbstractJarMojo implements org.apache.maven.api.plugin.Moj
* This plugin can not detect the post-processing, and so leaves the post-processed JAR file in place.
* This can lead to failures when those plugins do not expect to find their own output as an input.
* Set this parameter to {@code true} to avoid these problems by forcing this plugin to recreate the JAR every time.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete "to avoid these problems by forcing this plugin"

* This plugin can not detect the post-processing, and so leaves the post-processed JAR file in place.
* This can lead to failures when those plugins do not expect to find their own output as an input.
* Set this parameter to {@code true} to avoid these problems by forcing this plugin to recreate the JAR every time.
* This does not override {@link #skipIfEmpty}: when that flag is {@code true} and the classes directory is empty,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When {@link #skipIfEmpty} is {@code true} and the classes directory is empty, packaging is skipped even if {@code forceCreation} is true.

When both flags are true and the classes directory is empty, packaging
is skipped. forceCreation is not consulted.

Closes apache#560
@AzazelSensei
AzazelSensei force-pushed the docs-560-skipifempty-forcecreation branch from 29e55bf to 4de03ce Compare August 24, 2026 06:17
@AzazelSensei

Copy link
Copy Markdown
Author

Rewrote the skipIfEmpty / forceCreation javadocs with the wording from the review and rebased onto master.

@elharo elharo added the documentation Improvements or additions to documentation label Aug 26, 2026
@elharo
elharo merged commit daab229 into apache:master Aug 26, 2026
8 checks passed
@github-actions github-actions Bot added this to the 4.0.0-beta-2 milestone Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants