Package org.apache.maven.plugins.changes
Class ChangesCheckMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugins.changes.AbstractChangesMojo
org.apache.maven.plugins.changes.ChangesCheckMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="changes-check",
threadSafe=true)
public class ChangesCheckMojo
extends AbstractChangesMojo
Goal which checks that the changes.xml file has the necessary data to generate an announcement or a report for the
current release.
- Since:
- 2.4
- Author:
- Justin Edelson, Dennis Lundberg
-
Field Summary
Fields inherited from class org.apache.maven.plugins.changes.AbstractChangesMojo
basedir, mavenSession, runOnlyAtExecutionRootFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Check that the latest release contains a valid release date.protected static booleanisValidDate(String string, String pattern) Use the pattern to try to parse a Date from the given string.protected static booleanisValidDate(String string, String pattern, String locale) Use the pattern to try to parse a Date from the given string using the given Locale.Methods inherited from class org.apache.maven.plugins.changes.AbstractChangesMojo
isThisTheExecutionRootMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
ChangesCheckMojo
public ChangesCheckMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionExceptionCheck that the latest release contains a valid release date.- Throws:
org.apache.maven.plugin.MojoExecutionException- in case of errors.
-
isValidDate
Use the pattern to try to parse a Date from the given string. Kept for backward compatibility with existing unit tests.- Parameters:
string- A date as textpattern- A pattern that can be used bySimpleDateFormat- Returns:
trueif the string can be parsed as a date using the pattern, otherwisefalse
-
isValidDate
Use the pattern to try to parse a Date from the given string using the given Locale.- Parameters:
string- A date as textpattern- A pattern that can be used bySimpleDateFormatlocale- A locale that can be used bySimpleDateFormat- Returns:
trueif the string can be parsed as a date using the pattern, otherwisefalse
-