ruby-on-railsrakewarwarbler

Warble Custom war file name


I am using Wabler gem to generate the war file for our Ruby on Rails application. By default, it generates a WAR file named the Rails project home directory name by default.

I would like to know if it is possible to specify custom war file name instead of the default project home directory name.

Thanks Noman A.


Solution

  • Found answer to my question, so sharing with all who might need it.

    File to modify:

    warble.rb

    For our application, this resides inside [project_dir]/config/

    This file would have a section like:

     Warbler::Config.new do |config|
       .....
       .....
     end
    

    Add the following line to specify custom war/jar file name (without extension):

     config.jar_name = "testname"
    

    So, the segment would look like:

     Warbler::Config.new do |config|
       .....
       .....
       config.jar_name = "testname" 
     end
    

    Note: The "...." shown above are not part of the actual configuration, I have replaced original values for example purpose.

    Now, when I run warble war/ rake war, it generates war file as "testname.war"

    Hope this might help another newbie like me!

    Thanks

    Noman A.