• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Javadoc not generating @version

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have specified a version tag like so:



However, it will still display in the browser as:



If I specify an actual version instead of %I%, then it displays the version.

I am generating this javadoc from the command line, not from an IDE. I am also using the -version switch.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Charles,

I had to puzzle for a bit to figure out what you were talking about, but a visit to the Javadoc man page revealed this:


The Java Software convention for the argument to the @version tag is the SCCS string "%I%, %G%", which converts to something like "1.39, 02/28/97" (mm/dd/yy) when the file is checked out of SCCS.



Ah! SCCS is an (old-fashioned!) source-code version control system, like CVS, Perforce, Subversion, SourceSafe, etc. If you put "%I%, %G%" into a text file and then store that file in SCCS, when you check it back out, SCCS will expand the text to the file version and date, as shown; the checked out file will no longer contain the "%I%" stuff, but the actual version number. Javadoc will then dutifully use the expanded text to produce documentation. Nowhere in the Javadoc documentation does it mean to imply that Javadoc uses this syntax for anything -- it does not!

Some other version control systems have similar magic tags; for instance in RCS or CVS, you can use "$Id$" to do something very similar.

In any case, if you're not using one of those source-code control systems, then just use an explicit version -- if you feel such a thing would be meaningful.
 
Charles Owen
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It would make sense that these tags would have to be used in conjunction with a version-control system. How else would you know what version you're dealing with? Something needs to store the versioning somewhere.

I have both CVS and Subversion installed with my Netbeans IDE, so I will give it a whirl there.

Thanks for the info.
 
reply
    Bookmark Topic Watch Topic
  • New Topic