The @Mojo annotation requires the Resolution Scope to be a static value.
Thus far, I haven't found any way to actually dictate this dynamically --
like through a configuration parameter, for example.

I understand the use of attribute "requiresDependencyResolution" is meant
to resolve dependencies before the plugin executes, but I don't see this as
insisting on a static value. That's an implementation choice, for sure. An
alternate solution -- "blue skying" here for a moment -- would be for a
mojo to implement an interface for pre-processing. For example:

@Mojo(name="hello", requiresDependencyResolution=DYNAMIC)
public HelloMojo
  extends AbstractMojo
  implements MojoDependencyResolutionProvider {

  @Override
  public void execute() ... { }

  @Override
  public String getMojoResolutionScope() { ... }

}

I am not proposing this as *the* solution but as an illustration of the
general concept I have in mind. This is illustrating after the parameters
inject but before the plugin executes (in its proper phase or otherwise).

WDYT?

Cheers,
Paul

Reply via email to