EclipseWtpFacet

API 文档EclipseWtpFacet

允许对 Eclipse 插件的 WTP Facet 详情进行微调

高级配置闭包 beforeMerged 和 whenMerged 接收 WtpFacet 对象作为参数。

plugins {
    id 'war' // or 'ear' or 'java'
    id 'eclipse-wtp'
}

eclipse {
  wtp {
    facet {
      //you can add some extra wtp facets or update existing ones; mandatory keys: 'name', 'version':
      facet name: 'someCoolFacet', version: '1.3'

      file {
        //if you want to mess with the resulting XML in whatever way you fancy
        withXml {
          def node = it.asNode()
          node.appendNode('xml', 'is what I love')
        }

        //beforeMerged and whenMerged closures are the highest voodoo for the tricky edge cases.
        //the type passed to the closures is WtpFacet

        //closure executed after wtp facet file content is loaded from existing file
        //but before gradle build information is merged
        beforeMerged { wtpFacet ->
          //tinker with WtpFacet here
        }

        //closure executed after wtp facet file content is loaded from existing file
        //and after gradle build information is merged
        whenMerged { wtpFacet ->
          //you can tinker with the WtpFacet here
        }
      }
    }
  }
}

属性

属性描述
facets

将作为元素添加的 facets。

file

请参阅 EclipseWtpFacet.file(org.gradle.api.Action)

方法

方法描述
facet(args)

添加一个 facet。

file(action)

允许进行高级配置,例如修改输出 XML 或影响现有 WTP facet 文件内容与 Gradle 构建信息的合并方式。

脚本块

描述
file

允许进行高级配置,例如修改输出 XML 或影响现有 WTP facet 文件内容与 Gradle 构建信息的合并方式

属性详情

List<Facet> facets

将作为元素添加的 facets。

示例请参阅 EclipseWtpFacet 的文档

使用 eclipsewar 插件时的默认设置
Java 和 web facets。

方法详情

void facet(Map<String, ?> args)

添加一个 facet。

如果已存在具有给定名称的 facet,则其版本将被更新。

对于 "jst.ejb" facet,它也将被添加为固定 facet。

示例请参阅 EclipseWtpFacet 的文档

void file(Action<? super XmlFileContentMerger> action)

允许进行高级配置,例如修改输出 XML 或影响现有 WTP facet 文件内容与 Gradle 构建信息的合并方式。

示例请参阅 EclipseWtpFacet 的文档

脚本块详情

file { }

允许进行高级配置,例如修改输出 XML 或影响现有 WTP facet 文件内容与 Gradle 构建信息的合并方式

传递给 whenMerged{} 和 beforeMerged{} 闭包的对象类型为 WtpFacet

示例请参阅 EclipseWtpFacet 的文档

委托给
来自 fileXmlFileContentMerger