Skip to main content



      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
Eclipse UserFriend
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?
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
Eclipse UserFriend
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 messageGo to next message
Eclipse UserFriend
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,
Re: Ant - Target does not exist in this project [message #1767505 is a reply to message #831802] Thu, 06 July 2017 10:52 Go to previous message
Eclipse UserFriend
I am still seeing the same issue. My eclipse installation:

Eclipse Java EE IDE for Web Developers.

Version: Neon.3 Release (4.6.3)
Build id: 20170314-1500

Previous Topic:AERI NullPointerException
Next Topic:Shell Script(DLTK)
Goto Forum:
  


Current Time: Tue Mar 18 10:50:58 EDT 2025

Powered by FUDForum. Page generated in 0.07163 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top