Skip to content

Latest commit

 

History

History
120 lines (104 loc) · 6.53 KB

README.md

File metadata and controls

120 lines (104 loc) · 6.53 KB

OpenJRS Server — legacy backend build guide

OpenJRS Server is an independent community fork of JasperReports Server CE. The instructions below document the inherited build system and retain its original internal paths and identifiers. See project status, independence and AI-assisted maintenance before deploying.

Historical build instructions

Build prerequisites

Set up

Build UI artifacts

First you need to build UI and Deploy (described in the section below) it to the local maven repository.

Set up UI build environment

To start you should set up UI build environment as described in ../jasperserver-ui/ce/README.md#set-up including yarn install command.

Build UI artifacts

To build UI artifacts run the following commands:

in ../jasperserver-ui/ce folder:

yarn run clean
yarn run build

in ../jasperserver-ui/ce/jrs-ui folder:

yarn run overlay

Deploy UI artifacts to the local maven repository

Backend build process expects frontend distribution to be deployed to the maven repository.

So before starting backend build we can publish our frontend distribution to the local maven repository, so backend build will pick it up.

In order to do this

You can set this variable to any other value, but you will need additionally to configure the server to use it instead. Otherwise it will not be able to find UI artifacts

This command will publish UI artifacts to <path-to-maven-repo>/.m2/repository/com/jaspersoft/jrs-ui/master maven repo path. By default, artifacts have the same name as a git branch, in our case it is master.

Configuring the buildomatic properties

  • In order to build the project you need to provide a configuration file with all required settings.
  • Navigate to <path-to-project>/jasperreports-server-ce/jasperserver/buildomatic/sample_conf/source directory.
  • Copy postgresql_master.properties or mysql_master.properties to the buildomatic root folder and rename a file to default_master.propeties.
  • Open default_master.properties and configure next required properties:
    • js-path - path to downloaded JasperReports CE Server;
    • appServerType - type of app server to use, tomcat is the default value;
    • appServerDir - path to an app server;
    • maven - path to a maven executable file;
    • dbType, dbHost, dbUsername, dbPassword - database type, host, username and password related properties;
    • maven.build.type - set it to community value. Build uses this property to check what maven settings should be used.
    • fafBuildArtifactVersionName - set it to master. This property checks what UI artifact to use. If you have specified a different value for the BUILD_ARTIFACT_VERSION_NAME env variable - you should use it.
    • buildArtifactVersionName - set it to master. The value of this property should be the same as the value for fafBuildArtifactVersionName.

Configuration example:

js-path=/opt/jasperreports-server-ce/jasperserver
appServerType=tomcat
appServerDir=/opt/tomcat
maven=/opt/maven/bin/mvn
maven.build.type=community
dbType=postgresql
dbHost=localhost
dbUsername=postgres
dbPassword=password
fafBuildArtifactVersionName=master
buildArtifactVersionName=master

Build server

Run following commands in buildomatic folder:

Linux/MacOS:

./js-ant build-all-ce
./js-ant run-production-data-ce
./js-ant prepare-foodmart-db
./js-ant prepare-sugarcrm-db
./js-ant deploy-webapp-ce

Windows:

js-ant.bat build-all-ce
js-ant.bat run-production-data-ce
js-ant.bat prepare-foodmart-db
js-ant.bat prepare-sugarcrm-db
js-ant.bat deploy-webapp-ce

After successful build the JasperReports server will be deployed as a jasperserver WAR file to the specified Application Server (appServerDir location). In our case it will be /opt/tomcat/webapps/jasperserver

Starting instance

To start the inherited JasperReports Server runtime used by OpenJRS:

  • For Tomcat execute <path-to-tomcat>/bin/startup.sh (or startup.bat if you are on Windows)
  • For JBoss execute <path-to-jboss>/bin/standalone.sh (or standalone.bat for Windows)
  • Open Browser and navigate to http://localhost:8080/jasperserver
  • Log into JasperReports Server as jasperadmin:
    • User ID: jasperadmin
    • Password: jasperadmin

Other build commands

There is no need to execute full-build commands all the time. The Buildomatic contains many simplified ant tasks, most common of them are:

  • build-ce - to build the server, this also executes all unit tests;
  • run-integration-tests-ce - to run integration tests. To debug them add -Dremote.debug=true to the command line and debugger attach to port 8000;
  • deploy-webapp-ce - copies war file to the application server directory (specified by the appServerDir property);
  • refresh-config - cleans and re-creates configuration files from scratch. Useful, when you made changes to the default_master.properties;
  • help - displays help page. It contains information about other ant tasks that hasn't been listed here.

Please make sure you are using ./js-ant (or ./js-ant.bat for Windows) executable to run all these tasks, otherwise there might be an error message