Javadoc not working

Discussion in 'Spigot Plugin Development' started by Moddingear, May 12, 2016.

  1. Verified 4 times, reinstalled Eclipse.
    Am I the only one for who it doesn't works ?

    It used to work, but not anymore.
     
  2. Show your Maven setup if you're using Maven.
    Make sure you have the API and not the server jar.
     
  3. Doesn't work for me anymore either, hasn't for a couple of weeks or more.
     
  4. MiniDigger

    Supporter

    try using an real ide ;)
     
    • Like Like x 1
  5. I've finally decided to switch 100% to IntelliJ. Life is so much better now :p
     
  6. MiniDigger

    Supporter

    ikr. Did the switch like 2 months ago.
     
    • Like Like x 1
  7. Netbeans Master race! :p
     
    • Winner Winner x 1
  8. MiniDigger

    Supporter

    atleast its not eclipse, thats all positive I can say about nb ^^
    Nah jk, its fine
     
    • Funny Funny x 1
  9. In my opinion convenience of ide's are listed in like this(One being best, 3 being not so great)
    1. IntelliJ(although I haven't used it, I have heard it is great)
    2. Eclipse(What I use)
    3. Netbeans(Used to use it(around 2 years ago) but isn't very user friendly IMO)

    This is just my opinion, everyone is entitled to their own opinion. (idek)
     
  10. MiniDigger

    Supporter

    strange that you rate nb under eclipse. I need to use eclipse every day at more and use intellij at home, I used nb quite a while and I can say, that eclipse realy has some problems. Often it doesn't want to compile stuff and mark lines red, when there is no reason for that at all. thats just frustrating. but lets not start a ide battle here ^^
     
  11. someone find jarcode....
     
    • Agree Agree x 1
  12. Well, maybe Nb has improved over two years xD. Other than the annoying extra red lines and having to restart eclipse after moving projects to another folder fifty million times, I find eclipse ok xD
    Maybe we should create a thread called The debate of IDEs
     
  13. MiniDigger

    Supporter

  14. IntelliJ idea with eclipse key map
     
  15. Please do not hijack threads with mean comments. It's disrespectful, dismissive, crowds out constructive and helpful responses, and degrades the quality of public discourse. Basically, them's fightin words, and fighting is not helpful. At best, it's useless noise here. More likely, it's hurtful.

    Thank you.

    I spent yesterday afternoon sorting this issue out and here's what I found.

    It appears the Javadoc site is sending HTTP 403 Forbidden responses to requests with a user agent field that begins with the string "Java/1.". Eclipse's user agent string seems to default to Java's because Eclipse is a Java program itself. My installation apparently reports its user agent as "Java/1.7.0_02", for example.

    I do not know if this filtering is intentional or not, but it means using https://hub.spigotmc.org/javadocs/spigot/ (or bukkit, whatever) as the Javadoc location for spigot-api (or bukkit, whatever) won't work in an IDE that reports its user agent as Java.

    If your project uses Maven, there is a very simple solution that is probably smarter anyway because it'll be sure to show you the right version Javadoc for the version of spigot-api (or bukkit, whatever) you're building against.

    For Maven projects, the solution is to have Maven download the Javadoc archive for the dependency if one is available.

    A quick definition: to attach Javadoc to a dependency means to tell the IDE "use [some location] when getting Javadoc for this resource."

    Method A: Enable Automatic Javadoc Download and Attachment for all Maven Project Dependencies
    The way I solved it was to enable automatic downloading and attachment of Javadoc for all Maven project dependencies. If this seems a little overkill, check out Method B below.
    1. I made sure my project's POM has the spigot maven repository listed in the repositories tag:
      HTML:
      <project [...]>
          [...]
          <repositories>
              [...]
              <repository>
                  <id>spigot-repo</id>
                  <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
              </repository>
              [...]
          </repositories>
          [...]
      </project>
      There are other URLs that work for the repository. The one listed here is the one recommended by the Spigot Maven wiki page though.
    2. In the Maven tab of the Window->Preferences dialog, I checked "Download Artifact JavaDoc" (screenshot).
      I also checked "Download Artifact Sources" because I like the option of getting into things to see how they work.
    3. I had to clear the "Javadoc Location path" field in the properties of the spigot-api dependency, which I'd previously filled with the URL to the online Javadocs (screenshot).
      When the "Javadoc Location path" field is not blank for a dependency, it overrides the "Download Artifact JavaDoc" option set in the previous step.
    4. I forget if I needed to do the Update Project thing, but if it does need to be done, right click on the project's name in the Project Explorer, then select Maven->Update Project... (screenshot).
    It'll take a while to download the Javadoc archives (and source archives if that option is also ticked), because it's downloading them for all of the dependencies it can (and their dependencies, and their dependencies, etc). But I'm pretty sure the long wait is a one-time thing: once they're downloaded, they're downloaded. A bonus of this automatic method is you'll then have Javadoc attached for loads of things you never had it for before.

    Method B: Download and Attach Javadoc for One Dependency on Demand
    1. Do steps 1 and 2 above, then right-click the spigot-api (or bukkit, whatever) dependency in the project's "Maven Dependencies" subnode and select Maven->Download JavaDoc (screenshot).
      I haven't tried it myself, but I think it'll work. It'll probably download the JavaDoc from the repo and attach it.

    There are other solutions too, but because I use Maven for my projects, this is by far the most appropriate solution I can think of.
     
  16. I don't get how @MiniDigger is hijacking the thread? He just said 'Try using a real ide expressing his opinion that eclipse isn't that good. Can u please explain how he is 'hijacking'
     
  17. MiniDigger

    Supporter

    because my comment lead to a discussion about IDEs.
    But if you need to go thru that much steps to set it up in eclipse, you should really consider switching
     
  18. Use emacs

    Sent from my SGH-I747M using Tapatalk
     
  19. Me too (but from like 1 month), I think it's a problem of eclipse. I will never change ide, I hate the key combo of intellij and I don't like netbeans.

    Inviato dal mio SM-G930F utilizzando Tapatalk
     
  20. MiniDigger

    Supporter

    intellij has a option to switch to eclipse key combs ^^