Gradle:在WAR中覆盖文件

时间:2016-09-22 16:41:06

标签: gradle

我正在尝试替换使用Gradle生成的WAR文件中的文件。

文件结构:

- nodes
  - staging
    - localConfig.yml
    - logback.groovy
- grails-app
  - conf
    - application.yml
    - logback.groovy

当我使用参数nodes/staging执行gradle脚本时,我想在最终WAR中将文件从WEB-INF/classes复制到-Pnode=staging

这是我的方法:

war {
    if (project.hasProperty('node')) {
        from("stacks/${project.node}") {
            include('localConfig.yml')
            include('logback.groovy')
            into('WEB-INF/classes')
        }
    }
}

此gradle脚本会将localConfig.yml复制到WEB-INF/classes,但不会替换logback.groovy

如何设置gradle来替换重复文件而不是保留原始文件?

1 个答案:

答案 0 :(得分:0)

我认为您需要使用classpath method添加到set long 32767 exec dbms_metadata.set_transform_param(dbms_metadata.session_transform, 'SQLTERMINATOR', true); select dbms_metadata.get_ddl('ROLE', granted_role) from dba_role_privs where grantee = 'USER'; select dbms_metadata.get_granted_ddl('SYSTEM_GRANT', granted_role) from dba_role_privs drp where grantee = 'USER' and exists ( select null from dba_sys_privs dsp where dsp.grantee = drp.granted_role ); select dbms_metadata.get_granted_ddl('OBJECT_GRANT', granted_role) from dba_role_privs drp where grantee = 'USER' and exists ( select null from dba_tab_privs dtp where dtp.grantee = drp.granted_role ); and then edit the output to change names and schema etc. as required. 例如:

WEB-INF/classes

或者

war {
    if (project.hasProperty('node')) {
        classpath "stacks/${project.node}/localConfig.yml", "stacks/${project.node}/logback.groovy"
    }
}