Class RegexPropertyMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="regex-property",
          defaultPhase=VALIDATE,
          threadSafe=true)
    public class RegexPropertyMojo
    extends AbstractRegexPropertyMojo
    Sets a property by applying a regex replacement rule to a supplied value.
    Since:
    1.7
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean failIfNoMatch
      Whether to fail if no match is found.
      private java.lang.String name
      The property to set.
      private java.lang.String regex
      The regex to replace.
      private java.lang.String replacement
      The replacement.
      private boolean toLowerCase
      Make the value of the resulting property lower case.
      private boolean toUpperCase
      Make the value of the resulting property upper case.
      private java.lang.String value
      The pre-transformation value.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Field Detail

      • name

        @Parameter(required=true)
        private java.lang.String name
        The property to set.
      • value

        @Parameter(required=true)
        private java.lang.String value
        The pre-transformation value.
      • regex

        @Parameter(required=true)
        private java.lang.String regex
        The regex to replace.
      • replacement

        @Parameter(defaultValue="")
        private java.lang.String replacement
        The replacement.
      • failIfNoMatch

        @Parameter(defaultValue="true")
        private boolean failIfNoMatch
        Whether to fail if no match is found.
      • toUpperCase

        @Parameter(defaultValue="false")
        private boolean toUpperCase
        Make the value of the resulting property upper case.
        Since:
        1.11
      • toLowerCase

        @Parameter(defaultValue="false")
        private boolean toLowerCase
        Make the value of the resulting property lower case.
        Since:
        1.11
    • Constructor Detail

      • RegexPropertyMojo

        public RegexPropertyMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException,
                            org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException