aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes How to set the sourcepath for classes in ant-project Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "How to set the sourcepath for classes in ant-project" Watch "How to set the sourcepath for classes in ant-project" New topic
Author

How to set the sourcepath for classes in ant-project

Andy Jung
Ranch Hand

Joined: Feb 07, 2010
Posts: 150
Hi,

When using Roel's great ant-project in order to generate the javadocs I encounter the following problem:
documentation using annotation @Override and {@inheritDoc} is not performed when applied to subclasses
of classes that don't origin in my own project.
For this to happen I have to include these foreign sources to the sourcepath property.
How can I do this (including the sources of Sun's standard API)?
How to extend the following ant-property dir.source in order to have the sourcepath-variable properly set?



Kind regards,
Andy


SCJP, SCJD
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 4926
    
  10

For this to happen I have to include these foreign sources to the sourcepath property.
Which foreign sources are you talking about? You should reference nothin more than classes from the latest SDK.


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Andy Jung
Ranch Hand

Joined: Feb 07, 2010
Posts: 150
Roel De Nijs wrote:You should reference nothin more than classes from the latest SDK.

And thats exactly what I actually want to do (foreign = not my classes in my own project = latest SDK).

But that's the problem, only my classes can be referenced correctly not the ones in the latest SDK.
But as said before this is only the case when using @Override and {@inheritDoc}.
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 4926
    
  10

When I use my own Ant build script javadoc is automatically generated for classes from the latest SDK.

For example this code (from 1 of my classes):

results in the following javadoc:
hashCode

public int hashCode()

Overrides:
hashCode in class Object


Kind regards,
Roel
Andy Jung
Ranch Hand

Joined: Feb 07, 2010
Posts: 150
I think this is because you use the Eclipse-IDE ?
At work I use this too and I don't have problems with this either.
For the assignment I use NetBeans IDE and get those problems.
But actually I thought this is a matter of the doclet and not a matter of the IDE?

But anyways, thanks for the great ant-script you provided, it probably saved me a lot of time and maybe life, we'll see

Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 4926
    
  10

Andy Jung wrote:I think this is because you use the Eclipse-IDE ?
That's the one I use, simply the best!
Dick Smith
Greenhorn

Joined: Jan 23, 2009
Posts: 22
I ran the ANT script via Eclipse. Eclipse lets you configure ANT. Hope this helps.


SCJD6 (390/400), SCWCD5 (79%) & SCJP6 (80%)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to set the sourcepath for classes in ant-project
 
Similar Threads
Ant X JavaDoc
Ant X JavaDoc
Ant does not output property file in classes folder.
Deploying With Ant Using Websphere3.5
only default is working!