14 Replies Latest reply: Apr 14, 2011 4:24 PM by henk de boer RSS

JBoss AS 6 source archive misses lots of sources?

henk de boer Master

Hi,

 

As it appears, the source archive for JBoss AS 6 seems to miss lots and lots of sources. As an example I tried attaching the source for the bundled JSF implementation (Mojarra 2.0.3), but it simply wasn't there.

 

With JBoss AS 5 it was already very difficult to attach sources, since you had to hunt in the source archive to find them instead of being able to do a single attach, but at least they were there.

 

Apparently I know have to find out what versions of what JBoss AS 6 bundles, and then go to different places to search for the source and download it there.

 

See also this post in the JBoss tools forum: http://community.jboss.org/message/576798#576798

 

Is this really the idea or am I missing something? The current situation makes the ability of easily attaching all source for the entire AS really difficult.

  • 1. Re: JBoss AS 6 source archive misses lots of sources?
    Peter Johnson Master

    Not sure if this is what you are looking for, but if you open a command line at the source base directory and enter:

     

    mvn dependency:sources

     

    then the source packages for all dependencies that have them will get downloaded into your local Maven repository. Not as convenient as in 5.x and earlier where such sources appeared in thirdparty (after running the build), but still workable.

  • 2. JBoss AS 6 source archive misses lots of sources?
    arjan tijms Novice

    Is there a workaround for this for people who don't use maven?

     

    Would it be a lot of trouble for someone at JBoss to run this command and then package it up and publish it on sourceforge? If this would be merged with the current source archive, then we would pretty much have the same situation as in 5.x and earlier.

  • 3. JBoss AS 6 source archive misses lots of sources?
    Peter Johnson Master

    Some observations:

     

    1) Everyone who downloads the source and builds it uses Maven - it comes with the source and is used for the build. (look in the tools directory)

     

    2) There are a lot of third-party libraries used by JBoss AS. Including them in the package would significantly increase the size of the download. The build (which downloads the third-party binaries) plus the download of the sources took about 2-3 hours on my PC.

     

    3) Even in prior releases (4.0.x, 4.2.x, 5.x) not all sources shipped in the package - you had to do a build and the build downloaded the binaries and sources for the stuff that appeared in thirdparty. And a lot of JBoss-developed code appears in thirdparty.

  • 4. JBoss AS 6 source archive misses lots of sources?
    arjan tijms Novice

    The ultimate goal is of course that a user can download jboss-as-bin.tar.gz and jboss-as-src.jar. Then go to Eclipse, right click on the run time server, choose attach source, then point to jboss-as-src.jar.

     

    This would then result that every jar that the runtime server contributes to the classpath has a source attachment.

     

    Most people have little interest in building JBoss AS, but during debugging of their own code that runs on JBoss AS you now very often step into code that is supplied by JBoss AS and doesn't have a source attachment. This is a pain to work with.

  • 5. JBoss AS 6 source archive misses lots of sources?
    jaikiran pai Master

    Please create a JIRA here https://issues.jboss.org/browse/JBAS so that it can be tracked.

  • 6. JBoss AS 6 source archive misses lots of sources?
    henk de boer Master

    Peter Johnson wrote:

     

    1) Everyone who downloads the source and builds it uses Maven - it comes with the source and is used for the build. (look in the tools directory)

     

    In this case what I was looking for is not building JBoss AS, but just having the source available when I debug my applications that run on JBoss AS. It's mostly just the equivalent of src.zip that ships with the Oracle JDK (I know this also misses some internal Sun packages).

     

     

    3) Even in prior releases (4.0.x, 4.2.x, 5.x) not all sources shipped in the package - you had to do a build and the build downloaded the binaries and sources for the stuff that appeared in thirdparty. And a lot of JBoss-developed code appears in thirdparty.

     

    I attached a lot of sources, but most things were really actually there. JPA (Hibernate), JSF (Mojarra), Servlet (Tomcat, Jboss web), JMS (JBoss messaging). Maybe not all sources where there, but in practice I could always find what I was looking for.

     

    Please create a JIRA here https://issues.jboss.org/browse/JBAS so that it can be tracked.

     

    Was this JIRA ever created? If not, shall I create it or is everything now totally different with AS7?

  • 7. JBoss AS 6 source archive misses lots of sources?
    Peter Johnson Master

    henk de boer wrote:


    In this case what I was looking for is not building JBoss AS, but just having the source available when I debug my applications that run on JBoss AS.

    I think that there is a build goal that will only download the third-party source (i.e., the sources for all of the dependencies) and not perform the compiles and tests. At least, I vaguely recall that goal appearing in a post a while back.

  • 8. JBoss AS 6 source archive misses lots of sources?
    henk de boer Master

    Peter Johnson wrote:

     

    I think that there is a build goal that will only download the third-party source (i.e., the sources for all of the dependencies) and not perform the compiles and tests. At least, I vaguely recall that goal appearing in a post a while back.

     

    I could indeed check that out. Is it legal from someone from the community to package up whatever maven downloads (including the jboss 'core' sources) and make that available for download somewhere?

  • 9. JBoss AS 6 source archive misses lots of sources?
    Peter Johnson Master

    You need to double-check the licenses for each of the components whose sources you post but I think that most of the components use either Apache 2.0 or LGPL 2.0, so hosting the sources somewhere should not be a legal issue.

     

    However, I would personally be hesitant in counting on the sources that you post, mainly because I would always be wondering if the sources you posted really matched the code I was running. But maybe that is just me. Perhaps if I used the often enough and found them to be accurate, I would use them more. But it would take only one mismatch to cause me to abandon your posted sources.

  • 10. JBoss AS 6 source archive misses lots of sources?
    henk de boer Master

    Peter Johnson wrote:

     

    However, I would personally be hesitant in counting on the sources that you post, mainly because I would always be wondering if the sources you posted really matched the code I was running.

     

    I agree with that. It would be more trustworthy if JBoss themselves posted such an archive.

     

    There are only a small amount of binary builds of JBoss AS and someone (or something) at JBoss has created these builds. It should be exactly clear what went into a given binary build and just archiving the sources of that should not be the most difficult thing in the world.

  • 11. JBoss AS 6 source archive misses lots of sources?
    Peter Johnson Master

    And actually with a simple Maven assembly configuration, gathering all of the sources and packaging them into a zip or tar.gz would be a simple one-line command. I'm surprised the JBoss team hasn't provided that because as you have pointed out the existing source download is practically useless because of the large number of missing sources.

  • 12. JBoss AS 6 source archive misses lots of sources?
    jaikiran pai Master

    henk de boer wrote:

    Please create a JIRA here https://issues.jboss.org/browse/JBAS so that it can be tracked.

     

    Was this JIRA ever created? If not, shall I create it or is everything now totally different with AS7?

    I don't think anyone created it. So please go ahead and create one. I don't see a source download for AS7 too, so the JIRA will be applicable for AS7 too.

  • 13. JBoss AS 6 source archive misses lots of sources?
    Peter Johnson Master

    The more I think about this the more I think that m2eclipse should be handling this automatically. For example, when I create a Maven web project within Eclipse, m2eclipse should ask which server I will deploy to. From there, it should be able to figure out the dependencies for the servlet API and such from the JBoss Maven repository. That simple reference alone should cause m2eclipse to download the source (and even javadoc) JARs for the servlet JAR and link them al into Eclipse so that you can easily view the source code. Ditto for any other dependencies that I add to my project (JSF, Hibernate, etc.) This mechanism would provide the necessary sources without requiring the developer to have to download the app server source file.

  • 14. JBoss AS 6 source archive misses lots of sources?
    henk de boer Master

    Peter Johnson wrote:

     

    Ditto for any other dependencies that I add to my project (JSF, Hibernate, etc.) This mechanism would provide the necessary sources without requiring the developer to have to download the app server source file.

     

    The problem being of course that not all projects are Maven projects. Many surveys (e.g. the Eclipse one, the Zero Turnaround one) put Maven usage between 30% en 50%, meaning this approach would be useless for 50% to 70% of all Java developers.

     

    From your description it seems this will download the source of those libraries your project explicitly depends on, but what if I want to step into JBoss internals? Will the source of all of this also be downloaded? E.g. maybe I only have a very basic Servlet project, but there might be something going wrong during startup that makes me want to step into some JBoss deployer.

     

     

    jaikiran pai wrote:

     

    I don't think anyone created it. So please go ahead and create one. I don't see a source download for AS7 too, so the JIRA will be applicable for AS7 too.

    Thanks, I will create one then.