【问题标题】:How to change gwt out files path in the war in the gradle script如何在gradle脚本中更改war中的gwt out文件路径
【发布时间】:2017-08-04 15:43:47
【问题描述】:

我正在使用 gwt 在我的应用程序中生成几个 js 文件。 我正在使用 Gradle 构建我的战争文件。 以下是我的 build.gradle 文件中的重要 sn-ps:

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'gwt'
apply plugin: 'war'
apply plugin: 'java-library'

sourceSets {
  main {
    java {
        srcDirs=['src']
    }
  }
}

gwt {
    gwtVersion='2.8.0'
    modules 'com.wf.idc.facade.IdcFacade'
    modulePathPrefix = "/"

    maxHeapSize = "1024M"

    }

war {
  println 'building war'
  archiveName('IdcAdmin.war')
  destinationDir(file('dist'))

  from("src") {
    include '*.properties'
    into ('WEB-INF/classes')
  }

  from("web") {
    include 'login'
    include 'images'
    into ('/')
      }

  from("web") {
    include '*/*.*'
    include '**.*'    
    into ('/')
  }

  from("metadata/WEB-INF") {
    include '*.xml'
    into ('WEB-INF')
  }

}

buildscript {
    repositories {
        maven {
        url 'http://artifactory.wf.com/artifactory/idc_maven_deploy_virtual'
        credentials {
            username = "${artifactory_user}"
            password = "${artifactory_password}"
        }
    }

}
dependencies {
    //Check for the latest version here: http://plugins.gradle.org/plugin/com.jfrog.artifactory
    classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4+"
    classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
    }
}

war 创建后,gwt 文件会在根目录下的“com.wf.idc.facade.IdcFacade”文件夹中创建。

com.wf.idc.facade.IdcFacade/gwt

com.wf.idc.facade.IdcFacade/*.js 文件

我想要gwt文件夹和根目录下生成的所有js文件以及WEB-INF、META-INF级别。

我该怎么做?

【问题讨论】:

    标签: gradle gwt path war


    【解决方案1】:

    正如我的 build.gradle 文件设置的那样,它们可以满足您的需求:

    war {
            archiveName 'app.war'
    }
    
    gwt {
            gwtVersion= '2.8.0'
    
            modules 'com.test.app.App';
            devModules 'com.test.app.AppDev';
            maxHeapSize = "1G";
    
            superDev {
                    noPrecompile = false;
                    failOnError = false;
                    bindAddress = "0.0.0.0";
            }
    
            compiler {
                    strict = true
                    enableClosureCompiler = false;
                    disableClassMetadata = false;
                    disableCastChecking = true;
            }
    }
    

    希望对你有帮助。

    【讨论】:

      猜你喜欢
      • 2018-08-03
      • 2018-07-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-15
      • 1970-01-01
      • 1970-01-01
      • 2019-02-16
      相关资源
      最近更新 更多