mojoDescriptor.setGoal(clazz.getAnnotation(Mojo.class).goal().trim());
mojoDescriptor.setPhase(mojo.phase().value);
Execution execute = mojo.execute();
String lifecycle = execute.lifecycle().trim().length() == 0 ? null : execute.lifecycle().trim();
String goal = execute.goal().trim().length() == 0 ? null : execute.goal().trim();
Phase phase = execute.phase();
if (goal != null || phase != Phase.None) {
if (goal != null) {
if (lifecycle != null) {
throw new InvalidPluginDescriptorException("'goal' cannot be specified with 'lifecycle' in execute annotation");
}