Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Ant - Target does not exist in this project(Error message when imports are done via macrodefs)
Ant - Target does not exist in this project [message #831802] Thu, 29 March 2012 07:22 Go to next message
Fat Bear Incorporated is currently offline Fat Bear Incorporated
Messages: 5
Registered: July 2010
Location: Raleigh, NC
Junior Member
In my ant code, imports are being done from inside a macrodef to facilitate a smarter import facility with other capabilities (e.g., importing a file via a package name that searches a set of import directories until one is found). So, I have essentially:

<myimport package="packagename" .../>

The problem is that Eclipse is marking target lines with red X's (errors) with the message "Target does not exist in this project":

<target name="main" depends="package.target"/>

This is because the target "package.target" is in one of the files imported via the <myimport> macrodef.

Is there any way to get Eclipse to stop identifying lines such as the above as errors?


Steve Amerige, Fat Bear Incorporated
Web Engineering | Graphic Design | Creative Marketing
Website, Java, and Source-Code Hosting

http://www.fatbear.com/logo.png
Re: Ant - Target does not exist in this project [message #832009 is a reply to message #831802] Thu, 29 March 2012 12:32 Go to previous messageGo to next message
Michael Rennie is currently offline Michael Rennie
Messages: 65
Registered: July 2009
Location: Canada
Member
This should be working. A trick to try can be to close + reopen the Ant editor - sometimes there are issues with reconciling the buildfile as edits are made.

If the close + reopen trick does not help you can file a bug against platform Ant. If you do file a bug please attach a complete example buildfile with all dependents, etc.
Re: Ant - Target does not exist in this project [message #950128 is a reply to message #831802] Fri, 19 October 2012 13:01 Go to previous message
Martin Lansche is currently offline Martin Lansche
Messages: 1
Registered: October 2012
Junior Member
I am seeing this behaviour with this simple set of scripts:

in nested.xml, I have:

<?eclipse.ant.import ?>
<project>

<target name="echo">
<fail message="Missing parameter [uid]" unless="uid"/>
<echo>Hello ${uid}</echo>

</target>
</project>

In including.xml, I have:

<project default="testincluding">

<include file="nested.xml" as="nested"/>

<target name="testincluding" depends="nested.echo"/>

</project>

Eclipse Platform

Version: 3.6.3.r362_v20110302-9gF78GsCFrIGnIGHpoPftwjnBiA8C-TZRswZYu
shows Red X on the
<target name="testincluding" depends="nested.echo"/>
line, saying that
Target nested.echo does not exist in this project.

Yet the ANT build runs as expected.

I am seeing the same behaviour on Eclipse 3.7.0

The version of ANT is 1.8.2, but that should not make a difference. I have configured my ANT_HOME to be the 1.8.2. The issue is not the execution of the script, but the flagging as error the included targets.

FWIW, if I change to
<import file="nested.xml" as="nested"/>
I also see a warning that
import doesn't support the "as" attribute.

TIA,
Previous Topic:Just need a quick help
Next Topic:eclipse-tomcat
Goto Forum:
  


Current Time: Sat Jul 26 07:24:11 EDT 2014

Powered by FUDForum. Page generated in 0.01616 seconds