Fork me on GitHub

How to use JRebirth Application Framework

This page will help you setting up your project to work with JRebirth.

Installation

Manual Download

JRebirth is composed by a set of jar files, you just have to add them into your application classpath to use them.

To get them you can download manually JRebirth distribution archive, but it could be out of date.

This distribution mode will be improved in the future for those you don't want to deal with an artifact repository.

Maven Way

Currently the easy way to get JRebirth jar files is to use maven convention.

You just need to add these dependencies into your pom.xml to begin to play with JRebirth Core features.
The first one is the core library of JRebirth Application Framework. The second one is used to displayed basic JRebirth Preloader.
The last one an optional library used to manage logs.

204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<dependencies>
 
    <!-- Use logback logger -->
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.0.13</version>
    </dependency>
 
    <dependency>
        <groupId>org.jrebirth.af</groupId>
        <artifactId>preloader</artifactId>
        <version>7.7.2</version>
    </dependency>
 
    <dependency>
        <groupId>org.jrebirth.af</groupId>
        <artifactId>core</artifactId>

We will see in the next chapter how to configure your build to get all JRebirth dependencies.

Maven Repositories

Choose your destiny !
...and finish it ! (aka your wonderful application :)

All JRebirth libraries are pushed to several repositories and you must choose how you want to retrieve them.
They are pushed in this order :

  1. OJO, Open Source Repository hosted by JFrog and powered by Artifactory oss.jfrog.org
  2. Our public repository powered by Bintray (On demand Jenkins build)
  3. JCenter Bintray repository (Only Releases)
  4. Our internal repository powered by Artifactory (could be offline)
  5. Any subset of all available repositories

JRebirth is not yet on Maven Central repository because the upload policy is too restrictive (actually it requires to update your pom to be allowed to send your artifacts on a third-party repository that will be synchronized with Central).
If you don't want to bother yourself with all these settings, you should just proxy OJO repository.

The first location to check is OJO because releases and snapshots are pushed automatically to it, so check it out first !

Let's have a macro look on all these alternatives.

OJO Repo

JRebirth is firstly pushed to OJO ( oss.jfrog.org/simple/oss-release-local/org/jrebirth/ - Open Source Software repo provided by JFrog as an artifactory instance ).

You have 2 ways to plug your maven build to this server:

  1. Add a repositories section into the pom.xml of your project.
  2. Add a profile section into your settings.xml

OJO into Pom.xml

You can simply add this declaration into your pom.xml file to let Maven downloading all JRebirth dependencies.
A lot of people don't recommend to put repositories declaration into pom files, because a Maven build should only depend on Maven Central dependencies without any third library repositories.
JRebirth is not pushed yet on Maven Central repo, so this snippet does the trick to start to work.

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<repositories>
    <repository>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <id>central</id>
        <name>libs-release</name>
    </repository>
    <repository>
        <snapshots />
        <id>snapshots</id>
        <name>libs-snapshot</name>
    </repository>
</repositories>

OJO into Settings.xml

This way is so far better but has an important drawback, your build won't work if you don't use the right profile.
So you should share this declaration somewhere in order to let your project 'buildable' by other contributors.

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<profiles>
    <profile>
        <id>OJO</id>
        <repositories>
            <repository>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
                <id>central</id>
                <name>libs-release</name>
                <url>http://oss.jfrog.org/artifactory/libs-release</url>
            </repository>
            <repository>
                <snapshots />
                <id>snapshots</id>
                <name>libs-snapshot</name>
                <url>http://oss.jfrog.org/artifactory/libs-snapshot</url>
            </repository>
        </repositories>
        <pluginRepositories>
            <pluginRepository>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
                <id>central</id>
                <name>plugins-release</name>
                <url>http://oss.jfrog.org/artifactory/plugins-release</url>
            </pluginRepository>
            <pluginRepository>
                <snapshots />
                <id>snapshots</id>
                <name>plugins-snapshot</name>
                <url>http://oss.jfrog.org/artifactory/plugins-snapshot</url>
            </pluginRepository>
        </pluginRepositories>
    </profile>
</profiles>

Bintray

JRebirth artifacts are pushed to Bintray repository and then automatically synchronized to JCenter main Bintray repository. Only release version are managed.

It's possible to add only JRebirth Bintray repository to your project, but it's more convenient to add JCenter repository which aggregate all Bintray repositories.

JCenter

JCenter is a new social Java repository hosted on Bintray website. It allows to broadcast thousand of libraries without the pitfall to update your pom.xml in order to push them on a proxy repository. JCenter is absolutely a fabulous alternative to Maven Central, it can also host other kinf of binaries.

