org.apache.maven.model.Build.removePlugin()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(139)

本文整理了Java中org.apache.maven.model.Build.removePlugin()方法的一些代码示例,展示了Build.removePlugin()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Build.removePlugin()方法的具体详情如下:
包路径:org.apache.maven.model.Build
类名称:Build
方法名:removePlugin

Build.removePlugin介绍

暂无

代码示例

代码示例来源:origin: org.apache.maven/maven-project

public void removePlugin( Plugin plugin )
{
  build.removePlugin( plugin );
}

代码示例来源:origin: qoomon/maven-git-versioning-extension

@Override
public synchronized void execute() throws MojoExecutionException {
  try {
    GAV gav = GAV.of(currentProject.getModel());
    getLog().debug(gav + "remove plugin");
    currentProject.getOriginalModel().getBuild().removePlugin(asPlugin());
    File gitVersionedPomFile = new File(currentProject.getBasedir(), GIT_VERSIONED_POM_FILE_NAME);
    getLog().debug(currentProject.getArtifact() + " replace project pom file with " + gitVersionedPomFile);
    ModelUtil.writeModel(currentProject.getOriginalModel(), gitVersionedPomFile);
    currentProject.setPomFile(gitVersionedPomFile);
  } catch (Exception e) {
    throw new MojoExecutionException("Git Versioning Pom Replacement Mojo", e);
  }
}

代码示例来源:origin: com.atlassian.maven.plugins/maven-amps-plugin

/**
 * 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);
  }
}

代码示例来源:origin: org.jboss.forge/forge-dev-plugins

private void removeShadePlugin()
{
 MavenCoreFacet mvn = project.getFacet(MavenCoreFacet.class);
 Model pom = mvn.getPOM();
 pom.getBuild().removePlugin(getPlugin(pom));
 mvn.setPOM(pom);
}

代码示例来源:origin: com.paypal.butterfly/butterfly-utilities

@Override
protected TOExecutionResult pomExecution(String relativePomFile, Model model) {
  TOExecutionResult result = null;
  String details;
  Plugin plugin = getPlugin(model, groupId, artifactId);
  if (plugin != null) {
    model.getBuild().removePlugin(plugin);
    details = String.format("Plugin %s:%s has been removed from POM file %s", groupId, artifactId, relativePomFile);
    result = TOExecutionResult.success(this, details);
  } else {
    details = String.format("Plugin %s:%s has not been removed from POM file %s because it is not present", groupId, artifactId, relativePomFile);
    switch (ifNotPresent) {
      case Warn:
        result = TOExecutionResult.warning(this, new TransformationOperationException(details));
        break;
      case NoOp:
        result = TOExecutionResult.noOp(this, details);
        break;
      case Fail:
        // Fail is the default
      default:
        result = TOExecutionResult.error(this, new TransformationOperationException(details));
        break;
    }
  }
  return result;
}

代码示例来源:origin: com.atlassian.maven.plugins/amps-maven-plugin

if (null != globalJavadoc)
  executionEnvironment().getMavenProject().getBuild().removePlugin(globalJavadoc);

相关文章