Reputation: 4704
Can we specify multiple source locations as we can in ant build files in an eclipse java project. For example I have the following directory structure:
src1/com/mycompany/myproject/mypackage/*
src2/com/mycompany/myproject/mypackage/*
Java Files in both src folders have the package name as com.mycompany.myproject.mypackage
.java
files from src1 use .java
files from src2 as well. However when I use my ant build xml file to import the project in eclipse only a single src is found under the project's Properties->Resource->LinkedResources
can be found and the other source location is ignored. Is this a bug in eclipse? Or am I doing something wrong?
Upvotes: 2
Views: 2044
Reputation: 4704
I did find a solution. Even though exporting directly from the ANT build file does not import from two locations we can do the following steps:
Right click project -> Build Path -> Link source -> Provide name and location of linked folder
This allows adding of a second folder with similar package structure and hence allows importing files. Hope this helps anyone with a similar problem.
Upvotes: 1
Reputation: 3153
You can add multiple source folders under the Source tab in Java Build Path of an Eclipse project. PROJECT_LOC refers to the location of the entire project, not its source folders. So you can point to the source folders using:
Upvotes: 0
Reputation: 9946
In Eclipse:
Right Click on your Project -> Build Path -> Configure Build Path.. -> Source Tab -> Add Folder ..
Hope this helps.
Upvotes: 1