If you want to use JCenter repository, you must add this into your Maven settings.xml. Pay attention that at this time JCenter contains only 'Release' artifacts, no 'snapshot' versions

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<profiles>
    <profile>
        <id>JCenter</id>
        <repositories>
            <repository>
                <id>central</id>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
                <name>bintray</name>
                <url>http://jcenter.bintray.com</url>
            </repository>
        </repositories>
        <pluginRepositories>
            <pluginRepository>
                <id>central</id>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
                <name>bintray-plugins</name>
                <url>http://jcenter.bintray.com</url>
            </pluginRepository>
        </pluginRepositories>
    </profile>
</profiles>

JRebirth Repo

JRebirth has its own artifact repository ( repo.jrebirth.org ), but the server is not 7/7 24/24 ready due to energy savings. It could be offline when you need to recompile your application, so you shouldn't use it into your builds. It's mainly used as proxy for our developers, although it also hosts all JRebirth binaries.

You have 2 ways to plug your maven build to our server:

  1. Add a repositories section into the pom.xml of your project
  2. Add a profile section into your settings.xml

JRebirth repo into Settings.xml

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<profiles>
    <profile>
        <id>JRebirth</id>
        <repositories>
            <repository>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
                <id>jrebirth-release</id>
                <name>libs-release</name>
                <url>http://repo.jrebirth.org/libs-release</url>
            </repository>
            <repository>
                <snapshots />
                <id>jrebirth-snapshot</id>
                <name>libs-snapshot</name>
                <url>http://repo.jrebirth.org/libs-snapshot</url>
            </repository>
        </repositories>
        <pluginRepositories>
            <pluginRepository>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
                <id>jrebirth-plugin-release</id>
                <name>plugins-release</name>
                <url>http://repo.jrebirth.org/plugins-release</url>
            </pluginRepository>
            <pluginRepository>
                <snapshots />
                <id>jrebirth-plugin-snapshot</id>
                <name>plugins-snapshot</name>
                <url>http://repo.jrebirth.org/plugins-snapshot</url>
            </pluginRepository>
        </pluginRepositories>
    </profile>
</profiles>

It's also possible to add this declaration into the profile section of your user settings.xml or enterprise settings.xml

Hybrid Configuration

You can add both OJO, JCenter, and JRebirth Artifactory repositories, if you want to be up-to-date at any time.

If you just want to deal with stable release use only OJO (Release repo) and JCenter.
If sometimes you need to test a snapshot version use OJO (Snapshot repo) and our Artifactory instance or ask us a custom build.

All-In-One Profile

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<profiles>
    <profile>
        <id>JRebirth_All-In-One</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <repositories>
            <repository>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
                <id>central</id>
                <name>libs-release</name>
                <url>http://oss.jfrog.org/artifactory/libs-release</url>
            </repository>
            <repository>
                <snapshots />
                <id>snapshots</id>
                <name>libs-snapshot</name>
                <url>http://oss.jfrog.org/artifactory/libs-snapshot</url>
            </repository>
            <repository>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
                <id>jcenter</id>
                <name>bintray</name>
                <url>http://jcenter.bintray.com</url>
            </repository>
            <repository>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
                <id>jrebirth-release</id>
                <name>libs-release</name>
                <url>http://repo.jrebirth.org/libs-release</url>
            </repository>
            <repository>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
                <id>jrebirth-snapshot</id>
                <name>libs-snapshot</name>
                <url>http://repo.jrebirth.org/libs-snapshot</url>
            </repository>
        </repositories>
        <pluginRepositories>
            <pluginRepository>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
                <id>central</id>
                <name>plugins-release</name>
                <url>http://oss.jfrog.org/artifactory/plugins-release</url>
            </pluginRepository>
            <pluginRepository>
                <snapshots />
                <id>snapshots</id>
                <name>plugins-snapshot</name>
                <url>http://oss.jfrog.org/artifactory/plugins-snapshot</url>
            </pluginRepository>
            <pluginRepository>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
                <id>jcenter-plugin</id>
                <name>bintray-plugins</name>
                <url>http://jcenter.bintray.com</url>
            </pluginRepository>
            <pluginRepository>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
                <id>jrebirth-plugin-release</id>
                <name>plugins-release</name>
                <url>http://repo.jrebirth.org/plugins-release</url>
            </pluginRepository>
            <pluginRepository>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
                <id>jrebirth-plugin-snapshot</id>
                <name>plugins-snapshot</name>
                <url>http://repo.jrebirth.org/plugins-snapshot</url>
            </pluginRepository>
        </pluginRepositories>
    </profile>
</profiles>