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

Add dummy parameter to prevent warnings with jgit as timestamp provider #2685

Merged
merged 1 commit into from
Jul 31, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@
*/
@Component(role = BuildTimestampProvider.class, hint = "jgit")
public class JGitBuildTimestampProvider implements BuildTimestampProvider {
private static final String PARAMETER_JGIT_IGNORE = "jgit.ignore";

private static final String PARAMETER_JGIT_DIRTY_WORKING_TREE = "jgit.dirtyWorkingTree";

@Requirement(hint = "default")
private BuildTimestampProvider defaultTimestampProvider;
Expand All @@ -112,7 +115,7 @@ public static DirtyBehavior getDirtyWorkingTreeBehaviour(MojoExecution execution
if (pluginConfiguration == null) {
return defaultBehaviour;
}
Xpp3Dom dirtyWorkingTreeDom = pluginConfiguration.getChild("jgit.dirtyWorkingTree");
Xpp3Dom dirtyWorkingTreeDom = pluginConfiguration.getChild(PARAMETER_JGIT_DIRTY_WORKING_TREE);
if (dirtyWorkingTreeDom == null) {
return defaultBehaviour;
}
Expand Down Expand Up @@ -219,7 +222,7 @@ private static String getIgnoreFilter(MojoExecution execution) {
if (pluginConfiguration == null) {
return null;
}
Xpp3Dom ignoreDom = pluginConfiguration.getChild("jgit.ignore");
Xpp3Dom ignoreDom = pluginConfiguration.getChild(PARAMETER_JGIT_IGNORE);
if (ignoreDom == null) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,26 @@ public class BuildQualifierMojo extends AbstractVersionMojo {
@Parameter(property = "mojoExecution", readonly = true)
protected MojoExecution execution;

@Component(role = BuildTimestampProvider.class)
protected Map<String, BuildTimestampProvider> timestampProviders;
@Component(role = BuildTimestampProvider.class)
protected Map<String, BuildTimestampProvider> timestampProviders;

@Component
private BuildPropertiesParser buildPropertiesParser;

/**
* This is only a dummy parameter used to prevent maven from complaining about
* "unknown" parameters when using the jgit extension
*/
@Parameter(alias = "jgit.dirtyWorkingTree")
private String dummy1;

/**
* This is only a dummy parameter used to prevent maven from complaining about
* "unknown" parameters when using the jgit extension
*/
@Parameter(alias = "jgit.ignore")
private String dummy2;

// setter is needed to make sure we always use UTC
public void setFormat(String formatString) {
format = new SimpleDateFormat(formatString);
Expand Down
Loading