This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant target is not displaying results in eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant target is not displaying results in eclipse" Watch "Ant target is not displaying results in eclipse" New topic
Author

Ant target is not displaying results in eclipse

Grishma Dube
Ranch Hand

Joined: Jul 01, 2003
Posts: 275
I have a help target in my build.xml as follows -

<target name="help">
<java fork="no" classname="org.apache.tools.ant.Main">
<arg line="-projecthelp"/>
</java>
</target>

When I run this target from command prompt, it gives me a list of targets belonging to this build.xml but when I run same command from eclipse, it is not returning any result and just says build successful. It is not showing any error but not returning any results also. All other ant targets from this build.xml are running fine through eclipse only the help target mentioned above it having a problem.

Can anybody help me in resolving this issue.

Thanks,
Grishma
Balagopal Kannampallil
Ranch Hand

Joined: Oct 18, 2004
Posts: 136

Have you checked the build Targets and the classpath to include all the required jar files properly.


SCJP 5.0 and now fighting with ExtJS
Grishma Dube
Ranch Hand

Joined: Jul 01, 2003
Posts: 275
I checked the classpath but not sure what is missing exactly, since it is not throwing any error in eclipse but just shows "BUILD SUCCESSFUL".

So even though I am missing something, unable to get what is that.
Balagopal Kannampallil
Ranch Hand

Joined: Oct 18, 2004
Posts: 136

Are you running only the "help" target from eclipse or are you calling this "help" target from a default target?
Grishma Dube
Ranch Hand

Joined: Jul 01, 2003
Posts: 275
I am calling only help target and help is my default target also.
Balagopal Kannampallil
Ranch Hand

Joined: Oct 18, 2004
Posts: 136

Can you paste your complete build.xml inside a [code] tag so that we can investigate further?
Grishma Dube
Ranch Hand

Joined: Jul 01, 2003
Posts: 275


There are some other targets like build, which I cannot post here since these are very lengthy. But they are working fine.
Grishma Dube
Ranch Hand

Joined: Jul 01, 2003
Posts: 275
I am noticing a weird behavior in eclipse. Instead of -projecthelp, if I give arg line="-v", then it is correctly printing the version of ant on console but still not giving any result for -projecthelp.
Balagopal Kannampallil
Ranch Hand

Joined: Oct 18, 2004
Posts: 136

When run from the command prompt the class which you are providing is taken from the global path (If you have set the global ANT_HOME or included the jars in the path) but at the same time when you try to run it from eclipse, I think its not able to pick the class which you are providing, Are you able to see some errors when you turn on the fork and trying?
Balagopal Kannampallil
Ranch Hand

Joined: Oct 18, 2004
Posts: 136

Got it . Include the class path also in the target. I did something like this and its working

Grishma Dube
Ranch Hand

Joined: Jul 01, 2003
Posts: 275
Thanks Balagopal. It is working now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ant target is not displaying results in eclipse