Tuesday, August 7, 2012

How to generate Redmine WAR application to run with Java

If you survey around Java open source land, it's really disappointing in not able to find a decent project management web app that we can use. The Java war file deployment in an app server is easy to use, and it would give us good performance. Especially if we already in a Java shop, having a project management tool that deploys in an existing app server would be easier to maintain.

I have found the Ruby's Redmine to be a very good ONE-STOP-SHOP for most of your project development need. It has nice clean web interface, and the features are loaded: projects, users, issue tracking, wiki, source control viewer, documents, and it even has time tracking.

Altough the application is written in Ruby on Rails, you can run this with the JRuby perfectly fine on any Java app server. I've just done this and able to run it on JBossAS7.1.0 with jruby-1.6.7.2 and redmine-2.03.

For the impatients, you can actually grab my generated redmine-2.0.3.war from my sandbox. I even provided an MySQL sql dump for you to get started without have to go through the building the war file. If you want to change the DB or any other settings, you can simply unpack the war file and edit the config files, then re-jar the war backup. This is still easier than building the war from scratch.

Here is how I build the war file. First step is setup a database. I picked MySQL.

mysql> create database redmine character set utf8;
mysql> create user 'redmine'@'localhost' identified by 'redmine123';
mysql> grant all privileges on redmine.* to 'redmine'@'localhost';

Then prepare the Redmine with JRuby. Download the redmine-2.0.3.zip and unzip and then cd into this directory. Then run the following:

$ $JRUBY_HOME/bin/gem install bundler
$ $JRUBY_HOME/bin/bundle install --without development test rmagick postgresql sqlite
$ cp config/database.yml.example config/database.yml
$ # edit config/database.yml
$ # type in your database connection info for "production" env.
$ $JRUBY_HOME/bin/rake generate_secret_token
$ RAILS_ENV=production $JRUBY_HOME/bin/rake db:migrate
$ RAILS_ENV=production $JRUBY_HOME/bin/rake redmine:load_default_data

Now create the war file.

$ $JRUBY_HOME/bin/gem install warbler
$ $JRUBY_HOME/bin/warble config
$ # edit config/warble.rb
$ # replace: config.dirs = %w(app config lib log vendor tmp extra files)
$ # add: config.gems += ["activerecord-jdbcmysql-adapter", "jruby-openssl", "i18n", "rack"]
$ $JRUBY_HOME/bin/warble

After this, you will see redmine-2.0.3.war in the directory. Now you can drop it into any app server and you may kick start any projects!

2 comments:

  1. Nice blog has been shared by you. it will be really helpful to many peoples who are all working under the technology.thank you for sharing this blog.
    Project Management

    ReplyDelete
    Replies

    1. IEEE Final Year projects Project Center in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation. For experts, it's an alternate ball game through and through. Smaller than expected IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble. <Final Year Projects for CSE It gives you tips and rules that is progressively critical to consider while choosing any final year project point.

      JavaScript Training in Chennai

      JavaScript Training in Chennai

      The Angular Training covers a wide range of topics including Components, project projects for cseAngular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

      Delete