什么是 org.eclipse.wst.common.component 以及如何将其用于 ant [英] what is org.eclipse.wst.common.component and how to use it for ant

查看:28
本文介绍了什么是 org.eclipse.wst.common.component 以及如何将其用于 ant的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 eclipse 工作区(用于工作),其中有一个 ear 项目,我用来将一个 ear 文件导出"/部署到 JBoss 服务器.

I have an eclipse workspace (for work) that has an ear project that I use to "export"/deploy an ear file to a JBoss server.

不过,最近他们让我创建一个可以构建工作区和创建耳朵的蚂蚁脚本,我已经成功地做到了.当我尝试用这个使用 ant 脚本构建的耳朵运行我的程序时,问题就出现了;对于部署,我只需复制生成的 ear 文件并将其粘贴到 JBoss/standalone/deployments 文件夹中并运行应用程序.

However, they recently asked me to create an ant script that can build the workspace and create the ear, and I have done this successfully. The problem arises when I try to run my program with this ear that was built using the ant script; for deploying I'm simply copying the resulting ear file and pasting it into the JBoss/standalone/deployments folder and running the application.

JBoss AS 启动良好,但随后出现了一些异常,这些异常导致我的应用程序停止运行,而在我通过 Eclipse 进行构建和部署时却没有遇到这些异常.使用 7zip 查看两个 ear 文件时,这两个 ear 文件是相同的,但是我在 eclipse 工作区中看到,ear 项目中有一个 .settings 文件夹,其中包含 4 个文件,其中一个是 org.eclipse.wst.common.组件,我猜这(如果不是全部 4 个文件)在以某种方式部署时是必需的.

The JBoss AS starts fine, but then I get a few exceptions that halt my application that I do not get when I do a build and deploy through eclipse. The two ear files are identical when viewing the two ear files using 7zip, however I see in the eclipse workspace, in the ear project, theres a .settings folder that has 4 files, one of them being org.eclipse.wst.common.component and I'm guessing this (if not all 4 files) is necessary when deploying somehow.

ecplise 部署耳朵时会使用这个 .settings 文件夹和里面的文件吗?在这个过程中会发生什么?以及如何在 ant 脚本中复制它,以便我的应用程序从 ant 或 eclipse 构建中以相同的方式运行?

Does ecplise use this .settings folder and the files inside when deploying an ear? What happens during this process? and how can I replicate it in an ant script so that my application runs identically from either ant or eclipse builds?

编辑

让我补充一点,.settings 文件夹中的所有文件都没有打包到 ear 文件中,所以我猜它们在 eclipse 进行构建/部署时以某种方式使用了,但它没有放在耳朵成品

let me just add that none of the files in the .settings folder get packaged up in the ear file, so I'm guessing they're somehow used when eclipse does a build/deploy, but it doesnt get placed in the final ear product

谢谢

推荐答案

Eclipse 使用 org.eclipse.wst.common.component 中的数据来确定部署所需的依赖项.该文件对应于 右键单击 EAR 项目时在 Eclipse 中找到的设置.属性 >部署程序集.

Eclipse uses the data in org.eclipse.wst.common.component to figure out the dependencies needed for deployment. The file corresponds to the settings found in Eclipse when Right-clicking on an EAR project > Properties > Deployment Assembly.

例如如果您的 EAR 项目依赖于 WAR 项目,则 Eclipse 知道在部署时包含 WAR,因为 Deployment Assembly 设置存储在 org.eclipse.wst.common.component

E.g. if your EAR project has a dependency on a WAR project then Eclipse knows to include the WAR when deploying because of the Deployment Assembly settings which get stored in org.eclipse.wst.common.component

在使用 Ant 构建 EAR 时,您需要手动添加这些依赖项(不依赖 Eclipse 元数据)

When building the EAR using Ant you need to add these dependencies manually (without relying on Eclipse metadata)

这篇关于什么是 org.eclipse.wst.common.component 以及如何将其用于 ant的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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