Class duplication error (using code overwriting at build time)

I've got big and complex project in Eclipse. This project is deploying to several clients, each one of them has some differences in code logic, and our team use folowing technic:

We have one Base project. Each class that can be different for particular client is represented by two classes:


class _Cls {

//basic logic



class Cls extends _Cls { /*empty dummy class*/ }

all referneces in code are pointing to Cls and logic from _Cls is avaliable via inheritence.

Also we manage clients projects (one per each client). If we need to implement different logic in for this client we simply write it in in his project:


class Cls extends _Cls {

//some client specific logic


On build stage ant script do next steps:

  1. all classes from base project are copied to separate folder 'build'
  2. to folder 'build' copied all classes from client project, overwriting if file names mathces (class Cls with client logic overwrites empty base class Cls).
  3. compiling content of 'build' folder

This works perfectly in Eclipse, but when I decided to migrate from Eclipse to Idea, I found that it can not deal with two (one in Base project, second in Client project) showing me error about class duplicating.

The question is how to make our development technic works in Idea12?

Thanks a lot!

Please sign in to leave a comment.