Plexus コンポーネントを Mojo に注入することは可能ですか? これが私が試したものですが、myComponent
常にnull
です。
私のコンポーネント:
import org.codehaus.plexus.component.annotations.Component;
@Component(role = MyComponent.class, hint = "mine")
public class MyComponent {
}
私のモジョ:
import org.codehaus.plexus.component.annotations.Requirement;
import org.apache.maven.plugins.annotations.Component;
public class MyMojo extends AbstractMojo {
@Requirement(role = MyComponent.class, hint = "mine", optional = false)
protected MyComponent myComponent;
@Component
protected MavenProject project;
}