Forge - Repository and How To
adamw May 25, 2005 2:57 PM1. 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/.