Jump to content
We've recently updated our Privacy Statement, available here ×

  • sameernori
    • Version: v6.1, v6.0, v5.6, v5.5, v5.2, v5.1, v5.0 Product: JasperReports® Server

    Here is a set of instructions on how to build JasperReports Server source code. 

    There are 2 ways to build JasperReports Server Community Edition:

    • directly with sources from subversion from Jaspersoft community
    • from the source package, that can be downloaded from JasperReports Server > Releases section. For detailed instructions please also refer to the TIBCO JasperReports Server Source Build Guide for additional information. The most current Source Build Guide can be downloaded from the downloads area too.

    Getting Source from Public SVN

    Sources can be checked out from http://code.jaspersoft.com/svn/repos/jasperserver. Depending on your requirements, there are different options for which revision to use:

    • trunk
    latest version of code
    • tags/lastSuccessfulBuild-trunk-ce
    latest version of code that successfully built and past all automated testing.
    • tags/lastReviewed-trunk
    lastest version of code that got reviewed by QA
    • tags/js-
    tag for a specific release of JasperReports Server community edition

     

    Example for svn via command line: 

    • To get a tagged source revision

      svn checkout --username anonsvn --password anonsvn 
                   http://code.jaspersoft.com/svn/repos/jasperserver/tags/lastReviewed-trunk jasperserver
      
    • To get the trunk source:

      svn checkout --username anonsvn --password anonsvn
                   http://code.jaspersoft.com/svn/repos/jasperserver/trunk jasperserver
      

    Sources retrieved via IDE/SVN UI client 

    Point the svn client to the desired repository, enter credentials:

    • username:
    anonsvn
    • password:
    anonsvn

    and checkout the sources.

    Getting Source from the Downloads Area

    For major releases, we include a source code package as a zip file. You can check the downloads area and look for a file like jasperserver-cp-{version}{ver}-src.zip. (Click the Release menu item for the downloads area.)

    Pre-Requirements for Source build

    To build JasperReports Server, you will need to following tools:

    • Java JDK 1.6+ (recommeded: 1.7)
    • Apache Ant 1.8.4+ (recommended: 1.9.4)
    • Apache Maven 3.0.4+ - 3.2.x

    To verify that appropriate versions are installed or to check the installation, run the following commands on command line. If the versions are matching the requiements above, you're good to go and build JasperReports Server.

    java -version
    ant  -version
    mvn  -version
    

    The JasperReports Server community source distribution comes with a pre-configured ant which contains all required libraries. If you check out JasperReports Server from the community, you will need to provide these libraries to your ant class path (e.g. /lib). The required additional ant module is ant-contrib library. It can be found in buildomatic/install_resource/extra-jars/ant-contrib-1.0b3.jar. The instructions below contain all ant commands utilizing jasperserver internal ant script js-ant, if you use a different ant version, replace this with the appropriate ant executable.

    Once JasperReports Server is built, you might want to deploy it. In order to run JasperReports Server you need
    • Application Server (ie Apache Tomcat 7)
    • Database Server (ie MySQL 5.5)

    A full list of supported platforms is available in the Jaspersoft Platform Support document available in the documentation section.

    Prepare to Build Source

    The JasperReports Server source code comes with a set of Ant scripts that can automatically configure the JasperReports Server source build with a single property file. These Ant scripts are known as the buildomatic scripts.

    Before building JasperReports Server, buildomatic needs to be configured in a properties file. To get started, copy a sample property file and configure it to match the environment: 

    There are two sample in buildomatic folder that can be used:

    • sample_conf/source/mysql_master.properties
    • sample_conf/source/postgresql_master.properties

    Example copy/rename:

    cd buildomatic
    cp sample_conf/source/mysql_master.properties  default_master.properties 
    

    Note: the file should be named "default_master.properties"

    Edit buildomatic configuration file

    You will need to add local settings to the default_master.properties file. Example Settings:

    appServerType    = tomcat7
    appServerDir     = /home/user/apache-tomcat-7.0.39
    dbType           = postgresql
    dbHost           = localhost
    dbUsername       = postgresdb
    Password         = postgres
    maven.build.type = community
    maven            = /usr/bin/mvn
    js-path          = /home/user/jasperserver
    

    Take a look at the sample files and at the JasperReports Server Source Build Guide pdf for additional options and documentation.

    Important: If you build a version earlier than JasperReports Server community 5.1, you will need to add an additional property js-repo-path:. This needs to point to the location where the required jars are stored in a maven repository. If you download the source distributiion it will be located in {jasperreports-server-sources}/jasperserver-repo. If you build directly from subversion, you need to checkout the maven repository too from http://code.jaspersoft.com/svn/repos/maven2.

    maven.build.type = repo
    repo-path        = /path/to/jasperserver-repo
    

    Build and Deploy JasperReports Server

    Note: If you would like to run the unit-tests, you will need to create the sample databases "foodmart" and "sugarcrm" (included in steps below). Note: You should have your database running in order to execute the unit-tests. Note: You should have your app server turned off before you deploy JasperReports Server.

    cd buildomatic
    
    ./js-ant gen-config
    ./js-ant add-jdbc-driver
    ./js-ant build-ce
    ./js-ant create-js-db
    ./js-ant create-sugarcrm-db          (for sample data)
    ./js-ant load-sugarcrm-db            (for sample data)
    ./js-ant create-foodmart-db          (for sample data)
    ./js-ant load-foodmart-db            (for sample data)
    ./js-ant update-foodmart-db          (for sample data)
    ./js-ant build-js-ddl-ce
    ./js-ant init-js-db-ce               (add schema to database)
    ./js-ant run-integration-tests-ce    (run tests, add core and sample data to DB - depends on sample DBs)
    ./js-ant deploy-webapp-ce            (deploy jasperReports server to your app server)
    

    Troubleshooting Problems

    You can take a look at the Trouble-Shooting Appendix C in the JasperReports Server Source Build Guide pdf for helpful hints. If you have trouble running the unit-tests you can load the "core" data by doing the following:

    ./js-ant import-minimal-ce
    

    And you can even load the sample data this way:

    ./js-ant import-sample-data-ce
    

    Logging into JasperReports Server

    You can now login to JasperReports Server via you web browser. The default administrator user is the following:

    Username:  jasperadmin
    Password:  jasperadmin

    You can login using the following example URL:

    http://localhost:8080/jasperserver

    Change Administrator Password

    You can change the password for the jasperadmin user by

    1. going to Manage > Users menu item
    2. Click on the jasperadmin user
    3. click the Edit button,
    4. and set the new password

    Additional Notes

    Buildomatic creates your Maven setup automatically. You can find your maven setup file at the following location:

    buildomatic/build_conf/default/maven_settings_community.xml

    There are other configurations present that allow custom maven configurations as well as maven configurations involving a central artifacts server. To utilize these, set the maven.repo.type property to the required value. (Applies to all version from 5.0)

    "build_conf" is the folder that is generated by buildomatic to automatically setup all your properties for jdbc URL, database connections, etc. A number of these configuration files get copied to your application server when the "deploy-webapp-ce" target is executed. Section 4 of the TIBCO JasperReports Server Source Build Guide has more information on how buildomatic works.

    If you have a mistake in your default_master.properties, you can edit the file and correct the error (ie incorrect path). Buildomatic will automatically regenerate your "build_conf" set of files next time you run a target.

    If you would like to explicitly reset your buildomatic auto-generated config files, you can run the following targets:

    ./js-ant clean-config
    ./js-ant gen-config
    

    Update note

    This page has been updated on May 1, 2013. If not mentioned otherwise root folder for all instruction is jasperserver.

    As of version 6.0.x of JasperReports Server client side java script handling is modified:

    • if sources are checked out from svn and build from there javascript resources are pulled in as maven dependencies. See <src>/jasperserver-war/pom.xml for details on artifact jrs-ui. In order to modify javascript resources, create an overlay for this archive.
    • if sources are downloaded from source bundle, javascript are unpacked into <src>/jasperserver-war/src/main/webapp. Any modifications can be performed directly in the folder.

    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...