0

我有一个要求,其中单个模块是使用 ant 构建的,并且 eclipse 应该使用生成的 jar 来打包 ear 并在 JBoss 服务器上发布。

我编写了构建依赖模块并放在 project/build/artifact 目录下的 ant 脚本。并使用该目录下的 jars 来提供 Java EE 模块依赖项。

如果在生成模块之后添加依赖项,则打包似乎工作正常。但是当另一个开发人员接受我的更改并尝试使其正常工作时,由于尚未创建模块,因此无法识别依赖模块。

构建模块并刷新项目工作区后,模块将被识别并添加到耳朵中。但是直到我假装修改组件文件(添加新行或空格并保存它 - 不是真正修改内容)并进行项目刷新并且它工作时才显示模块依赖关系。我在 eclipse 上搜索,看看这是否是一个现有的错误,但没有找到任何相关的错误。

我在这里做错了吗?这种方法是获取 ant 构建的模块并将它们用于打包耳朵并使用 eclipse 发布它的正确方法吗?请帮忙。

4

1 回答 1

1

This is likely a bug in WTP, but..

I would keep Ant and Eclipse builds away from each other. Use your Ant script to produce your "official" builds for production. During development do not try to feed result of Ant build into Eclipse build. Do this with direct project-to-project Java EE module dependencies instead.

The only time that it is really necessary to get Ant involved in the Eclipse build is when you need to integrated external compilers or code generators into the build process.

于 2011-02-08T02:33:36.710 回答