Building JasperReports Server Source Code¶
Note
This document describes how to build from a command-line shell in Linux or Windows. It does not address the process of building within an IDE (Integrated Development Environment) such as Eclipse or IntelliJ.
Introduction to Buildomatic Source Build Scripts¶
The JasperReports Server source code comes with a set of configuration and build scripts based on Apache Ant known as the buildomatic scripts. You will find these scripts in the following directory:
<js-src>/jasperserver/buildomatic
The buildomatic scripts automate most aspects of configuring, building, and deploying the source code. Apache Ant is bundled into the source code distribution to simplify the setup.
Downloading and Unpacking JasperReports Server Source Code¶
Downloading the Source Archive¶
Download the source code package zip for the commercial version of JasperReports Server from Jaspersoft Technical Support . The download package is
js-jrs``_10.1.0
_src.zip.
For access to the site, contact technical support or your sales representative.
Unpacking the Source Archive¶
Unpack the
js-jrs``_10.1.0
_src.zip file to a directory location, such as C:\ or /home/<user>. The resulting location is referred to as <js-src> in this document.
Windows: |
<js-src> example is C:\ JasperReports-Server-10.1.0 -src |
Linux: |
<js-src> example is /home/<user>/ JasperReports-Server-10.1.0 -src |
Note
The source build may use paths that exceed the 260-character limit on Windows. To extract the package, Enable NTFS long paths (Windows 10 only) or use a third-party file archiver such as 7-Zip.
Source Code Package Structure¶
After you have unpacked the zip file, the folder directory has the following structure:
| Directory or file | Description |
|---|---|
<js-src>/apache-ant |
Bundled version of Apache Ant build tool |
<js-src>/jasperserver |
JasperReports Server open source code for core functionality |
<js-src>/jasperserver-pro |
JasperReports Server source code for commercial functionality |
<js-src>/jasperserver-repo |
Dependent jar files (not readily available publicly) |
<js-src>/jasperserver-ui |
JasperReports Server source code for UI |
Note
The repo-path variable can be set to point to the location of the js-jrs_
js-jrs``_10.1.0
_repo.zip / ./repository directory.
Check Apache Ant¶
The Apache Ant tool is bundled (pre-integrated) into the source code distribution package. So you do not need to download or install Ant to run the buildomatic scripts. For example:
cd <js-src>/jasperserver/buildomatic
js-ant help or
../js-ant help (Linux)
If you do not use the bundled version of Apache Ant, we recommend using the 1.10.latest version.
Configuring the Buildomatic Properties¶
The buildomatic scripts are found at the following location:
<js-src>/jasperserver/buildomatic
Use the buildomatic scripts to build the source code and configure settings for a supported application server and database. The file for configuring these settings is default_master.properties. The source distribution includes a properties file for each type of database. Add your specific settings to this file and rename it to:
default_master.properties
Note
When specifying paths with Apache Ant and Java in Windows, a single forward slash (/) normally works the same as “escaped” double backlashes (\\).
PostgreSQL¶
-
Go to the buildomatic directory in the source distribution:
-
Copy the PostgreSQL specific file to the current directory and change its name to
default_master.properties as shown below:Windows: copy sample_conf\postgresql_master.properties default_master.propertiesLinux: cp sample_conf/postgresql_master.properties default_master.properties -
Edit the new default_master.properties file and set the following properties for your local environment:
Property
Examples
appServerTypeappServerType=tomcat [jboss-eap-8, wildfly, skipAppServerCheck]appServerDirappServerDir = C:\Program Files\Apache Software Foundation\Tomcat 11.0 appServerDir = /home/<user>/apache-tomcat-11.0 dbHostdbHost=localhost dbUsernamedbUsername=postgres dbPassworddbPassword=postgres mavenmaven = C:\apache-maven-3.9\bin\mvn.cmd
maven = /home/<user>/apache-maven-3.9/bin/mvn
js-pathjs-path = C:\
JasperReports-Server-10.1.0
-src\jasperserverjs-path = /home/<user>/
JasperReports-Server-10.1.0
-src/jasperserverjs-pro-pathjs-pro-path = C:\
JasperReports-Server-10.1.0
-src\jasperserver-projs-pro-path = /home/<user>/
JasperReports-Server-10.1.0
-src/jasperserver-projs-pro-path =maven.build.typemaven.build.type=reporepo-pathrepo-path = C:\
JasperReports-Server-10.1.0
\jasperserver-reporepo-path = /home/<user>/
JasperReports-Server-10.1.0
-src/jasperserver-repochrome.pathchrome.path = C:/Program Files (x86)/Google/Chrome/Application/chrome.exe
chrome.path = /usr/bin/google-chrome
MySQL¶
-
Go to the buildomatic directory in the source distribution:
-
Copy the MySQL specific file to the current directory and change its name to
default_master.properties:Windows: copy sample_conf\mysql_master.properties default_master.propertiesLinux: cp sample_conf/mysql_master.properties default_master.properties -
Edit the new
default_master.propertiesfile and set the following properties to your local environment:Property
Examples
appServerTypeappServerType=tomcat [jboss-eap-8, wildfly, skipAppServerCheck]appServerDirappServerDir = C:\Program Files\Apache Software Foundation\Tomcat 11.0 appServerDir = /home/<user>/apache-tomcat-11.0 dbHostdbHost = localhostdbUsernamedbUsername = rootdbPassworddbPassword = passwordmavenmaven = C:\apache-maven-3.9\bin\mvn.cmd
maven = /home/<user>/apache-3.9/bin/mvn
js-pathjs-path = C:\
JasperReports-Server-10.1.0
-src\jasperserverjs-path = /home/<user>/
JasperReports-Server-10.1.0
-src/jasperserverjs-pro-pathjs-pro-path = C:\
JasperReports-Server-10.1.0
-src\jasperserver-projs-pro-path = /home/<user>/
JasperReports-Server-10.1.0
-src/jasperserver-promaven.build.typemaven.build.type=reporepo-pathrepo-path = C:\
JasperReports-Server-10.1.0
-src\jasperserver-reporepo-path = /home/<user>/
JasperReports-Server-10.1.0
-src/jasperserver-repochrome.pathchrome.path = C:/Program Files (x86)/Google/Chrome/Application/chrome.exe
chrome.path = /usr/bin/google-chrome
Additional Databases¶
For default_master.properties configurations for other databases, please see Source Build Setup for Other Databases.
Build Source Code¶
Now that you have set up your default_master.properties file, you can build the source code.
To build JasperReports Server
- Set up the
default_master.propertiesfile for your environment (as described above). - Start the database server.
- Stop the application server.
- Run the commands shown below:
After running each Ant target in Commands for Building JasperReports Server, look for the message BUILD SUCCESSFUL.
Commands for Building JasperReports Server
| Commands | Description |
|---|---|
cd <js-src>/jasperserver/buildomatic |
|
js-ant clean-config |
(Optional) Clears the buildomatic/build_conf/default directory. |
js-ant gen-config |
(Optional) Rebuilds the buildomatic/build_conf/default directory. |
js-ant add-jdbc-driver |
Used for loading the databases |
js-ant build-pro |
Builds the commercial source code |
js-ant create-load-js-db-``pro`` |
(Optional) Creates and loads the jasperserver database, imports core bootstrap data |
js-ant deploy-webapp-``pro`` |
(Optional) Deploys the jasperserver -pro war file to the application server |
js-ant deploy-jrws |
(Optional) Deploys only JasperReports Web Studio apps in the configured app path in default_master.properties. |
Note
Installing JasperReports Server automatically generates encryption keys that reside on the file system. These keys are stored in a dedicated Jaspersoft keystore. Make sure that this keystore is properly secured and backed up, as described in the JasperReports Server Security Guide.
Set Java Options¶
JasperReports Server needs Java memory options that are larger than the standard defaults. For information about additional Java options, see Setting Java JVM Options.
Set Increased JAVA_OPTS Settings¶
JasperReports Server needs greater heap settings for all functionality to operate. For testing your deployed JasperServer, set your JAVA_OPTS to the same default values described in the JasperReports Server Installation Guide. The following shows the minimum recommended settings; you may need to increase these according to your usage.
JVM Options on Linux and Mac OSX (64 bit) |
|
|---|---|
Options for all app servers |
export JAVA_OPTS="$JAVA_OPTS -Xms2048m -Xmx4096m -Xss2m" |
JVM Options on Windows (64 bit) |
|
|---|---|
Options for all app servers |
set JAVA_OPTS=%JAVA_OPTS% -Xms2048m -Xmx4096m -Xss2m |
Add these settings to your application server startup script:
| Apache Tomcat: | <tomcat>/bin/setclasspath.sh |
(.bat for Windows) |
| JBoss: | <jboss>/bin/standalone.conf |
(.bat for Windows) |
For details on setting Java memory options, please see Setting Java JVM Options.
Put jaspersoft.jrs.license in Place¶
JasperReports Server Commercial edition requires a license to run. An evaluation license is provided in the source code zip download package. You can use this evaluation license to get started and then replace it with one you request Jaspersoft Technical Support or from your sales representative.
JasperReports Server looks for the license file in the home directory of the user running the application server, so copy the license to that location. You will find the license in the root of the source package:
<js-src>/jaspersoft.jrs.license
For more information on license configuration, please see Configuring the JasperReports Server License File.
Copy jaspersoft.jrs.license to the appropriate folder listed in the table below.
License Locations
Operating System |
|
|---|---|
Linux |
or |
Mac OSX |
/Users/user/ |
Windows 7 using the bundled Tomcat |
C:\Users\user |
Windows 7 using an existing Tomcat Windows service |
C:\ |
Starting JasperReports Server¶
You can now start your application server. Your database should already be running.
Logging into JasperReports Server¶
You can now log into JasperReports Server through a web browser:
Enter the login URL with the default port number:
http://localhost:8080/``jasperserver`` ``-pro``
Log into JasperReports Server as superuser or jasperadmin:
User ID: superuserPassword: superuser
User ID: jasperadmin Password: jasperadmin
If you are unable to log in or have other problems, see Troubleshooting, or the JasperReports Server Installation Guide.
JasperReports Server Log Files¶
If you encounter any startup or runtime errors, you can check the application server log files. For Apache Tomcat, you will find the log file here:
<tomcat>/logs/catalina.out
Also check the jasperserver.log file. You can increase the debug output level by editing the log4j.properties file.
The JasperReports Server runtime log is here:
<tomcat>/webapps//WEB-INF/logs/jasperserver.log
The log4j.properties file is here:
<tomcat>/webapps//WEB-INF/log4j.properties