Jump to content
Changes to the Jaspersoft community edition download ×
  • This documentation is an older version of JasperReports Server Community Project Source Build Guide. View the latest documentation.

    The Ant-based buildomatic scripts contain support files for the setup and configuration of a number of databases and application servers. This chapter gives the locations of many of these files.

    Detailed Description of the deploy-webapp-ce Target

    The deploy-webapp-ce target performs the following actions in your application server environment:

    Deletes any existing jasperserver WAR file.
    Copies the JDBC driver to the appropriate application server directory.
    Copies additional JDBC drivers to the application server to support data source creation in the UI
    Adds a data source definition to the appropriate application server directory.
    Deploys the newly built jasperserver WAR file.
    Deletes files within the application server work directory (to clear out compiled JSP files and other cached files).
    On Tomcat, if present, deletes the old version of <tomcat>/conf/Catalina/Localhost/jasperserver.xml.

    Running Ant in Debug Mode

    Ant can be run with a -v (verbose) or a -d (debug) option to help with troubleshooting, for example:

    js-ant -v build-ce

    Regenerate Your Buildomatic Property Settings

    If you change your default_master.properties file, buildomatic will automatically clean and regenerate all configuration settings. If you want to explicitly clean and regenerate your settings manually you can run the following commands:

    Commands

    Description

    Clears the buildomatic/build_conf/default directory.

    Rebuilds the buildomatic/build_conf/default directory.

    note-icon-ns_28x28.png.88cf9b76b8f99c11eb13b20affd7334b.png

    Any time you modify the default_master.properties file, configuration settings are automatically re-generated into the buildomatic/build_conf/default folder.

    Using Your Own Apache Ant: Get ant-contrib.jar

    If you prefer to use your own version of Apache Ant, get the file ant-contrib-1.0b3.jar. This JAR enables conditional logic in Ant scripts.

    1. Make sure you're using Apache Ant 1.9.4 or higher.
    2. Copy the file ant-contrib-1.0b3.jar from the <js-src>/apache-ant/lib folder to your <ant-home>/lib folder:

    From:

    <js-src>/apache-ant/lib/ant-contrib.jar

    or

    <js-src>/jasperserver/buildomatic/install_resources/extra-jars/ant-contrib.jar

    To:

    <ant-home>/lib

    (General example)

    C:apache-ant-1.9.4lib

    (Windows example)

    /usr/share/java/apache-ant/lib

    (Linux example)

    /usr/share/ant/lib

    (Mac example)

    Generated Property Files

    After you set your database and application server property values, you'll run buildomatic scripts to generate the database and application server configuration files to run JasperReports Server. Generated property files are in the following directory:

    <js-src>/jasperserver/buildomatic/build_conf/default

    Some of the key configuration files are:

    js.jdbc.properties

    maven_settings.xml   -   (This is the maven settings file used by the source build)

    More generated property files are in the following directory:

    <js-src>/jasperserver/buildomatic/build_conf/default/webapp

    Some of the configuration files in this directory are:

    META-INF/context.xml

    WEB-INF/hibernate.properties

    WEB-INF/js.quartz.properties

    Running clean-config removes these generated files. Running gen-config or any other target, regenerates these files.

    Existing and Generated Database SQL Files

    Buildomatic files that support various databases are located in:

    <js-src>/jasperserver/buildomatic/install_resources/sql/<db-type>

    The source code build procedure creates the jasperserver repository database schema using these files:

    js-ce-create.ddl

    js-ce-drop.ddl

    When you run the buildomatic target build-js-ddl-ce, these database files are freshly generated for your specified database platform. The files are generated to the following location:

    <js-src>/jasperserver/repository-hibernate/build-db/target/sql

    Then the files are automatically copied into their buildomatic directory location:

    <js-src>/jasperserver/buildomatic/install_resources/sql/<db-type>

    note-icon-ns_28x28.png.fe7d2bc45611c227c142bf2d6dc78182.png

    These generated files also overwrite the ones already in the buildomatic directory location.

    Generated WAR File Location and deploy-webapp-ce Target

    The JasperReports Server source code build creates a jasperserver WAR file. The build assembles the WAR file into the following location:

    <js-src>/jasperserver/jasperserver-war/target

    When the build-ce target is run, buildomatic assembles the jasperserver WAR file, and copies the file to this location for use by subsequent buildomatic targets:

    <js-src>/jasperserver/buildomatic/install_resources/war/jasperserver

    Later, when you run the buildomatic target deploy-webapp-ce, the following actions take place, for example on Tomcat:

    Files:

    <js-src>/jasperserver/buildomatic/install_resources/war/jasperserver/*

    Copied to:

    <tomcat>/webapps

    File:

    <js-src>/jasperserver/buildomatic/build_conf/default/webapp/META-INF/context.xml

    Copied to:

    <tomcat>/webapps/jasperserver/jasperserver/META-INF

    Files:

    <js-src>/jasperserver/buildomatic/build_conf/default/webapp/WEB-INF/hibernate.properties
    <js-src>/jasperserver/buildomatic/build_conf/default/webapp/WEB-INF/js.quartz.properties

    Copied to:

    <tomcat>/webapps/jasperserver/WEB-INF

    File:

    <js-src>/jasperserver/buildomatic/build_conf/db/postgresql/jdbc/postgresql-9.2-1002.jdbc4.jar

    Copied to:

    <tomcat>/lib

    Files:

    <js-src>/jasperserver/buildomatic/conf_source/db/app-srv-jdbc-drivers/*/jar

    Copied to:

    <tomcat>/lib

    Details on Database Load Build Targets

    The buildomatic targets shown below are used in Building JasperReports Server Source Code to create and populate the databases used with JasperReports Server. These targets consolidate and simplify the handling of the jasperserver database and the optional sample databases:

    create-load-js-db-ce
    create-load-all-dbs-ce

    create-load-js-db-ce

    This buildomatic target is a consolidation of the following targets:

    drop-js-db (if necessary)
    create-js-db
    init-js-db-ce
    import-minimal-ce

    Additional functionality determines whether the jasperserver database already exists. If so, a command line prompt asks you if you want to delete and re-create the database.

    create-load-all-dbs-ce

    This buildomatic target is a consolidation of the following targets:

    drop-js-db (if necessary)
    create-js-db
    init-js-db-ce
    import-minimal-ce
    import-sample-data-ce
    (drop-foodmart-db, if necessary)
    create-foodmart-db
    load-foodmart-db
    (drop-sugarcrm-db, if necessary)
    create-sugarcrm-db
    load-sugarcrm-db

    Additional functionality determines whether the jasperserver database already exists. If so, a command line prompt asks you if you want to delete and re-create the database. The same logic applies for the sample databases: foodmart and sugarcrm.

    General Fresh Database Schema File

    The consolidated database scripts do not regenerate the database schema file. Instead the existing default database schema files are used. To regenerate the database schema files, run the following target:

    js-ant build-js-ddl-ce

    The files are generated to the following location:

    <js-src>/jasperserver/repository-hibernate/build-db/target/sql

    Then the files are automatically copied into their buildomatic directory location:

    <js-src>/jasperserver/buildomatic/install_resources/sql/<db-type>

    Older Buildomatic Commands

    This section shows an alternate, more manual approach for building source code in JasperReports Server.

    note-icon-ns_28x28.png.7670801590523ee70b9684afb0e5227e.png

    We recommend using the buildomatic scripts as described in Building JasperReports Server Source Code. You'll have fewer commands to type.

    To build JasperReports Server using older Buildomatic commands:

    1. Edit the default_master.properties file for your particular environment.
    2. Start the database server.
    3. Stop the application server (unless it’s GlassFish, which should be running).

    After you execute the first build target, the buildomatic scripts automatically configure the necessary properties and store these settings in the following directory:

    <js-src>/jasperserver/buildomatic/build_conf/default

    4. Execute the following steps at the command line. After executing each Ant target, look for the message BUILD SUCCESSFUL.

    Commands

    Description

    cd <js-src>/jasperserver/buildomatic

    js-ant add-jdbc-driver

    js-ant build-ce

    Installs the JDBC driver to mvn local repository

     

    Builds the Community Project source code

    js-ant create-js-db


    js-ant create-sugarcrm-db

    js-ant load-sugarcrm-db

    js-ant create-foodmart-db

    js-ant load-foodmart-db

    If the jasperserver database already exists, first run
    js-ant drop-js-db

    Creates sample data for integration-tests

     

    Creates sample data for integration-tests

    Can run for 10 minutes or more

    js-ant build-js-ddl-ce

    js-ant init-js-db-ce

    js-ant run-production-data-ce

    Creates the database schema files for your database type

    Loads the schema into database

    Put core bootstrap and Sample data into the jasperserver db

    js-ant deploy-webapp-ce

    Deploys JasperReports Server to the application server

    Manual Creation of Databases

    JasperReports Server runs with a repository database typically named jasperserver. The automated buildomatic steps create the jasperserver database and sample databases. But you can also create your databases manually.

    Manually Creating Databases: PostgreSQL

    You can manually execute the scripts buildomatic uses to create and populate databases. Here is an example for PostgreSQL:

    1. To create the jasperserver database, use a client tool to log into PostgreSQL:
    2. To create the sample databases, run these commands:

    Additional Databases

    For information on manual setup of databases other than PostgreSQL, refer to the JasperReports Server Community Project Installation Guide.


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...