Question: let me describe the situation first and then I will aks my question. 

I have a very generic module A. It consist of one c and one h file. The only dependency it has is to stdint.h file. 

There is also module B using module A (#include "module\_A.h"). 
There is another module C also using module A. 
Both B and C modules has dependency to module A "managed" via svn:externals property to make sure anyone using module B or C has also module A checked out. 

Modules B and C are pretty unrelated to each other. 
During the development of some project it happened that both modules B and C were needed. 
Svn:externals properties have been set in the project to get those modules into project directories. 
And now we have in project directory structure something like that: 

```
src/module_B/module_B.c
src/module_B/module_B.h
src/module_B/module_A/module_A.c
src/module_B/module_A/module_A.h

src/module_C/module_C.c
src/module_C/module_C.h
src/module_C/module_A/module_A.c
src/module_C/module_A/module_A.h

```

The compiler detects duplicated definitions of functions and stops compilation with errors. 

We use Eclipse to develop. 

Question 1. How to solve such problem? 

Question 2. If we dig deeper into this topic we might imagine a situation that module A has several revision and module B and C are pointing to different revisions of module A. How to solve such problem?

Answer: 
Have you considered generating the shell scripts from Ant? The [`<pathconvert>` task](http://ant.apache.org/manual/Tasks/pathconvert.html) can create a classpath from a `<fileset>`.

You can create an Ant target for each kind of shell script you want. `make` can then call these Ant targets to generate the shell scripts.
I think the solution to your problem is to create an executable jar. Something that can be run as follows:

```
java -jar myapp.jar

```

"look ma, no classpath" :-)

The secret is add the "Main-Class" and "Class-Path" entries into the jar's manifest file. This tells java what to run and which jars should be loaded onto the classpath:

```
<jar destfile="${jar.file}" basedir="${classes.dir}">
    <manifest>
        <attribute name="Main-Class" value="${jar.main.class}" />
        <attribute name="Class-Path" value="${jar.classpath}" />
    </manifest>
</jar>

```

To assist in creating the classpath, ANT has a really useful [manifestclasspath](http://ant.apache.org/manual/Tasks/manifestclasspath.html) task:

```
<manifestclasspath property="jar.classpath" jarfile="${jar.file}">
    <classpath>
        <fileset dir="${dist.dir}/lib" includes="*.jar"/>
    </classpath>
</manifestclasspath>

```

So using this example, at run-time java will expect the depedencies to reside in a "lib" subdirectory (the task will generate relative links).

Eclipse integration is tricky. A better approach for managing your classpath is to use a dependency manager like [ivy](http://ant.apache.org/ivy/), which has an Eclipse plugin. In this way both ANT and Eclipse use the same mechanism for controlling build dependencies.

Finally for a complete working example take a look at:

* [Class not found with Ant, Ivy and JUnit - error in build.xml?](https://stackoverflow.com/questions/15979391/class-not-found-with-ant-ivy-and-junit-error-in-build-xml/15982144#15982144)

Hope this helps.