title: How to read Mojo name inside the custom maven plugin?
body: <p>I created a custom maven plugin and want to read the name of the goal within the code.</p>
  <p>@Mojo(name=&quot;wite-to-file&quot;)</p>
  <pre><code>
  @Mojo(name=&quot;write-to-file&quot;)
  
  public class CustomPlugin{
  
  public void execute(){
  
  Annotation[] annotations = this.getClass().getAnnotations();
  
  annotations[0].toString() // this does not return the value of the Mojo.
  
  }
  
  }
  
  When maven plugin's execute method gets called, Is there a way to access the current goal name? or the name of the Mojo?
  
  I tried annotations but could not read the value of Mojo.
  
  </code></pre>