10 Replies Latest reply on Oct 1, 2005 12:52 AM by Damon Sicore

    Forge - Repository and How To

    Adam Warski Master

      1. Checking projects out of the repository

      First, for committer access, you will need an account on our sandbox forge machine. Please send an email to damon.sicore@jboss.com to get an account.

      To check out the entire tree (as a committer), execute:
      svn checkout svn+ssh://username@forge.sicore.org/usr/local/forge/svn

      For anonymous access:

      svn co http://forge.sicore.org/forge/trunk


      Projects that we are currently working on are located in the $WC/trunk/forge subdirectory.

      Where $WC is your working copy directory.

      2. JIRA projects
      All of the paths are relative to jira-extensions.

      Before compiling and using the projects, you must put one jar into your repository. You can do this by executing:
      maven prepare-repo
      from the globalreports-plugins directory. Be sure that you have set the same value maven.repo.local for all projects. It is best to create a build.properties file in your home directory with one line:
      maven.repo.local=/path/to/your/local/repository.
      This jar includes some common code which global reports (that is, reports which span across a set of projects) use.

      Now, you should create a local build.properties file with values filled as indicated in the sample.
      After these preparations, you can:
      - execute "maven build-and-install", which will build all projects and install them in the jira build directory
      - execute "maven all-notest", which will do the same things as above and additionaly build a war file for jira and deploy it.

      3. Useful JIRA extensions
      Again, paths are relative to jira-extensions.

      - value-generators: these are just two classes (for now) which complement the value generators that are already built into JIRA (like versions generators, project generators, the new ones generate issue types and priorities) and can be used in value fields in a reports' configuration.

      - globalreports-plugins and globalreports-portlet: the first one defines a new type of plugins: global-report - it is a report, but it won't be displayed in the "Reports" section while browsing a project. This can be useful for reports that incorporate several projects. The new base class for such a report is com.atlassian.jira.plugin.globalreport.impl.AbstractGlobalReport. To display the reports on the dashboard you can use the portlet (there are several such reports on http://67.19.124.46:8080/jira).

      - multiselect: this enables you to use multiselect boxes in reports' configuration.

      4. JIRA tests
      All of the tests are JUnit test cases and to do the actuall testing I use HttpUnit (http://httpunit.sourceforge.net/) (to make any tests you need a "running" JIRA, so the only reasonable way to achieve this is to simulate browser behaviour in the code, otherwise you would need either to change the code of JIRA itself or write "mock" objects - to do tests that operate directly on objects generated by JIRA classes).

      All of the classes are in the junit-tests-adamw directory. The base class of all tests is pl.net.mamut.jira.AbstractJiraTest. There you can find some convenience functions - creating projects, issues, versions, logging in users etc (all have javadoc comments). To run the tests simply execute "maven test" (it runs tests that are included in classes named *Test.java, so if you want to add your test, just name if appropriately and place it in the src/java directory).

      The tests need some configuration: an URL to the main page of JIRA and two user logins and passwords. You can modify these properties to match your local configuration in the src/etc/pl/net/mamut/jira_tests.properties file.

      To run the tests locally, you should execute "maven all" from jira-extensions directory.

      5. Portal extensions
      Here, it is much simpler than with the JIRA extensions. You can do two things:
      - execute "maven bootstrap" which will copy some jars into your repository and build all of the extensions
      - execute "maven all" which will additionaly deploy the extensions to your JBoss server. To do this, you must specify some properties in your build.properties file, as in the sample file.

      As for now, there are some portlets in the repository (with forge- prefix), and some new portals (with portal- prefix).

      6. Build system
      The build process is controlled by Cruise Control. Every time when you commit some changes to the repository, they are automatically checked out and a build of jira or portal extensions is started. So any new extensions they you make are also automatically installed. A build of JIRA lasts about 20 minutes (because of the tests), and of portal extensions about 1 minute. You can see the status of the builds here:
      http://67.19.124.46:8080/cruisecontrol/.

        • 1. Re: Forge - Repository and How To
          Chris Rauschuber Newbie

          I'm getting this when I try to 'deploy-all' from portal-extensions:

          --- Incompletely deployed packages ---
          org.jboss.deployment.DeploymentInfo@763ccad3 { url=file:/Users/chris/jboss/jboss-4.0.2/server/default/deploy/jboss-portal.sar/ }
           deployer: org.jboss.deployment.SARDeployer@1a2cc7
           status: null
           state: FAILED
           watch: file:/Users/chris/jboss/jboss-4.0.2/server/default/deploy/jboss-portal.sar/META-INF/jboss-service.xml
           altDD: null
           lastDeployed: 1117430912143
           lastModified: 1117430838000
           mbeans:
          

          I would expect a jboss-service.xml in portal-extensions/portal-default/to-copy/jboss-portal.sar. Am I missing a build step?

          Chris

          • 2. Re: Forge - Repository and How To
            Adam Warski Master

            The default-portal extension is there just to replace the default-portal.xml file. I haven't written that, but it expects that in the deploy directory there's an exploded jboss-portal.sar directory. Do you have that in your configuration?

            • 3. Re: Forge - Repository and How To
              Chris Rauschuber Newbie

              Ah, I thought the portal was packaged with 4.0.2. Added that and now it works. Thanks!

              • 4. Re: Forge - Repository and How To
                Damon Sicore Novice

                Well, you will quickly find that there are issues with 4.0.2.

                We're working on those... but we'd like your input!

                • 5. Re: Forge - Repository and How To
                  Damon Sicore Novice

                  Couple of things that are missing (we really need a wiki on this):

                  1. Blojsom needs to be installed (or at least, an URL needs to be configured from which to pull the atom feed)
                  2. Different maven targets/goals need to be described.

                  • 6. Re: Forge - Repository and How To
                    Adam Warski Master

                    7. A more detailed description of maven portal-extensions build goals
                    - clean-all - cleans all projects - normally, this means deleting the "target" directory
                    - build-all - executes the build goal of all projects - but it doesn't do any cleaning before
                    - deploy-all - deployes all extensions, that is, calls the deploy goal of every project - note that it doesn't do a build
                    - prepare-repo - prepares the repository before building: copies libraries from the binaries directory; compiles and copies the forge-common.jar file
                    - all = prepare-repo, clean-all, build-all, deploy-all, in that order.

                    8. SVN Portlet properties
                    To use portlets, which read content from a SVN repository, you need to specify some parameters (which tell the portlets the address of the repository and location of a working copy).

                    Portlets which use SVN are for now: Docs, Downloads, Federation, JIRA, Projects.

                    The parameters you need to modify are in the portlet.xml fille:
                    - svnpath: URL of the used svn repository (this normally will be unchanged for Forge).
                    - localpath: Local path where a working copy can be checked out.

                    9. The blog portlet
                    To use this portlet, you will need blojsom's blog (available here: http://wiki.blojsom.com/wiki/display/blojsom/), or another source of atom feed. Each portal will get the feed from a blog that is named exactly the same as the portal. If you aren't using blojsom, or it is available from another address, you will have to change one parameter in portlet.xml:
                    - feedAddress - you can use three properties here: ${host.name}, ${host.port} and ${portal.name}, which will be replaced by appropriate values by the portlet.

                    If you would like to use the portlet in your portal, there are three ways to do it:
                    - just put it as a non-default portlet. When you click on an entry, the blog window will get maximized and the entry will be expanded
                    - use it as a default portlet - you then have to set the "org.jboss.portlet.blog.mainportlet" to "yes" in portal's .xml file (as, for example, in the default portal). With this setting, when clicking on entries, the window won't get miximized, but entries will be exanded and displayed in the same window.
                    - write a special blog page - it has to be named "blog" and the property "org.jboss.portlet.blog.specialpage" must be set to "yes" (as it is in the demo portal). This time, when you click on an entry, a special page will open, with a link to go back to the default one.

                    There are also some parameters which you can specify (in the portlet.xml file):
                    - headersNormal: Number of headers to display in a normal, not-main portlet. The following should be true: headersNormal <= showEntries+headersMaximized.
                    - showEntries: Number of entries to expand by default in a main page or maximized portlet.
                    - headersMaximized: Number of headers to display in a main page or maximized portlet.

                    • 7. Re: Forge - Repository and How To
                      Chris Rauschuber Newbie

                      There's nothing useful there yet, but there's a wiki page we can use for these instructions here:
                      http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossForgeDevelopment

                      Can someone that knows how everything works install from scratch and list the steps there? I had hoped to learn how on my own and document as I go, but I'm finding that I really don't know enough to do that yet.

                      Thanks,
                      Chris

                      • 8. Re: Forge - Repository and How To
                        Adam Warski Master

                        Hello,

                        "rauschuber" wrote:

                        Can someone that knows how everything works install from scratch and list the steps there? I had hoped to learn how on my own and document as I go, but I'm finding that I really don't know enough to do that yet.

                        I've written a small installation manual, it's in the docs - when you check out the project, go to the "docs" directory and run ant. You will have the docs in HTML in the build directory. I'll put it into the wiki later also. If you have problems, please write :).

                        --
                        Cheers,
                        Adam

                        • 9. Re: Forge - Repository and How To
                          Reid Pinchback Newbie

                          How do random JBoss users get a look at the Forge source? I grabbed Subversion from Tigris and installed it (on Windows XP). Then I tried:

                           svn co http://forge.sicore.org/forge/trunk
                          


                          as shown in adamw's initial posting, but all I ever get as a response is:

                           svn: PROPFIND request failed on '/forge/trunk'
                           svn: Could not open the requested SVN filesystem
                          


                          Never asked to login, just the two lines of error message. I'm not concerned with getting committer access, was just trying to get anonymous access so I could take a look at the work that has been done on Forge, particularly around integrating the JBoss portal.

                          Any help would be appreciated. Apologies in advance if I've fallen into a "stupid subversion newbie" pit.


                          • 10. Re: Forge - Repository and How To
                            Damon Sicore Novice

                            You're not losing your mind. We need to update the wiki pages for our repository.

                            Anonymous access is at:

                            http://anonsvn.labs.jboss.com

                            There's a /trunk, /qa, and /prod/forge. Any will do.

                            To get the latest, just check out:

                            svn co http://anonsvn.labs.jboss.com/trunk/forge

                            Cheers,

                            Damon