gpt4 book ai didi

jakarta-ee - 在 grails 中创建耳朵

转载 作者:行者123 更新时间:2023-12-04 10:57:43 24 4
gpt4 key购买 nike

grails 支持创造 war 。但是是否有任何命令可以通过 grails 创建耳朵?

最佳答案

Grails 没有直接支持,但是这个 Gant 脚本可以完成这项工作。只需添加到 scripts/ dir 并作为 grails ear 调用.

脚本最初由 Graeme on mailing list 发布

includeTargets << grailsScript("_GrailsWar")

target(ear: "Creates an EAR file from a Grails WAR") {
war()
event("StatusUpdate", ["Building EAR file"])
generateApplicationXml()
def warDest = new File(warName).parentFile
def earFile = "${projectTargetDir}/${contextRoot}.ear"
ant.ear(destfile:earFile, appxml:appXml, update:true) {
fileset(dir:warDest, includes:"*.war")
}
event("StatusFinal", ["Done creating EAR $earFile"])
}
target(defineContextRoot:"defines the context root") {
contextRoot = "${grailsAppName}${grailsAppVersion ? '-'+grailsAppVersion : ''}"
}
target(generateApplicationXml:"Generates an application.xml file") {
depends(defineContextRoot)
def warDest = new File(warName)
appXml = "${projectTargetDir}/application.xml"
new File(appXml).write """\
<?xml version="1.0" encoding="UTF-8"?>
<application
xmlns=http://java.sun.com/xml/ns/j2ee
xmlns:xsi="http://www.w3.org/ 2001/XMLSchema-instance"
xsi:schemaLocation="http:// java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/ application_1_4.xsd"
version="1.4">
<display-name>${grailsAppName}</display-name>

<module>
<web>
<web-uri>${warDest.name}</web-uri>
<context-root>${contextRoot}</context-root>
</web>
</module>

</application>
"""
}

setDefaultTarget(ear)

关于jakarta-ee - 在 grails 中创建耳朵,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4872954/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com