Version 2

    When debugging some Java application (JBoss AS server, for instance) using Eclipse, one of the following three cases can happen:


    • Eclipse finds a source file



    This happens when Eclipse finds an archive containing source attachments.

    The JBoss Source Lookup plugin doesn't work anything in this case.



    • Eclipse can't find any source, but can find the archive in which a class file is placed



    The editor action from the JBoss Lookup Source plugin tries to find a source file as follows:


    The JBoss Source Container (getJars) isn't active in any of these cases.


    This happens if a class file is placed in the classpath of the launch configuration   (within the Server Runtime classpath included in the project's classpath, for instance).


      • using the m2e API
      • using the archive's metadata
      • using a Nexus indexer (the sha1 query)


               A user can disable/enable, add/remove,  change Nexus repositories using the JBoss Source Lookup preferences.



    • Eclipse can't find any archive containing a class file



    This happens if a class file is placed in an archive that is not in the classpath of the launch configuration.



    As to JBoss AS, that can be an archive that is not included in a JBoss AS Runtime Container  or

    if a JBoss AS Runtime Container isn't included in the project's classpath  (it is often that JBoss AS Runtime Container  isn't included in a maven project).


    The JBoss Source Container (getJars) is active in this case only.

    It scans JBoss AS home directory (or some other directory that a user enters when debugging Glassfish, Tomcat, running a Java Application, a JUnit test ...),

    finds all archives (a file with *.jar suffix) and tries to find a class in some of those jars.  If it finds the class in an archive,

    the JBoss Source Lookup plugin tries to find the archive's source in the way described above.


    getJars() will be called only if there isn't any other way  to find binary file in which the class file is.

    For one source container, getJar() will be called only once during a debug session. The archive list within a source container is cached.


    For more details, see JBoss Source Lookup.