private List<PluginExecution> transformExecutions(final MavenPlugin mavenPlugin) { List<PluginExecution> executions = new ArrayList<PluginExecution>(); for (Execution execution : mavenPlugin.listExecutions()) { PluginExecution pluginExecution = new PluginExecution(); pluginExecution.setId(execution.getId()); pluginExecution.setPhase(execution.getPhase()); pluginExecution.setGoals(execution.getGoals()); pluginExecution.setConfiguration(parseConfig(execution.getConfig())); executions.add(pluginExecution); } return executions; }
@Override protected void init() { final Execution execution = executions.iterator().next(); final ConfigurationElement artifactItems = execution.getConfig().getConfigurationElement("artifactItems"); final ConfigurationElementBuilder artifactItem = (ConfigurationElementBuilder) artifactItems.getChildren().get(0); final VersionFacet versionFacet = getProject().getFacet(VersionFacet.class); artifactItem.addChild(ConfigurationElementBuilder.create().setName("version") .setText(versionFacet.resolveVersion(WildflyDist))); }
private boolean processorConfigured(MetaModelProvider provider) { CoordinateBuilder dependency = createProcessorCoordinate().setVersion(null); MavenPluginFacet pluginFacet = getFaceted().getFacet(MavenPluginFacet.class); if (pluginFacet.hasPlugin(dependency)) { MavenPlugin plugin = pluginFacet.getPlugin(dependency); if (plugin.listExecutions().size() > 0) { Configuration config = plugin.listExecutions().get(0).getConfig(); if (config.hasConfigurationElement("processors")) { ConfigurationElement element = config.getConfigurationElement("processors").getChildByName("processor"); return element.getText().equals(provider.getProcessor()); } } } return false; }