Compiler Jasper Server

Ayant eu quelques difficultés à compiler Jasper Server, je vous propose ici une méthodologie pour compiler les sources Jasper Server tout en évitant les quelques écueils qui ne sont pas détaillés dans la documentation officielle. L’exemple est basé sur un
Christophe DUPONTMis à jour le 4 Févr 2014

Ayant eu quelques difficultés à compiler Jasper Server, je vous propose ici une méthodologie pour compiler les sources Jasper Server tout en évitant les quelques écueils qui ne sont pas détaillés dans la documentation officielle. L’exemple est basé sur un serveur Tomcat, mais il est tout à fait possible d’en utiliser un autre (JBoss ou Glassfish).

Méthodologie :

http://maven.apache.org/download.cgi.

http://tomcat.apache.org/.

Installez une base de données MySQL ou PostGreSQL. 

ATTENTION : créez un utilisateur avec un mot de passe (c’est le cas par défaut dans PostGreSQL mais pas dans MySQLMoteur de gestion de base de données. et cela pose problème à la compilation).

jasperreports-server-cp-5.1.0-src\jasperserver\buildomatic\conf_source\db\mysql\jdbc ».

http://sourceforge.net/projects/jasperserver/files/JasperServer/.

L’archive doit contenir 3 répertoires : apache-ant; jasperserver; jasperserver-repo. 

ScreenHunter_06-Feb.-04-09.32.jpg

jasperreports-server-cp-5.1.0-src\jasperserver\buildomatic ». Renommez le en « default_master.properties ».

Modifiez alors les informations non commentées contenues dans le fichier; remarquez qu’il faut préciser un chemin pour jasper-pro même si vous utilisez la version gratuite; il n’est pas nécessaire de modifier les informations concernant SVN.

Ci-dessous mon fichier de configuration :

################################################################################
#                                                                              #
# Master Properties File - Source Build                                        #
#                                                                              #
# Standard usage is to rename this file to default_master.properties.          #
# It should be placed in the root of the buildomatic directory, like:          #
#                                                                              #
#     /buildomatic/default_master.properties                       #
#                                                                              #
# There is one sample property file for each database type. Sample property    #
# files are found in:                                                          #
#                                                                              #
#     /buildomatic/sample_conf                                     #
#                                                                              #
#                                                                              #
# Sections in this file are:                                                   #
#                                                                              #
#   1) Section One:   Installing JasperServer                                  #
#                                                                              #
#   2) Section Two:   Building JasperServer Source Code                        #
#                                                                              #
#   3) Section Three: Multiple Build Target Config                             #
#                                                                              #
################################################################################

################################################################################
#                                                                              #
# Section One:  Installation Settings                                          #
#                                                                              #
# Set values for:                                                              #
#                                                                              #
#   1) Application server type                                                 #
#                                                                              #
#   2) Path to application server home directory                               #
#                                                                              #
#   3) Database location and connection settings                               #
#                                                                              #
################################################################################

appServerType = tomcat7
# appServerType = tomcat5
# appServerType = tomcat6
# appServerType = jboss
# appServerType = jboss-eap-6
# appServerType = jboss-as-7
# appServerType = glassfish2
# appServerType = glassfish3
# appServerType = skipAppServerCheck

# Tomcat app server root dir
appServerDir = C:\\Programmation\\apache-tomcat-7.0.50
# appServerDir = /home/devuser/apache-tomcat-7.0.26
# if linux package managed tomcat instance, set two properties below
# CATALINA_HOME = /usr/share/tomcat6
# CATALINA_BASE = /var/lib/tomcat6

# JBoss app server root dir
# appServerDir = C:\\jboss-5.1.0
# appServerDir = /home/devuser/jboss-5.1.0
# appServerDir = /usr/bin/jboss
# jboss.profile = default

# Glassfish app server root dir
# appServerDir = C:\\glassfish-3.1.2
# appServerDir = /home/devuser/glassfish-3.1.2
# appServerDir = /usr/bin/glassfish

# database type
dbType=postgresql

# database location and connection settings

dbHost=localhost
dbUsername=postgres
dbPassword=admin


# additional database parameters
# (uncomment these if you want non-default settings)

# dbPort=5432

# JasperServer db name, sample db names
# js.dbName=jasperserver
# sugarcrm.dbName=sugarcrm
# foodmart.dbName=foodmart

# web app name
# (set one of these to deploy to a non-default war file name)
# webAppNameCE = jasperserver
# webAppNamePro = jasperserver-pro

# JDBC driver
# (uncomment to change to a non-default setting)
#
# driver will be found here: /buildomatic/conf_source/db/postgresql/jdbc
#
# maven.jdbc.groupId=postgresql
# maven.jdbc.artifactId=postgresql
# maven.jdbc.version=9.2-1002.jdbc4

# Flag used to skip JDBC driver deploying during deployment process
# (uncomment to change to a non-default setting)
# deployJDBCDriver=false


################################################################################
#                                                                              #
# Section Two:  Source Code Build Settings                                     #
#                                                                              #
# Set values below for:                                                        #
#                                                                              #
#   1) maven binary location                                                   #
#                                                                              #
#   2) CE source path (for both CE and Pro)                                    #
#                                                                              #
#   3) Pro source path (Pro only)                                              #
#                                                                              #
#   4) 3rd Party dependencies resolution type                                  #
#                                                                              #
#   5) extra dependencies repository path                                      #
#                                                                              #
################################################################################

