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

Make sure multi-license parameters are correctly set by Maven #171

Merged
Merged
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 @@ -17,6 +17,8 @@

import org.apache.maven.plugins.annotations.Parameter;

import java.util.Arrays;

public class Multi {

public static final String DEFAULT_SEPARATOR =
Expand Down Expand Up @@ -65,6 +67,25 @@ public String[] getHeaders() {
return headers;
}

/**
* Set a header.
*
* Used by Maven to configure the {@link #headers}
* field, as the class field name is different
* to the alias name used in the pom.xml
* plugin configuration.
*
* @param header the header to set
*/
public void setHeader(final String header) {
if (headers == null) {
headers = new String[] { header };
} else {
headers = Arrays.copyOf(headers, headers.length + 1);
headers[headers.length - 1] = header;
}
}

public void setHeaders(final String[] headers) {
this.headers = headers;
}
Expand All @@ -73,6 +94,25 @@ public String[] getInlineHeaders() {
return inlineHeaders;
}

/**
* Set an inline header.
*
* Used by Maven to configure the {@link #inlineHeaders}
* field, as the class field name is different
* to the alias name used in the pom.xml
* plugin configuration.
*
* @param inlineHeader the inline header to set
*/
public void setInlineHeader(final String inlineHeader) {
if (inlineHeaders == null) {
inlineHeaders = new String[] { inlineHeader };
} else {
inlineHeaders = Arrays.copyOf(inlineHeaders, inlineHeaders.length + 1);
inlineHeaders[inlineHeaders.length - 1] = inlineHeader;
}
}

public void setInlineHeaders(final String[] inlineHeaders) {
this.inlineHeaders = inlineHeaders;
}
Expand All @@ -81,6 +121,25 @@ public String[] getSeparators() {
return separators;
}

/**
* Set a separator.
*
* Used by Maven to configure the {@link #separators}
* field, as the class field name is different
* to the alias name used in the pom.xml
* plugin configuration.
*
* @param separator the separator to set
*/
public void setSeparator(final String separator) {
if (separators == null) {
separators = new String[] { separator };
} else {
separators = Arrays.copyOf(separators, separators.length + 1);
separators[separators.length - 1] = separator;
}
}

public void setSeparators(final String[] separators) {
this.separators = separators;
}
Expand Down