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

Makes update of outputTimestamp property optional #310

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ To configure your Maven build to support reproducible builds follow [official gu

If your project has `project.build.outputTimestamp` property this plugin will update its value whenever the versions are updated.

This can be disabled by setting the configuration parameter `updateOutputTimestamp` to `false`.


# Plugin Common Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,14 @@ public abstract class AbstractGitFlowMojo extends AbstractMojo {
@Parameter(defaultValue = "${session}", readonly = true)
protected MavenSession mavenSession;

/**
* Whether to update the <code>project.build.outputTimestamp</code>> property automatically or not.
aleksandr-m marked this conversation as resolved.
Show resolved Hide resolved
*
* @since 1.16.1
*/
@Parameter(property = "updateOutputTimestamp")
aleksandr-m marked this conversation as resolved.
Show resolved Hide resolved
private boolean updateOutputTimestamp = true;

@Component
protected ProjectBuilder projectBuilder;

Expand Down Expand Up @@ -1057,7 +1065,7 @@ protected void mvnSetVersions(final String version) throws MojoFailureException,
executeMvnCommand(args.toArray(new String[0]));

String timestamp = getCurrentProjectOutputTimestamp();
if (timestamp != null && timestamp.length() > 1) {
if (timestamp != null && timestamp.length() > 1 && updateOutputTimestamp) {
aleksandr-m marked this conversation as resolved.
Show resolved Hide resolved
if (StringUtils.isNumeric(timestamp)) {
// int representing seconds since the epoch
timestamp = String.valueOf(System.currentTimeMillis() / 1000l);
Expand Down