/** * Wrap execute Mojo function for temporary removing global Cargo configuration * before starting AMPS internal Cargo */ @VisibleForTesting protected void executeMojoExcludeProductCargoConfig(Plugin internalCargo, String goal, Xpp3Dom configuration, ExecutionEnvironment env) throws MojoExecutionException { // remove application cargo plugin for avoiding amps standalone cargo merges configuration Plugin globalCargo = env.getMavenProject().getPlugin("org.codehaus.cargo:cargo-maven2-plugin"); env.getMavenProject().getBuild().removePlugin(globalCargo); env.executeMojo(internalCargo, goal, configuration); // restore application cargo plugin for maven next tasks if (null != globalCargo) { env.getMavenProject().getBuild().addPlugin(globalCargo); } }
env.getPluginManager().loadPlugin( plugin, env.getMavenProject().getRemotePluginRepositories(), session.getRepositorySession());
final Plugin globalJavadoc = executionEnvironment().getMavenProject().getPlugin("org.apache.maven.plugins:maven-javadoc-plugin"); if (null != globalJavadoc) executionEnvironment().getMavenProject().getBuild().removePlugin(globalJavadoc); executionEnvironment().getMavenProject().getBuild().addPlugin(globalJavadoc);
MojoExecutor.ExecutionEnvironment executionEnvironment) throws MojoExecutionException { Xpp3Dom goalConfig = getGoalConfig(plugin, goal, executionEnvironment.getMavenProject()); if (goalConfig == null) {
private Artifact resolveArtifactForProduct(final ProductArtifact product) { final Artifact artifact = artifactFactory.createArtifact(product.getGroupId(), product.getArtifactId(), product.getVersion(), "compile", "obr"); try { final MavenSession session = context.getExecutionEnvironment().getMavenSession(); final MavenProject project = context.getExecutionEnvironment().getMavenProject(); final ArtifactResolver resolver = session.getContainer().lookup(ArtifactResolver.class); resolver.resolve(artifact, project.getRemoteArtifactRepositories(), session.getLocalRepository()); } catch (ArtifactNotFoundException | ArtifactResolutionException | ComponentLookupException e) { throw new RuntimeException(e); } return artifact; }