玩! war命令-是否可以从应用程序/lib文件夹中排除某些jar [英] Play! war command - Is it possible to exclude certain jar from the application /lib folder

查看:97
本文介绍了玩! war命令-是否可以从应用程序/lib文件夹中排除某些jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试自动将Play应用程序部署为.war文件.

I'm trying to automate deployment of a play application as a .war file.

最后,该应用程序将在JBOSS AS7上运行. 我现在遇到的问题是,当我向JBOSS部署战争时,会遇到此异常.

In the end the application will be run on JBOSS AS7. The problem I'm running into right now is that when I deploy the war to JBOSS I get this exception.

14:52:39,728 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting  deployment of "my-test-app-server-0.0.2-SNAPSHOT.war"
14:52:43,822 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.deployment.unit."my-test-app-server-0.0.2-SNAPSHOT.war".PARSE: org.jboss.msc.service.Start 
Exception in service jboss.deployment.unit."my-test-app-server-0.0.2-SNAPSHOT.war".PARSE: Failed to process phase PARSE of deployment "my-test-app-server-0.0.2-SNAPSHOT.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_22]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_22]
    at java.lang.Thread.run(Thread.java:662) [:1.6.0_22]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to parse POJO xml ["/C:/jboss-as-web-7.0.2.Final/bin/content/my-test-app-server-0.0.2-SNAPSHOT.war/WEB-INF/lib/netty-3.2.5.Final.jar/META-INF/jboss-beans.xml"]
    at org.jboss.as.pojo.KernelDeploymentParsingProcessor.parseDescriptor(KernelDeploymentParsingProcessor.java:130)
    at org.jboss.as.pojo.KernelDeploymentParsingProcessor.parseDescriptors(KernelDeploymentParsingProcessor.java:104)
    at org.jboss.as.pojo.KernelDeploymentParsingProcessor.deploy(KernelDeploymentParsingProcessor.java:76)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
    ... 5 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[17,1] Message: Unexpected element '{urn:jboss:bean-deployer:2.0}deployment'
    at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:98) [staxmapper-1.0.0.Final.jar:1.0.0.Final]
    at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:59) [staxmapper-1.0.0.Final.jar:1.0.0.Final]
    at org.jboss.as.pojo.KernelDeploymentParsingProcessor.parseDescriptor(KernelDeploymentParsingProcessor.java:123)
    ... 8 more

我发现,如果我在将战争中的lib/netty-3.2.5.Final.jar文件手动部署到JBOSS之前将其删除,那么问题就消失了.

I found that if I manually remove the lib/netty-3.2.5.Final.jar file from the war before deploying it to JBOSS the problem goes away.

当我使用play war命令生成战争时,现在有办法做到这一点吗? 任何有关此的信息将不胜感激. 谢谢

Now is there a way to do this when I'm generating the war with the play war command? Any information on this would be much appreciated. Thanks

推荐答案

并不是我所知道的简单. play war命令允许您传递排除列表,我已从下面的python文件复制了注释.

Not that I am aware of simply. The play war command allows you to pass an exclude list, which I have copied the comments from the python file below.

~ To exclude some directories, use the --exclude option and ':'-separator (eg: --exclude .svn:target:logs:tmp).

但是,这表明它仅适用于目录.

However, this suggests it will only work for directories.

执行的命令是framework/pym/utils.py中的package_as_war,因此您可以破解该文件以专门删除该文件,但是显然,如果您更新Play版本,该命令将不向后兼容.

The command that is executed is package_as_war in framework/pym/utils.py, so you can hack that to specifically delete the file, but obviously this will not be backward compatible if you update your version of Play.

这篇关于玩! war命令-是否可以从应用程序/lib文件夹中排除某些jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