Jump to content
Changes to the Jaspersoft community edition download ×
  • Contributing to Jaspersoft® Studio and building from sources


    Massimo Rabbi
    • Edited on:
    • Version: v6 Product: Jaspersoft® Studio

    Overview

    The purpose of this page is to show how to contribute to Jaspersoft® Studio project and configure a fully functional working environment in order to do it.

    Prepare your working environment

    Pre-requisites

    This tutorial is based on the latest available version of Jaspersoft Studio that is currently 6.16.0. This release is based on Eclipse target platform 4.17 and it is bundling an AdoptOpenJDK 11.0.8.

    When developing it is highly suggested to use an Eclipse version identical or greater than the platform one. In this case we will grab an Eclipse IDE for RCP and RAP Developers 2020-09 (4.17).

    Here below a list of the items you should download before proceedings:

    IDE Setup

    Once completed the download to a proper folder you should have all the files needed to proceed with the setup, like shown in the screenshot below:jssfromsources_idesetup1.png.c12b493627305c2400e0dbbf4280f6b0.png

    First step(s):

    1. extracting the two sources zip files into a dedicated folder (at the same level)
    2. extracting the target platform and target repo
    3. extracting the Eclipse(.app) instance 

    You can later start Eclipse 4.17 and choose the default workspace location, maybe you can keep it inside the previously chosen root.

    NOTE: Be sure to have a Java 11 runtime (Oracle, OpenJDK etc) installed in your machine because otherwise Eclipse will not start. Since Eclipse 4.17, Java 11 is mandatory.

    jssfromsources_idesetup2.png.65a045217820168916dd8583bea6cfb6.png

    Let's now proceed by creating a new target platform inside the dedicated section in the Eclipse Preferences dialog. 

    jssfromsources_idesetup3.png.0256e2212152584762a663a486b1e402.png

    We will add a brand new one, starting with an empty definition and adding as location the previously extracted folder.

    jssfromsources_idesetup4.png.523c74ffb865239c973fb794b0e0356b.png

    Once confirmed the new configuration setup, we will activate it and apply the changes.

    jssfromsources_idesetup5.png.05c007900b96d5f3a89c95d094524038.png

    Source code import and building

    We previously extracted the two zip files containing the source code of the two repositories (JSS CE and JSS JR).

    We will proceed importing the projects inside the workspace and maybe, for simplicity, group the plug-in projects in "Working Sets".

    Use the "File > Import > General > Existing Projects into Workspace" menu item to add all the needed files.

    jssfromsources_sourcesimport1.png.613a555b7567ccb13c952ff61df5191e.png

    jssfromsources_sourcesimport2.png.b718e7fdb7f33cde38560a5737fa5b83.png

    Once everything is ready you can proceed in kicking a build "manually" using CMD+B (Mac) or CTRL+B (Windows and Linux). 

    Sources should compile fine:

    • in Windows and Linux the project "com.jaspersoft.studio.rcp.macosx" might be "broken". It's a dedicated project for Mac OS X systems. Don't care about it.
    • the project "org.osgi.framework.system.packages.extra" should be "broken". It's important for the "artifact building" phase that we will see later. Don't care about it for now.

    Launch configuration creation and runtime running

    After sources building, you have all you need to start coding and modifying/fixing Jaspersoft Studio. To see how your modification affect the application you can create a launch configuration to run/debug and test everything is fine.

    To create a launch configuration just open the dialog "Run > Run configurations". Now you can enter the name for your configuration. You can leave the selected default information, or just in case change some default memory settings from the Arguments tab.

    jssfromsources_launchconfig1.png.84aa759d4c1e5199b4f41551f6b2c24c.png

    Example VM Arguments extracted from the Jaspersoft Studio product file.

    -Xms128m
    
    -Xmx1024m
    
    -XX:PermSize=128M
    
    -XX:MaxPermSize=256M
    
    -XX:+CMSClassUnloadingEnabled
    
    -XX:+UseConcMarkSweepGC
    
    -Dfile.encoding=UTF-8
    
    -Djava.net.preferIPv4Stack=true

    Clicking on the "Run" button you will be able to start the runtime environment where you can check Jaspersoft Studio modifications you might have applied on the original source code.

    Building Jaspersoft Studio artifacts using Tycho.

    It's possible to double-check that our modifications to the original Jaspersoft Studio code did not break something.

    We will not see how to completely produce the finals .exe, dmg and tar.gz, because this requires some additional operations that we are currently performing internally with our CI jobs (i.e. signing).

    Anyhow we will describe the steps to produce the raw artifacts of the final product.  

    Be sure to have Maven installed and properly configured besides a JDK 1.8. This below is an example of .bash_profile file containing the configuration details:

    #Java Home
    export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home"
     
    #Apache Ant configuration
    export ANT_HOME="/Users/mrabbi/Development/tools/apache-ant/apache-ant-1.9.14"
    export ANT_OPTS="-Xms256m -Xmx1024m"
     
    #Apache Maven configuration
    export MAVEN_HOME="/Users/mrabbi/Development/tools/apache-maven/apache-maven-3.6.3"
    export M2_HOME="/Users/mrabbi/Development/tools/apache-maven/apache-maven-3.6.3"
    export MAVEN_OPTS="-Xms256m -Xmx1024m"
     
    #Path stuff
    export PATH="$PATH::$ANT_HOME/bin:$MAVEN_HOME/bin"
    

    Since we will be using Tycho, we need to ensure that our settings.xml is properly configured containing some properties, but especially the reference to the Jaspersoft repository. 

    <?xml version="1.0"?>
    <settings>
        <profiles>
            <profile>
                <id>JSSProfile</id>
                <repositories>
                    <repository>
                        <id>jaspersoftrepo</id>
                        <name>Jaspersoft Repository</name>
                        <snapshots>
                            <enabled>true</enabled>
                        </snapshots>
                        <url>https://jaspersoft.jfrog.io/jaspersoft/jaspersoft-repo</url>
                    </repository>
                </repositories>
                <properties>
                    <!-- Local Repository with the target repo for building -->
                    <targetplatform.repo>/Users/mrabbi/Development/tutorials/jssce/targetRepoE417</targetplatform.repo>
                    <!-- JRE files location -->
                    <jre.packages.location>/Users/mrabbi/Development/tutorials/jssce/jre</jre.packages.location>
                </properties>
            </profile>
        </profiles>
        <activeProfiles>
            <activeProfile>JSSProfile</activeProfile>
        </activeProfiles>
    </settings>

    From terminal we can give the "mvn clean package" command in order to kick the Maven Tycho building operation. 

    We need to be inside the aggregator project of the sources folder.

    jssfromsources_maventycho1.png.9c5466e20a829a7db0ec2888ab58b37a.png

    Once everything completes fine we can find the raw artifacts generated inside the location com.jaspersoft.studio.rcp.product/target/products

    • com.jaspersoft.studio.rcp.product-linux.gtk.x86_64.zip 
    • com.jaspersoft.studio.rcp.product-macosx.cocoa.x86_64.zip 
    • com.jaspersoft.studio.rcp.product-win32.win32.x86_64.zip

    NOTE: if you have problems starting up the Linux artifact please check inside the <jaspersoft_studio_folder>/features/jre.linux.gtk.x86_64.feature_11.0.8/adoptopenjdk_jre/bin folder and set executable flag to the java file.


    User Feedback

    Recommended Comments

    Just spent a lot of hours trying to put all together since all instructions here seem to be outdated.

    First of all, all sources are in github, all dependencies can be downloaded with corresponding version release:

    https://github.com/TIBCOSoftware/jaspersoft-studio-ce/releases

    Need to import into project workspace two files: jsreport-eclipse-plugin and studio sources

    2nd - do not use installation executable of eclipse. Just download and extract zip package. It complained me on missing standard packages when I tried to build the project with eclipse I installed. It missed almost all content from plugins folder (probably it stores it somewhere else, not sure, but seems it damages build of the project)

    3rd - not sure what is the difference between targetRepo and targetPlatform. Seems the are identical

    4th - Tried to compile with java 11 and got thousand of errors like "The package javax.xml.parsers is accessible from more than one module". Setting Java compiler compliance to 1.8 helped to overcome this

    Link to comment
    Share on other sites

    I've updated the documentation to the latest available 6.16.0. We will try to keep it updated in case of newer versions that might impact the overall procedure.

    Otherwise consider that upcoming versions might have for example source code link references different. Check the Github page to get the correct ones:

    Link to comment
    Share on other sites



    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...