# point to maven binary
maven = C:\\Programmation\\apache-maven-3.1.1\\bin\\mvn.bat
# maven = /home/devuser/apache-maven-3.0.4/bin/mvn
# maven = /usr/bin/mvn

# if maven executable is not in maven_home, uncomment line below and set maven home
# maven.home = /usr/share/maven

# CE source path
js-path = C:\\Programmation\\jasperreports-server-cp-5.1.0-src\\jasperserver
# js-path = /home/devuser/jasperreports-server-5.1.0-src/jasperserver

# Pro source path
js-pro-path = C:\\Programmation\\jasperreports-server-cp-5.1.0-src\\jasperserver-pro
# js-pro-path = /home/devuser/jasperreports-server-5.1.0-src/jasperserver-pro

maven.build.type=repo

# Repo path (extra dependencies repository path)
repo-path = C:\\Programmation\\jasperreports-server-cp-5.1.0-src\\jasperserver-repo
# repo-path = /home/devuser/jasperreports-server-5.1.0-src/jasperserver-repo



################################################################################
# Advanced Options Below:                                                      #
################################################################################


# Glassfish Application Server Settings
#
# Current default settings are shown as the property values below
# Uncomment and modify the value in order to change the default
#
# Glassfish domain name (default is domain1)
# glassfishDomain=domain1
#
# Glassfish domain port (default is 4848), user (default is admin) and password.
# glassfishPort=4848
# glassfishUser=admin
# AS_ADMIN_PASSWORD=adminadmin


################################################################################
#                                                                              #
# Section Three:  Support for Multiple Build Configurations                    #
#                                                                              #
# There is infrastructure in place to maintain two or more configurations at   #
# the same time.                                                               #
#                                                                              #
# You can enable multiple configurations by using multiple                     #
# _master.properties files. These _master.properties files would then be       #
# pointed to by a single init.properties file.                                 #
#                                                                              #
# For instance, you can create the following _master.properties files:         #
#                                                                              #
#   buildomatic/mysql_master.properties                                        #
#   buildomatic/oracle_master.properties                                       #
#   buildomatic/branch-351-mysql_master.properties                             #
#                                                                              #
# Copy buildomatic/sample_conf/init.properties to the buildomatic directory.   #
# You can switch between _master.properties files by changing the values in    #
# init.properties. The uncommented value will be the one used:                 #
#                                                                              #
#     confName=mysql                                                           #
#     #confName=oracle                                                         #
#     #confName=branch-351-mysql                                               #
#                                                                              #
# In the case above, the file used will be: mysql_master.properties            #
#                                                                              #
# Set values below for:                                                        #
#                                                                              #
#   1) svn binary location                                                     #
#                                                                              #
#   2) svn user account                                                        #
#                                                                              #
#   3) set branch or tag names                                                 #
#      (if doing a checkout/update of branch or tag code)                      #
#                                                                              #
################################################################################

# point to svn binary
svn = C:\\Program Files\\CollabNet\\Subversion Client\\svn.exe
# svn = /opt/CollabNet_Subversion/bin/svn
# svn = /usr/bin/svn

# account to use for accessing svn
svn-user=devuser

# svn url settings (valid for internal users only)
# (do not change these settings)
js-base-url = svn+ssh://${svn-user}@falcon/jasperserver
js-pro-base-url = svn+ssh://${svn-user}@falcon/jasperserver-pro
js-repo-base-url = svn+ssh://${svn-user}@falcon/jasperserver-repo

# settings for branch or tag code
# uncomment to checkout specific branch or tag code. Set repo-rev
# to get specific svn revision of the jasperserver-repo
#
# js-branch = branches/js-for-pro-5.1.0
# js-pro-branch = branches/js-pro-5.1.0
# repo-rev = 14342


################################################################################
#                                                                              #
# Additional Support                                                           #
#                                                                              #
# 1) Custom maven local repository location                                    #
#                                                                              #
# 2) svn settings for JasperForge Public Source                                #
#                                                                              #
################################################################################

# Specify custom path and folder name for maven local repository location
# Default used is: ${user.home}/.m2/repository (maven default)
#
# maven-localrepo-path = C:\\js-builds\\branches\\my-repository
# maven-localrepo-path = C:\\js-builds\\branches\\localrepo-500-charts
# maven-localrepo-path = /home/devuser/js-builds/branches/my-repository


# Additional setting to potentially speed up the maven source build
# - skip unit-test execution
# - run in offline mode
# - use 2 threads per CPU
# - VERBOSE_LOGGING=true - increases amount of logging in maven; default is quiet logging (errors only)
# - SKIP_EXPORT_FILES=true - skip copying of files used for final import-export configuration
#
#SKIP_TEST_ARG=skipTests
#OFFLINE_ARG=-o
#THREAD_ARG=--threads=2C
#VERBOSE_LOGGING=true
#SKIP_EXPORT_FILES=true

et lancez successivement les commandes suivantes:

  • js-ant clean-config
  • js-ant gen-config
  • js-ant add-jdbc-driver (étape indispensable car l’instruction suivante essaiera de se connecter à la base de données)
  • js-ant build-ce
  • js-ant create-load-all-dbs-ce
  • js-ant deploy-webapp-ce

Vous pouvez ensuite démarrer tomcat et vous logger à l’adresse :

http://adresse:port/jasperserver