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 directly from the home page or here: apps.jrebirth.org

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 all 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 an optional library used to manage logs. The second one is the core library of JRebirth Application Framework. The last one is used to displayed basic JRebirth Preloader.

1
2
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<?xml version="1.0" encoding="UTF-8"?>
    <modelVersion>4.0.0</modelVersion>
  
    <parent>
        <groupId>org.jrebirth</groupId>
        <artifactId>af</artifactId>
        <version>8.5.0</version>
        <relativePath>..</relativePath>
    </parent>
  
    <groupId>org.jrebirth.af</groupId>
    <artifactId>sample</artifactId>
    <packaging>jar</packaging>
  
    <name>Sample Application</name>
    <url>http://www.sample.org</url>
    <description>Built with JRebirth Framework</description>
  
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  
        <storepass>storepass</storepass>
        <storetype>JKS</storetype>
        <keyalias>keyalias</keyalias>
        <keypass>keypass</keypass>
  
        <deletekeystore>true</deletekeystore>
        <genkeystore>true</genkeystore>
  
        <permissions>all-permissions</permissions> <!-- or sandbox -->
        <deployUrl>http://apps.jrebirth.org</deployUrl>
        <deployPath>${project.artifactId}/${project.version}</deployPath>
        <codebase>${deployUrl}/${deployPath}</codebase>
  
        <jnlpFilename>sample.jnlp</jnlpFilename>
        <preloaderClass>org.jrebirth.af.preloader.JRebirthPreloader</preloaderClass>
        <appClass>org.jrebirth.af.sample.SampleApplication</appClass>
  
        <appletWidth>1024</appletWidth>
        <appletHeight>768</appletHeight>
  
        <updateCheck>background</updateCheck>
        <updatePolicy>prompt-update</updatePolicy>
  
    </properties>
  
    <organization>
        <name>JRebirth</name>
        <url>http://www.jrebirth.org</url>
    </organization>
  
    <build>
  
        <resources>
            <resource>
                <filtering>false</filtering>
                <directory>${basedir}/src/main/java</directory>
                <includes>
                    <include>**/*.fxml</include>
                    <include>**/*.properties</include>
                    <include>**/*.txt</include>
                </includes>
            </resource>
            <resource>
                <filtering>true</filtering>
                <directory>${basedir}/src/main/resources</directory>
                <includes>
                    <include>**/*.*</include>
                </includes>
                <excludes>
                    <exclude>**/*.ttf</exclude>
                </excludes>
            </resource>
            <resource>
                <filtering>false</filtering>
                <directory>${basedir}/src/main/resources</directory>
                <includes>
                    <include>**/*.ttf</include>
                </includes>
            </resource>
        </resources>
  
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                        <encoding>UTF-8</encoding>
                    </configuration>
                </plugin>
  
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.4</version>
  
                    <configuration>
                        <archive>
                            <manifestEntries>
                                <JavaFX-Version>2.0</JavaFX-Version>
                                <Main-Class>${appClass}</Main-Class>
                                <JavaFX-Application-Class>${appClass}</JavaFX-Application-Class>
                            </manifestEntries>
  
                            <manifest>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                                <addClasspath>true</addClasspath>
                            </manifest>
                        </archive>
                    </configuration>
                </plugin>
  
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>webstart-maven-plugin</artifactId>
                    <version>1.0-beta-6</version>
  
                    <dependencies>
                        <dependency>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>keytool-api-1.7</artifactId>
                            <version>1.4</version>
                        </dependency>
                        <dependency>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>webstart-pack200-impl</artifactId>
                            <version>1.0-beta-6</version>
                        </dependency>
                    </dependencies>
  
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>jnlp-inline</goal>
                            </goals>
                        </execution>
                    </executions>
  
                    <configuration>
  
                        <filenameMapping>full</filenameMapping>
  
                        <updateManifestEntries>
                            <Application-Name>${project.name}</Application-Name>
                            <Trusted-Library>true</Trusted-Library>
                            <Permissions>${permissions}</Permissions>
                            <Codebase>${codebase}</Codebase>
                            <Trusted-Only>true</Trusted-Only>
                        </updateManifestEntries>
  
  
                        <jnlpFiles>${jrebirth.jnlp.filename}</jnlpFiles>
                        <excludeTransitive>false</excludeTransitive>
  
                        <libPath>lib</libPath>
                        <codebase>${codebase}</codebase>
  
                        <jnlp>
                            <outputFile>${jnlpFilename}</outputFile>
                            <mainClass>${appClass}</mainClass>
                            <offlineAllowed>true</offlineAllowed>
                            <allPermissions>true</allPermissions>
                        </jnlp>
  
                        <sign>
                            <keystore>${keystore}</keystore>
                            <keypass>${keypass}</keypass>
                            <storepass>${storepass}</storepass>
                            <storetype>${storetype}</storetype>
  
                            <alias>${keyalias}</alias>
  
                            <validity>360</validity>
                            <dnameCn>JRebirth Self-signed Certificate</dnameCn>
                            <dnameOu>JRebirth OSS</dnameOu>
                            <dnameO>JRebirth</dnameO>
                            <dnameL>Toulouse</dnameL>
                            <dnameSt>Haute-Garonne</dnameSt>
                            <dnameC>FR</dnameC>
                            <verify>true</verify>
  
                            <keystoreConfig>
                                <delete>${deletekeystore}</delete>
                                <gen>${genkeystore}</gen>
                            </keystoreConfig>
  
                        </sign>
  
                        <unsignAlreadySignedJars>true</unsignAlreadySignedJars>
  
                        <pack200>
                            <enabled>true</enabled>
                        </pack200>
                        <gzip>true</gzip>
  
                        <outputJarVersions>false</outputJarVersions>
  
                        <install>false</install>
                        <verbose>true</verbose>
                    </configuration>
  
                </plugin>
  
  
                <!-- Project Quality -->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                    <version>2.5</version>
                </plugin>
  
            </plugins>
        </pluginManagement>
  
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ftp</artifactId>
                <version>2.2</version>
            </extension>
        </extensions>
    </build>
  
    <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>core</artifactId>
            <version>8.5.0</version>
        </dependency>
  
        <dependency>
            <groupId>org.jrebirth.af</groupId>
            <artifactId>preloader</artifactId>
            <version>8.5.0</version>
        </dependency>
    </dependencies>
  
