org.gradle.api.tasks.bundling.War.getArchivePath()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(116)

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

War.getArchivePath介绍

暂无

代码示例

代码示例来源:origin: gradle.plugin.fish.payara.gradle.plugins/payara-micro-gradle-plugin

protected File getWar() {
  return ((War) project.getTasks().getByName(WarPlugin.WAR_TASK_NAME)).getArchivePath();
}

代码示例来源:origin: gradle.plugin.de.esoco.gwt/gwt-gradle-plugin

@TaskAction
public void exec() throws Exception {
  War warTask = (War) getProject().getTasks().getByName("war");
  jettyConf = new File(getProject().getBuildDir(), "gwt/conf/jetty-run-conf.xml");
  Map<String, String> model = new ImmutableMap.Builder<String, String>()
        .put("__WAR_FILE__", warTask.getArchivePath().getAbsolutePath())
        .build();
  ResourceUtils.copy("/stub.jetty-conf.xml", jettyConf, model);
  JavaAction jetty = execJetty();
  jetty.join();
}

代码示例来源:origin: Putnami/putnami-gradle-plugin

@TaskAction
public void exec() throws Exception {
  War warTask = (War) getProject().getTasks().getByName("war");
  jettyConf = new File(getProject().getBuildDir(), "putnami/conf/jetty-run-conf.xml");
  Map<String, String> model = new ImmutableMap.Builder<String, String>()
        .put("__WAR_FILE__", warTask.getArchivePath().getAbsolutePath())
        .build();
  ResourceUtils.copy("/stub.jetty-conf.xml", jettyConf, model);
  JavaAction jetty = execJetty();
  jetty.join();
}

代码示例来源:origin: GoogleCloudPlatform/app-gradle-plugin

private void createExplodedWarTask() {
 project
   .getTasks()
   .create(
     EXPLODE_WAR_TASK_NAME,
     ExplodeWarTask.class,
     explodeWar -> {
      explodeWar.setExplodedAppDirectory(explodedWarDir);
      explodeWar.dependsOn(WarPlugin.WAR_TASK_NAME);
      explodeWar.setGroup(APP_ENGINE_STANDARD_TASK_GROUP);
      explodeWar.setDescription("Explode a war into a directory");
      project.afterEvaluate(
        project ->
          explodeWar.setWarFile(
            ((War) project.getTasks().getByPath(WarPlugin.WAR_TASK_NAME))
              .getArchivePath()));
     });
 project.getTasks().getByName(BasePlugin.ASSEMBLE_TASK_NAME).dependsOn(EXPLODE_WAR_TASK_NAME);
}

代码示例来源:origin: com.google.cloud.tools/appengine-gradle-plugin

@Override
 public void execute(Project project) {
  // we can only set the default location of "archive" after project evaluation (callback)
  if (stageExtension.getArtifact() == null) {
   if (project.getPlugins().hasPlugin(WarPlugin.class)) {
    War war = (War) project.getProperties().get("war");
    stageExtension.setArtifact(war.getArchivePath());
   } else if (project.getPlugins().hasPlugin(JavaPlugin.class)) {
    Jar jar = (Jar) project.getProperties().get("jar");
    stageExtension.setArtifact(jar.getArchivePath());
   } else {
    throw new GradleException("Could not find JAR or WAR configuration");
   }
  }
 }
});

代码示例来源:origin: gradle.plugin.com.google.cloud.tools/jib-gradle-plugin

.create(EXPLODED_WAR_TASK_NAME, ExplodedWarTask.class)
      .dependsOn(warTask);
explodedWarTask.setWarFile(warTask.getArchivePath().toPath());
explodedWarTask.setExplodedWarDirectory(
  GradleProjectProperties.getExplodedWarDirectory(projectAfterEvaluation));

代码示例来源:origin: GoogleCloudPlatform/app-gradle-plugin

if (project.getPlugins().hasPlugin(WarPlugin.class)) {
 War war = (War) project.getProperties().get("war");
 stageExtension.setArtifact(war.getArchivePath());
} else if (project.getPlugins().hasPlugin(JavaPlugin.class)) {
 Jar jar = (Jar) project.getProperties().get("jar");

代码示例来源:origin: GoogleCloudPlatform/app-gradle-plugin

@Test
public void testDefaultConfiguration() throws IOException {
 Project p = new TestProject(testProjectDir.getRoot()).applyAppYamlWarProjectBuilder();
 AppEngineAppYamlExtension ext = p.getExtensions().getByType(AppEngineAppYamlExtension.class);
 DeployExtension deployExt = ext.getDeploy();
 StageAppYamlExtension stageExt = ext.getStage();
 assertEquals(new File(p.getBuildDir(), "staged-app"), stageExt.getStagingDirectory());
 assertEquals(
   testProjectDir.getRoot().toPath().toRealPath().resolve("src/main/appengine"),
   stageExt.getAppEngineDirectory().toPath());
 assertEquals(
   testProjectDir.getRoot().toPath().toRealPath().resolve("src/main/appengine"),
   deployExt.getAppEngineDirectory().toPath());
 assertEquals((((War) p.getProperties().get("war")).getArchivePath()), stageExt.getArtifact());
 assertFalse(new File(testProjectDir.getRoot(), "src/main/docker").exists());
 assertEquals("test-project", deployExt.getProjectId());
 assertEquals("test-version", deployExt.getVersion());
}

代码示例来源:origin: classmethod/gradle-aws-plugin

task.setKey(ebExt.getVersion().getKey());
if (warTask != null && ebExt.getVersion().getFile() == null) {
  task.setFile(warTask.getArchivePath());
} else {
  task.setFile(ebExt.getVersion().getFile());

相关文章