views:

238

answers:

3

Hi All,

I have added all common targets like (init,clean,getivy etc) in ./common/common.xml and added import file="${basedir}/common/common.xml" in build.xml.

When i build the project, its working fine.But, When i open build.xml in eclipse IDE , i see some "Red" marks underneath "targets" which has a dependency targets that are defined in common.xml. And when i do mouse over those Red marked targets, i see a message saying that "Target init does not exist in this project"

Can some one help me to figure it out.

thanks in advance.

--angrezy

Additional Information: "common" folder is added through svn:externals. Does this need extra configurations in eclipse.

A: 

Use the include path ${basedir}/common/common.xml because . is probably the directory in which Eclipse is installed.

Aaron Digulla
forgot to mention, i add import file="${basedir}/common/common.xml" in build.xml
Angrezy
I have a common directory included as an svn:external. Nearly the same setup as you. My build file is simply: <project name="ProjectName" default="package"> <import file="common/build/common-targets.xml" /> </project>What ANT runtime are you using within eclipse. I am using 1.7.1.v20090120-1145
Steve
Ah, yes, the Ant runtime could have an effect. Other than that, I'm stumped.
Aaron Digulla
A: 

If your build.xml, and the common directory are at the same directory level then just try

<import file="common/common.xml" />

This works for me fine.

What version of eclipse are you using?

Steve
I tried that one too.In either of the cases i am able to build the project, but why eclipse is not recognizing the common targets when i open build.xml.I am using Eclipse ganymede 3.4.2 I also tried in galileo
Angrezy
A: 

I found a post online here where someone found a workaround. You just need to make the file import not the first line in the ant build file. If you put it after a property declaration for instance the error goes away. This worked fine for me and eclipse is happy now.

Jeremy T