Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Jira Rev002


Published on

Published in: Technology
  • Be the first to comment

Jira Rev002

  2. 2. Trouble Ticketing <ul><li>There are also many trouble ticketing systems like Remedy, Trackit, and Jira that provide trouble ticketing support. </li></ul><ul><li>These slides will look at Jira because quoting Gartner: </li></ul><ul><li> “ A major part of its appeal is its high degree of configurability at an extremely low price point”. </li></ul><ul><li>I will add my quote “Its extremely easy to customize the code and to modify its internal workings to do specific tasks.” </li></ul>
  3. 3. Jira <ul><li>Jira, referenced from ), is a bug tracking, project management, and issue tracking software. </li></ul><ul><li>This product is not open source, but the source code is available, and many plugins are open source. </li></ul><ul><li>The main engine uses Open Symphony and XML to develop the workflow. </li></ul><ul><li>The GUI uses Apache Velocity and JSPs that are highly customizable. </li></ul><ul><li>The Engine executes itself in a Apache Tomcat Web Start environment using scripting. </li></ul>
  4. 4. Jira <ul><li>Jira provides an API to write directly into their product . </li></ul><ul><li>They also maintain plugins to the latest Java IDE environments for development, including NetBeans IDE and Eclipse. </li></ul><ul><li>The database schema that JIRA uses is also documented . </li></ul><ul><li>Jira plugins can be found at , and range from Active Directory, Crystal Reports, MS Project servers, to many customization tools. By using these plugins, users can create their own custom fields, screens and even charts. </li></ul><ul><li>The benefits of Jira are listed in their 2004 Software awards, . </li></ul>
  5. 5. Jira
  6. 6. Jira <ul><li>Jira is built using multiple Open Source Java frameworks. The most basic one to understand is its Web Container that starts Jira called Apache Tomcat. </li></ul>
  7. 7. Web Containers
  8. 8. Tomcat <ul><li>Tomcat is a Servlet and Java Server Pages Container developed by Apache, reference ) and . </li></ul><ul><li>It provides a Java HTTP Server to run Java code. </li></ul><ul><li>Catalina is Tomcat’s servlet container. </li></ul><ul><li>A servlet container a Java class that responds to HTTP requests. </li></ul><ul><li>A HTTP request is an HTTP page that will call Java code and execute an action running on the Tomcat Server. </li></ul><ul><li>The Tomcat server may be started with a startup script and use different ports so that many servers may be provide different services. </li></ul>
  9. 9. Benefits of Tomcat/Catalina <ul><li>Tomcat can run a web server by just starting the startup.bat or </li></ul><ul><li>It uses other scripts to setclasspath, start catalina shutdown. </li></ul><ul><li>A directory structure is used locally that can contain the classes, libraries, configurations, etc. </li></ul><ul><li>This way multiple tomcat server can be used in their own containment area, or directory, without affecting other instances of the Java Web Server. </li></ul><ul><li>The Tomcat Web Server is Operating System dependent, and does not require a formal installation or setup to be run. Only that the directory and its contents are copied over correctly. </li></ul><ul><li>Again, all of this is Open Source. </li></ul>
  10. 10. Tomcat Directory
  11. 11. Tomcat Directory <ul><li>bin  Directory containing the scripts and Tomcat JAR files. </li></ul><ul><li>conf  The properties and XML files that configure the server, including ports, Admin ports, database connections, etc. </li></ul><ul><li>lib  The supporting JAR files needed to run Tomcat. </li></ul><ul><li>logs  log files that are written during runtime and startup. </li></ul><ul><li>webapps  any WAR files that contain the web applications. WAR files are similar to JAR files except they also contain the Web pages, like JSPs and Servlets. This is where the Flex applications will be stored. </li></ul><ul><li>Reference </li></ul>
  12. 12. Jira has many of the same directories
  13. 13. Jira’s use of Tomcat <ul><li>Tomcat, and Catalina, will be the Web Server and Web Services that runs the Jira framework. </li></ul><ul><li>This means that application logging will be managed by the Server, JAR files, startup and shutdown scripts, class paths, and most of the directory structure will be managed and modeled after Apache Tomcat. </li></ul><ul><li>Jira is deployed with a version of Tomcat that it is tested against and is embedded in the Jira product. </li></ul>
  14. 14. Catalina <ul><li>Tomcat is the web server that presents HTML and Java Server Pages (JSP’s). </li></ul><ul><li>Catalina is the servlet code that responds on the server to server requests and sends its response in HMTL, JSPs and even XML. </li></ul><ul><li>A Servlet will receive a request and issue a response after processing the request. It may do a database lookup, call other code or many other tasks. </li></ul><ul><li>Catalina is a container that will pool, secure, and oversee these servlets as they are configured. The servlets are the binary code to be executed. </li></ul><ul><li>There is a Java Servlet protocol to be explored further at </li></ul>
  15. 15. JSP lifecycle
  16. 16. JIRA JSPs <ul><li>Jira has default JSP that are out of the box and associated Java Servets that are loaded in Tomcat from the atlassian-jira directory: </li></ul>
  17. 17. JIRA JSPs <ul><li>With some skill in JSPs, these pages can be re-written to be customized beyond out of the box Jira. Looking at the default.jsp, it basically redirects the page to the Dashboard, we could change the code to send it to home page first: </li></ul>
  18. 18. Startup
  19. 19. Tomcat <ul><li>As mentioned earlier, Jira is a Web Service running in Tomcat. </li></ul><ul><li>To start Jira is to start Tomcat. </li></ul><ul><li>The bin directory contains all the scripts for Tomcat/Jira. </li></ul><ul><li>Here’s a sample of some of the scripts: </li></ul>
  20. 20. Tomcat <ul><li>To start Tomcat/Jira, Linux will use “./” and Windows will use “startup.bat”. </li></ul><ul><li>To shutdown Tomcat/Jira, Linux will use “./” and Windows will use “shutdown.bat”. </li></ul><ul><li>The “/bin” directory contains the Tomcat/Catalina JARs and executables to start Tomcat, Catalina, and Jira. </li></ul>
  21. 21. Installing the JDK and JRE <ul><li>Tomcat, Catalina and Jira requires the Java Development Kit (JDK) and Java Runtime Environment (JRE) to run. </li></ul><ul><li>The JDK is used for development and has development libraries. </li></ul><ul><li>The JRE is simply for runtime. </li></ul><ul><li>To find out the JAVA_HOME for the JDK is set in LINUX, run: </li></ul><ul><li>It is set in the /etc/profile in UBUNTU: </li></ul>
  22. 22. Installing the JDK and JRE <ul><li>Test the Java and run “java –version”: </li></ul>
  23. 23. Java <ul><li>If Java is installed and working correctly, a lot of the work is done. </li></ul><ul><li>The point of Web Containers is to contain as much as the work in the container as possible and not interfere with the rest of the Operating system. </li></ul><ul><li>The Jira base directory, where Jira starts, will contain all the other JARs, pages, setups, configs, scripts, etc. In this case : </li></ul>
  24. 24. Tomcat like…. <ul><li>Jira uses some Tomcat defaults, and uses Tomcat to add its own flavor. </li></ul><ul><li>For instance, Tomcat will use the “conf” directory to define its configuration and Jira likes it: </li></ul>
  25. 25. Tomcat like…. <ul><li>The “server.xml” is very important. It will define the startup ports, the keystore file, the database location and login, and much more. </li></ul><ul><li>Here will we see the port is “8443”: </li></ul>
  26. 26. Keystore file <ul><li>The Java keystore file is a rudimentary file that contains code signing, encryption keys, certifications, and various other encryption pieces that Java uses in encrypted flat file format. </li></ul><ul><li>It can be managed with the Java “keytool.exe” and was developed well before protocols like LDAP were well established. </li></ul><ul><li>In Jira’s case, it is required to find it and possibly offload some code signing tasks. </li></ul>
  27. 27. Data Store <ul><li>The server.xml will also contain the connection information to the Jira database, like MySQL here: </li></ul>
  28. 28. Tomcat Unlike…. <ul><li>Normally Tomcat will contain WAR, Web Archive, files in the “webapps/Root/WEB-INF” directory. </li></ul><ul><li>Jira uses the “atlassian-jira/WEB-INF” directory instead. </li></ul><ul><li>The atlassian-jira/WEB-INF/lib”directory will contains most of the common libraries, plugins, language files, workflow and most of Jira’s libraries. This is the Jira pieces: </li></ul>
  29. 29. Jira Classes <ul><li>Besides the libraries (JARS) found in the previous slide, therse are many compiled classes, properties and xml files that will define how Jira works internally. </li></ul><ul><li>The non-library files will be in the “atlassian-jira/WEB-INF/classes”: </li></ul>
  30. 30. Jira Classes <ul><li>To add plugins to Jira is usually just adding a new JAR file, like WorkflowReport-1.3.1.jar, to the “atlassian-jira/ WEB-INF/lib” directory. In this example, new graphics are automatically added to show Jira workflow and configuration in the Jira GUI to support it. </li></ul><ul><li>For advanced functionality, a class could be created to debug this plugin as it runs, and the “” (logging) file can be changed to log it running, in the “atlassian-jira/WEB-INF/classes” directory. </li></ul><ul><li>This means that normally a plugin is just adding a file, but level of configurability can be taken to extreme by manipulating some of the class files and properties files that run Jira. </li></ul><ul><li>Let’s take it to the extreme and look at Jira workflow. </li></ul>
  31. 31. Jira Workflow
  32. 32. Jira Workflow <ul><li>Jira is made up of dozens of Open Source efforts, from the Web Server to logging, so why should its workflow not be open source. </li></ul><ul><li>Jira uses Open Symphony OSWorkfow for its workflow design. Found at . </li></ul><ul><li>In essence, the Jira default workflow will walk through a jira-workflow.xml file, found at “atlassian-jira/WEB-INF/classes”: </li></ul>
  33. 33. Jira Workflow <ul><li>The jira-workflow.xml will define the various workflows, what actions are allowed, and based on the actions, what Java classes will be called to perform those actions. </li></ul><ul><li>Many of the functions that can be done straight in code can also be done through the Jira GUI. For instance, the Administrator->Workflow Schemes will rewrite the jira-workflow.xml through its GUI. </li></ul>
  34. 34. Jira Workflow Scheme GUI
  35. 35. More Jira Workflow <ul><li>The jira-workflow.xml is the default Jira workflow, more workflows are created with more projects being added to the Jira server. </li></ul><ul><li>These new workflows follow the same OSWorkflow format but are now stored in the Jira Database defined in the server.xml. </li></ul><ul><li>The database workflows can be handcrafted from ) and </li></ul>
  36. 36. Jira Database
  37. 37. Jira Database <ul><li>Jira’s default database is the HSSQLDB (Hyper Structured Query Language Database) which is a relational database management system written in Java. See . </li></ul><ul><li>HSSQLDB is loaded at runtime of Jira through its JDBC Java Database Driver, so it does not persist information in a database that is already loaded into the Operating System like MySQL or SQL Server. Therefore, HSSQLDB is normally used in a development environment. </li></ul><ul><li>Where is the data saved? </li></ul><ul><ul><li>The configuration of the HSSQLDB is saved in the “database/” file. </li></ul></ul><ul><ul><li>The data of the HSSQLDB is saved in the “database/jiradb.script” file. </li></ul></ul>
  38. 38. HS SQL <ul><li>The HS SQL Jar file is located in the “common/lib” directory and the physical database is in the “database” directory, the HS SQL DB Manager can be called using “ java -cp common/lib/hsqldb- org.hsqldb.util.DatabaseManager -user sa -url jdbc:hsqldb:database/jiradb” : </li></ul>
  39. 39. Jira Database Backup <ul><li>Jira’s database data can be backed up and restored using the Jira backup tool: </li></ul>
  40. 40. Jira Database Backup <ul><li>Note to this tool, it will backup the standard data from the database, it will not backup any of the configurations from the files, any plugin information, any libraries, or anything else. </li></ul><ul><li>It will have the ticketing information, fields, screens, and workflows. </li></ul><ul><li>If changes are made to Jira after the backup, it may not match the database fields anymore, and those changes to Jira will have to be reversed to the last known good backup. </li></ul>
  41. 41. Jira MySQL Migration <ul><li>The easist way to migrate the Jira database from HS SQL to MySQL is to backup the HSSQL jiradb and restore the data into the MySQL database. </li></ul><ul><li>First, backup the Jira data and shutdown Jira. </li></ul><ul><li>Install MySQL from </li></ul><ul><li>Create the jiraddb: </li></ul><ul><ul><li>mysql> create database jiradb character set utf8; </li></ul></ul><ul><li>Create user “jirauser” password “XXXXXXXX” </li></ul><ul><ul><li>mysql> CREATE USER ‘jirauser’@’localhost’ IDENTIFIED BY ‘XXXXXXXX’; </li></ul></ul><ul><ul><li>mysql> GRANT ALL PRIVILEGES ON *.* TO ‘jirauser’@’localhost’ WITH GRANT OPTION; </li></ul></ul>
  42. 42. Jira MySQL Migration <ul><li>See and for help. </li></ul><ul><li>Ensure the Database was created: </li></ul><ul><li>mysql> show databases; </li></ul><ul><li>+--------------------+ </li></ul><ul><li>| Database | </li></ul><ul><li>+--------------------+ </li></ul><ul><li>| information_schema | </li></ul><ul><li>| jiradb | </li></ul><ul><li>| mysql | </li></ul><ul><li>| test | </li></ul><ul><li>+--------------------+ </li></ul><ul><li>4 rows in set (0.00 sec) </li></ul>
  43. 43. Jira MySQL Migration <ul><li>Set the server.xml to point to the MySQL database: </li></ul>
  44. 44. Jira is now empty data <ul><li>Jira no longer has its standard data and starts in a default mode. Even the access control is empty. Start Jira with a temporary administration: </li></ul>
  45. 45. Jira is now empty data
  46. 46. Jira is now empty data <ul><li>Keep going until the setup is complete: </li></ul>
  47. 47. Jira is now empty data <ul><li>Now restore the data and all the data should be restored including going back to the original access controls: </li></ul>
  48. 48. Jira is now empty data <ul><li>You are now using MySQL: </li></ul>
  49. 49. Looking through the schema <ul><li>Now that the database is MySQL, you can use the MySQL Workbench on the database, </li></ul>
  50. 50. Looking through the schema <ul><li>The Jira Schema is defined at : </li></ul>
  51. 51. Jira Logging
  52. 52. Jira Logging <ul><li>Jira uses Tomcat Logging and also Open Source freeware logging Apache library called log4j. and . </li></ul><ul><li>Many of the log4j and Catalina logs will be in the “logs” subdirectory: </li></ul>
  53. 53. Jira Logging <ul><li>The catalina.out will show many of the issues like environmental issues like Java path, plugins missing, etc, here is a normal startup: </li></ul>
  54. 54. Jira Logging <ul><li>The bin directory also contains a “atlassian-jira.log” that will show many of the Jira enviromental settings and concerns: </li></ul>
  55. 55. Jira Logging <ul><li>A normal “atlassian-jira.log”: </li></ul>
  56. 56. Jira SQL Logging <ul><li>Jira doesn’t use straight SQL calls to talk to the database, it uses a Open Source framework called Hibernate. ) </li></ul><ul><li>Knowing this is very helpful, especially in logging. If the restore of data does not work due to a change in the database table structure, logging levels can be set in log4j to log the SQL queries from Hibernate. </li></ul>
  57. 57. More Jira Frameworks
  58. 58. Jira Builds <ul><li>Jira uses another Apache Open source framework called Maven to build its code base as well as the plugins. Many pluigns and even some Jira code is available and Open Source. A section on Apache Maven will be given later. </li></ul>
  59. 59. Jira Templates <ul><li>Jira uses a lot of custom fields and custom screens defined in its database. It cannot use static JSPs because the code will have to change when dynamic fields are created. </li></ul><ul><li>Jira uses another Apache Open Source called Velocity for its Web templates, see and . </li></ul><ul><li>Velocity is the template engine that will read objects and create Web graphics dynamically based on the structure of the objects. </li></ul><ul><li>Most of the Velocity templates, defined as *.vm files can be founds in “atlassian-jira/template/standard” and atlassian-jira/WEB-INF/classes/templates”. </li></ul>
  60. 60. Jira IoC <ul><li>Many modern Java Architectures use Inversion of Control (IoC) which provides a consistent means building and managing Business objects using callbacks. </li></ul><ul><li>The most common is the Spring Framework, . </li></ul><ul><li>Jira 4.0 will support plugins using the Spring framework, but Jira is built with Pico Objects using the Open Source PicoContainer framework . </li></ul>
  61. 61. Customizing Jira IoC <ul><li>Yes, even the internal object factories inside Jira can be customized : </li></ul>
  62. 62. Apache Maven
  63. 63. What is it? <ul><li>Apache Maven 2 is a software tool for Java project management and build automation. </li></ul><ul><li>It uses a .pom file in XML form that will generate a configuration for pulling down libraries from Maven repositories, building the project and even testing the project with results. </li></ul><ul><li>See ,, and as a reference. </li></ul>
  64. 64. POM <ul><li>The Project Object Model (POM) is used in Apache Maven to describe the software project being built. </li></ul><ul><li>The POM can also be generated using IDE’s like NetBeans that will use a plugin to Maven to generate the files. </li></ul><ul><li>The POM files are in XML format. </li></ul>
  65. 65. POM Example <project xmlns=&quot;; xmlns:xsi=&quot;; xsi:schemaLocation=&quot;;> <modelVersion>4.0.0</modelVersion> <parent> <groupId></groupId> <artifactId>parent</artifactId> <version>1.0</version> </parent> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> </project>
  66. 66. Maven Directory structure <ul><li>Maven uses a predefined directory structure called a standard project structure. </li></ul><ul><li>The pom.xml will be stored in the project home directory which is the base directory for the file tree. </li></ul><ul><li>From this base directory, there will be a src and target directory: </li></ul>
  67. 67. Maven Directory structure <ul><li>The src/main/java directory is where the Java source code is stored. </li></ul><ul><li>The src/main/resources are where the application resources are stored like GIF files. </li></ul><ul><li>The src/main/config are where the configuration files are stored. </li></ul><ul><li>The src/main/webapp are where the web application WAR files are stored. </li></ul><ul><li>The src/test/java are where the Unit test files are stored. </li></ul>
  68. 68. Running Maven <ul><li>The “mvn” command is used to run maven. It must be executed in the project home directory. Here are some of the commands: </li></ul>
  69. 69. Conclusion
  70. 70. Jira, not Open Source Even though Jira is not Open Source, it has many, many people that are part of the coding community who discuss its internal working and has documented it. It also appears the ability to modify the internal workings of Jira and all of its components because most portions of the source code appear to be available from vendors wiki pages. Many of the frameworks that Jira utilizes are Open Source.