0

I have 3 different packages, let's say :

com.pack.*
com.package.commons.*
com.package.app.*

The thing is, these 3 packages are in the same source folder and I can't move them.

  • My com.pack is completely independant, let's say it's my framework.
  • My com.package.commons can import classes from com.pack ONLY.
  • My last package can import whichever classes it needs.

In my eclipse project everything is thing as long as I'm the only one to develop, I know I can't import anything without checking first where it comes from. But I work in a team and errors happen frequently, I've tried to make an Ant Build that will first build my framework then my commons (with the framework in it's CP during build time) and lastly my app. But I can't get any error from it. Do you have any idea how I can perform these checks during build time or any other solution?

thanks

EDIT: I can't split in 3 projects even if it would be lot easier I know that!

4

1 回答 1

0

为什么不把项目分成三个eclipse项目呢?如果一个包是完全独立的,那么(在我看来)它不属于那个项目。这也适用于您的 package.common 包。当它是一个库项目时,它可以被分离,从而隐含地解决你的“单独构建”问题。

至于错误,我不能很好地理解你。你的意思是什么类型的错误?当项目被分成几个具有依赖关系的项目时,也会产生导入错误(例如包之间的可见性)。

于 2012-04-27T10:49:29.103 回答