admin管理员组

文章数量:1303404

Instead of having a META-INF/maven/plugin.xml declaring the mojo, can we leverage the sisu-Guice integration to do something like

@Named
public class MyModule extends AbstractModule {

    @Override
    protected void configure() {
        bind(Mojo.class)
          .annotatedWith(Names.named(MyMojo.class.getName()))
          .to(MyMojo.class); // or similar
    }
  
}

with a Mojo defined as

@Named("my-mojo")
public class MyMojo extends AbstractMojo {
...
}

It seems Maven is needing a PluginDescriptor, containing a MojoDescriptor, which are populated when parsing the META-INF/maven/plugin.xml. Is there a way around that ?

本文标签: guiceIs it possible to bind a Maven mojo programaticallyStack Overflow