</project>

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

Maven Repositories

Choose your destiny ! …and finish brillantly 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 (Snapshots and Releases) oss.jfrog.org
  2. Our public repository powered by Bintray (Only Releases, On demand Jenkins build)
  3. JCenter Bintray repository (Only Releases, Superset of Maven Central)
  4. Our internal repository powered by Artifactory (could be offline)
  5. Maven Central, all releases are synchronized with Central repository
  6. Any subset of all available repositories

JRebirth is published on Maven Central repository with the help of Bintray synchronization (without having to modify your pom files). If you don’t want to bother yourself with all these settings, you should just proxy JCenter repository.

When searching the latest versio of JRebirth, 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

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.

1
2
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
<?xml version="1.0" encoding="UTF-8" ?>
<project>
    <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>
        <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>
    </pluginRepositories>
</project>

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.

1
2
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
<?xml version="1.0" encoding="UTF-8" ?>
    <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>
    <activeProfiles>
        <activeProfile>OJO</activeProfile>
    </activeProfiles>
</settings>

Bintray

JRebirth artifacts are pushed to Bintray repository and then automatically synchronized to JCenter main Bintray repository. Only release version are managed. These repository can also host other kind of binaries.

It’s possible to add only JRebirth Bintray repository to your project, but it’s more convenient to add JCenter repository which aggregate all configured 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, moreover since it has became a superset of Maven Central.

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

1
2
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
<?xml version="1.0" encoding="UTF-8" ?>
    <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>
    <activeProfiles>
        <activeProfile>JCenter</activeProfile>
    </activeProfiles>
</settings>

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 (like Applications) that are not pushed on OJO or Bintray.

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

1
2
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
<?xml version="1.0" encoding="UTF-8" ?>
    <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>
    <activeProfiles>
        <activeProfile>JRebirth</activeProfile>
    </activeProfiles>
</settings>

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

Maven Central

Maven Central is the default repository used by any Maven installation, so you don’t have to configure something to be able to grab JRebirth artifacts. JRebirth artifacts are synchronized with Central since 7.7.0 version.

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) or JCenter. If sometimes you need to test a Snapshot version use OJO (Snapshot repo) and our Artifactory instance or ask us a custom build.

1
2
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
91
<?xml version="1.0" encoding="UTF-8" ?>
    <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>
</settings>