Class BeanshellPropertyMojo

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

    @Mojo(name="bsh-property",
          defaultPhase=VALIDATE,
          threadSafe=true)
    public class BeanshellPropertyMojo
    extends AbstractDefinePropertyMojo
    Define one or many properties as a result of a Beanshell script invocation. Like gmaven-plugin, some variables are defined:
    • project: the actual Maven project,
    • session: the executing MavenSession,
    • settings: the executing Settings.
    • log: the logger of the Mojo (see AbstractMojo.getLog()).
    Since:
    1.8
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.apache.maven.execution.MavenSession mavenSession
      The Maven Session.
      private java.lang.String[] properties
      List of property names to get from script context after execution.
      private org.apache.maven.settings.Settings settings
      The Maven Settings.
      private java.lang.String source  
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void execute()
      Main plugin execution
      private void set​(bsh.Interpreter interpreter, java.lang.String name, java.lang.Object value)  
      • Methods inherited from class org.apache.maven.plugin.AbstractMojo

        getLog, getPluginContext, setLog, setPluginContext
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • source

        @Parameter(required=true)
        private java.lang.String source
      • properties

        @Parameter
        private java.lang.String[] properties
        List of property names to get from script context after execution. Can be omitted if no property needs to be defined, just the script execution.
      • mavenSession

        @Parameter(readonly=true,
                   defaultValue="${session}")
        private org.apache.maven.execution.MavenSession mavenSession
        The Maven Session.
      • settings

        @Parameter(readonly=true,
                   defaultValue="${settings}")
        private org.apache.maven.settings.Settings settings
        The Maven Settings.
    • Constructor Detail

      • BeanshellPropertyMojo

        public BeanshellPropertyMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoFailureException
        Main plugin execution
        Throws:
        org.apache.maven.plugin.MojoFailureException
      • set

        private void set​(bsh.Interpreter interpreter,
                         java.lang.String name,
                         java.lang.Object value)
                  throws org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoFailureException