Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Inherit Javadoc from sources outside own project fails
Inherit Javadoc from sources outside own project fails [message #134823] Wed, 14 January 2004 19:36 Go to next message
Eclipse UserFriend
Originally posted by: carsten.langer.nokia.com

Hi all,

I want to use the Javadoc feature for implicit and explicit (@inheritDoc)
inheriting Javadoc method comments for overridden methods as described by
the Javadoc documentation, chapter "Automatic Copying of Method Comments". I
want to generate the Javadoc for my project from within Eclipse
(Project/Generate Javadoc...), not with Ant.

It works fine if I override a method from my own sourcepath. However, if I
override a method from outside my own sourcepath, e. g. a method from the
JDK, I just get empty comments.

So far I analysed the reason for this to be:
- javadoc needs to know where the sources are where it should look up the
inherited comments, therefore the configuration parameter -sourcepath xxx is
needed.
- This -sourcepath xxx seems to be set by Eclipse automatically to the
project source path (Projects/Properties/Java Build Path/Source, checked
boxes) when javadoc is called. I found this out by letting Eclipse generate
Ant XML files for Javadoc.
- You can't give Javadoc another -sourcepath as an extra Javadoc option,
as -sourcepath is only allowed once.

Now I feel gotten stuck:
- If I wanted to inherit comments e. g. from JDK, I would need to put the
JDK source to the projects sourcepath - not a good idea, isn't it?
- I don't know wheter I can influence the -sourcepath set by Eclipse
otherwise.
- I can't give an extra -sourcepath configuration parameter.

Does anybody have a idea or solution on this?
(I feel Ant could do the trick, but as up to now I never needed to use Ant I
would rather like to keep it this way.)

Thanks
Carsten
Re: Inherit Javadoc from sources outside own project fails [message #135001 is a reply to message #134823] Thu, 15 January 2004 13:50 Go to previous messageGo to next message
Tom Crosman is currently offline Tom CrosmanFriend
Messages: 70
Registered: July 2009
Member
It's easily done.
In my ant.properties file I've added the following lines

jdk.api.docs=http://localhost:8080/jdk/api
junit.api.docs=http://www.junit.org/junit/javadoc/3.8.1
log4j.api.docs=http://jakarta.apache.org/log4j/docs/api

Then my java doc target in my build.xml looks like

<javadoc packagenames="*" sourcepath="${src.java.dir}"
destdir="${javadoc.dir}" author="true" private="true"
version="true" use="true"
header="<img src='/wapa/image/gswapa1.gif' />"
footer="" excludepackagenames="**/test/**/"
windowtitle="${ant.project.name} API Documentation"
doctitle="'rmr${ant.project.name}' Library API Documentation"
bottom="Created ${doc.time} for ${company.name}">
<classpath refid="classpath" />
<link href="${jdk.api.docs}" />
<link href="${junit.api.docs}" />
<link href="${log4j.api.docs}" />
</javadoc>



On Wed, 14 Jan 2004 20:36:26 +0100, "Carsten Langer"
<carsten.langer@nokia.com> wrote:

>Hi all,
>
>I want to use the Javadoc feature for implicit and explicit (@inheritDoc)
>inheriting Javadoc method comments for overridden methods as described by
>the Javadoc documentation, chapter "Automatic Copying of Method Comments". I
>want to generate the Javadoc for my project from within Eclipse
>(Project/Generate Javadoc...), not with Ant.
>
>It works fine if I override a method from my own sourcepath. However, if I
>override a method from outside my own sourcepath, e. g. a method from the
>JDK, I just get empty comments.
>
>So far I analysed the reason for this to be:
>- javadoc needs to know where the sources are where it should look up the
>inherited comments, therefore the configuration parameter -sourcepath xxx is
>needed.
>- This -sourcepath xxx seems to be set by Eclipse automatically to the
>project source path (Projects/Properties/Java Build Path/Source, checked
>boxes) when javadoc is called. I found this out by letting Eclipse generate
>Ant XML files for Javadoc.
>- You can't give Javadoc another -sourcepath as an extra Javadoc option,
>as -sourcepath is only allowed once.
>
>Now I feel gotten stuck:
>- If I wanted to inherit comments e. g. from JDK, I would need to put the
>JDK source to the projects sourcepath - not a good idea, isn't it?
>- I don't know wheter I can influence the -sourcepath set by Eclipse
>otherwise.
>- I can't give an extra -sourcepath configuration parameter.
>
>Does anybody have a idea or solution on this?
>(I feel Ant could do the trick, but as up to now I never needed to use Ant I
>would rather like to keep it this way.)
>
>Thanks
>Carsten
>
Re: Inherit Javadoc from sources outside own project fails [message #135052 is a reply to message #135001] Thu, 15 January 2004 16:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: carsten.langer.nokia.com

Hi,

thanks for the Ant XML file.
But I was looking for a solution without using Ant, so just with using
(Project/Generate Javadoc...) from within Eclipse. Any idea for this?

Carsten

"Tom" <tcrosman@wapa.gov> wrote in message
news:ab6d00lk7071nlmajfv72r45jojtjdgrcm@4ax.com...
> It's easily done.
> In my ant.properties file I've added the following lines
>
> jdk.api.docs=http://localhost:8080/jdk/api
> junit.api.docs=http://www.junit.org/junit/javadoc/3.8.1
> log4j.api.docs=http://jakarta.apache.org/log4j/docs/api
>
> Then my java doc target in my build.xml looks like
>
> <javadoc packagenames="*" sourcepath="${src.java.dir}"
> destdir="${javadoc.dir}" author="true" private="true"
> version="true" use="true"
> header="<img src='/wapa/image/gswapa1.gif' />"
> footer="" excludepackagenames="**/test/**/"
> windowtitle="${ant.project.name} API Documentation"
> doctitle="'rmr${ant.project.name}' Library API Documentation"
> bottom="Created ${doc.time} for ${company.name}">
> <classpath refid="classpath" />
> <link href="${jdk.api.docs}" />
> <link href="${junit.api.docs}" />
> <link href="${log4j.api.docs}" />
> </javadoc>
>
>
>
> On Wed, 14 Jan 2004 20:36:26 +0100, "Carsten Langer"
> <carsten.langer@nokia.com> wrote:
>
> >Hi all,
> >
> >I want to use the Javadoc feature for implicit and explicit (@inheritDoc)
> >inheriting Javadoc method comments for overridden methods as described by
> >the Javadoc documentation, chapter "Automatic Copying of Method
Comments". I
> >want to generate the Javadoc for my project from within Eclipse
> >(Project/Generate Javadoc...), not with Ant.
> >
> >It works fine if I override a method from my own sourcepath. However, if
I
> >override a method from outside my own sourcepath, e. g. a method from the
> >JDK, I just get empty comments.
> >
> >So far I analysed the reason for this to be:
> >- javadoc needs to know where the sources are where it should look up the
> >inherited comments, therefore the configuration parameter -sourcepath xxx
is
> >needed.
> >- This -sourcepath xxx seems to be set by Eclipse automatically to the
> >project source path (Projects/Properties/Java Build Path/Source, checked
> >boxes) when javadoc is called. I found this out by letting Eclipse
generate
> >Ant XML files for Javadoc.
> >- You can't give Javadoc another -sourcepath as an extra Javadoc option,
> >as -sourcepath is only allowed once.
> >
> >Now I feel gotten stuck:
> >- If I wanted to inherit comments e. g. from JDK, I would need to put the
> >JDK source to the projects sourcepath - not a good idea, isn't it?
> >- I don't know wheter I can influence the -sourcepath set by Eclipse
> >otherwise.
> >- I can't give an extra -sourcepath configuration parameter.
> >
> >Does anybody have a idea or solution on this?
> >(I feel Ant could do the trick, but as up to now I never needed to use
Ant I
> >would rather like to keep it this way.)
> >
> >Thanks
> >Carsten
> >
>
Re: Inherit Javadoc from sources outside own project fails [message #135908 is a reply to message #134823] Tue, 20 January 2004 16:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: carsten.langer.nokia.com

Hi all,

finally I found the solution myself. As javadoc command likes to have the
the path of the sources wherefrom to inherit comments given in
the -sourcepath argument, I put the external sources to the project source
path (Project/Properties/Java Build Path/Source). However, as these sources
are actually outside of my project, I set the exclusion filter to "*", so
nothing gets compiled from this source path.

Now I can create Javadoc that inherits from sources outside of my project
without using Ant.

Regards
Carsten


"Carsten Langer" <carsten.langer@nokia.com> wrote in message
news:bu5jo5$u86$1@eclipse.org...
> Hi all,
>
> I want to use the Javadoc feature for implicit and explicit (@inheritDoc)
> inheriting Javadoc method comments for overridden methods as described by
> the Javadoc documentation, chapter "Automatic Copying of Method Comments".
I
> want to generate the Javadoc for my project from within Eclipse
> (Project/Generate Javadoc...), not with Ant.
>
> It works fine if I override a method from my own sourcepath. However, if I
> override a method from outside my own sourcepath, e. g. a method from the
> JDK, I just get empty comments.
>
> So far I analysed the reason for this to be:
> - javadoc needs to know where the sources are where it should look up the
> inherited comments, therefore the configuration parameter -sourcepath xxx
is
> needed.
> - This -sourcepath xxx seems to be set by Eclipse automatically to the
> project source path (Projects/Properties/Java Build Path/Source, checked
> boxes) when javadoc is called. I found this out by letting Eclipse
generate
> Ant XML files for Javadoc.
> - You can't give Javadoc another -sourcepath as an extra Javadoc option,
> as -sourcepath is only allowed once.
>
> Now I feel gotten stuck:
> - If I wanted to inherit comments e. g. from JDK, I would need to put the
> JDK source to the projects sourcepath - not a good idea, isn't it?
> - I don't know wheter I can influence the -sourcepath set by Eclipse
> otherwise.
> - I can't give an extra -sourcepath configuration parameter.
>
> Does anybody have a idea or solution on this?
> (I feel Ant could do the trick, but as up to now I never needed to use Ant
I
> would rather like to keep it this way.)
>
> Thanks
> Carsten
>
>
Re: Inherit Javadoc from sources outside own project fails [message #135921 is a reply to message #135908] Tue, 20 January 2004 16:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: smesh.openrules.com

> I set the exclusion filter to "*",
> so nothing gets compiled from this source path.

You are lucky that the filter is related to the compilation only z:)

Sam Mesh - http://openrules.com
It's better to view source code than comments to it.
Javadoc ant absolute path problem (was Re: Inherit Javadoc from sources outside own project fails) [message #136717 is a reply to message #135001] Fri, 23 January 2004 11:41 Go to previous message
Thomas Maier is currently offline Thomas MaierFriend
Messages: 117
Registered: July 2009
Senior Member
Hi gurus,

I have the problem that, when I let eclipse generate an ant file to make
my javadoc, it generates absolute pathnames for the classpath, like

classpath=" bin:/home/thm/Apps/Eclipse-3.0M5/plugins/org.eclipse.core.re sources_3.0.0/resources.jar:[...] "

(only one entry shown).

Which is of course not the best thing when checking this in and let
other people check it out. Is there any way to put relative paths in
there? I tried removing that "/home/thm/Apps/Eclipse-3.0M5/" prefix but
that did not do the job. Yes, I have never used ant before :).

I have also tried using
<classpath refid="classpath" />
from Tom's ant file without knowing what it does. I hoped it referenced
Eclipse's classpath but ant only terminated with

"Reference classpath not found."

TIA, Thomas.

Tom wrote:
> It's easily done.
> In my ant.properties file I've added the following lines
>
> jdk.api.docs=http://localhost:8080/jdk/api
> junit.api.docs=http://www.junit.org/junit/javadoc/3.8.1
> log4j.api.docs=http://jakarta.apache.org/log4j/docs/api
>
> Then my java doc target in my build.xml looks like
>
> <javadoc packagenames="*" sourcepath="${src.java.dir}"
> destdir="${javadoc.dir}" author="true" private="true"
> version="true" use="true"
> header="<img src='/wapa/image/gswapa1.gif' />"
> footer="" excludepackagenames="**/test/**/"
> windowtitle="${ant.project.name} API Documentation"
> doctitle="'rmr${ant.project.name}' Library API Documentation"
> bottom="Created ${doc.time} for ${company.name}">
> <classpath refid="classpath" />
> <link href="${jdk.api.docs}" />
> <link href="${junit.api.docs}" />
> <link href="${log4j.api.docs}" />
> </javadoc>
>
--
Thomas Maier <Thomas.Maier@uni-kassel.de>
Previous Topic:Adding library support
Next Topic:ASTVisitor and FieldDeclaration
Goto Forum:
  


Current Time: Thu Nov 07 05:02:59 GMT 2024

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

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

Back to the top