Java Web Start czyli jak żyć z tą dziwną technologią & Continuous Delivery w projekcie Open Source - Marcin Stachniuk WroclawJUG
1. Java Web Start czyli jak żyć z
tą dziwną technologią? &
Continuous Delivery w
projekcie Open Source
Marcin Stachniuk
@MarcinStachniuk
mstachniuk.blogspot.com
WrocJUG 04.04.2017
3. Agenda
● Introduction
● Build Pipeline
● Continuous Integration
● Continuous Delivery
● Code Quality
● Nice Badges
● Promotion in the Internet
● Alternatives
● Q&A
● Bonuses
● What is Java Web Start?
● How it works?
● What can goes wrong?
● Solution
● How IceBoar works?
● Benefits
● Q&A
4. Agenda
● Introduction
● Build Pipeline
● Continuous Integration
● Continuous Delivery
● Code Quality
● Nice Badges
● Promotion in the Internet
● Alternatives
● Q&A
● Bonuses
● What is Java Web Start?
● How it works?
● What can goes wrong?
● Solution
● How IceBoar works?
● Benefits
● Q&A
+
5. Java Web Start – jak żyć z tą
dziwną technologią?
Marcin Stachniuk
18. What could possibly go wrong?
● Different Java versions installed on client machines
● Sometimes javaws wants download and install newest JRE
version
● Different behavior depends on Operating System and
installed JRE version
● From some point of time apps needs to signed (Self-signed
are blocked)
● Application started in sandbox (javaws or jp2launcher)
34. Profits
● We know a target JVM version
● Application start outside a sandbox (java instead of
javaws)
● We sign only IceBoar jar
● Users don’t needs admin rights to install JRE
35. How to introduce IceBoar into a project?
<dependency>
<groupId>com.roche</groupId>
<artifactId>ice-boar</artifactId>
<version>${project.version}</version>
<classifier>jar-with-dependencies</classifier>
</dependency>
36. How to introduce IceBoar into a project?
<jnlp spec="1.0+" codebase="${codebase}">
<information>
....
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.5+" href="http://java.sun.com/products/autodl/j2se"/>
<jar href="${jre.and.jars.host}/${jars.path}/ice-boar-1.0-jar-with-dependencies.jar"/>
<property name="jnlp.IceBoar.close-on-end" value="false"/>
<property name="jnlp.IceBoar.main-class" value="com.roche.iceboar.helloworldswing.HelloWorld"/>
<property name="jnlp.IceBoar.jar.0"
value="${jre.and.jars.host}/${jars.path}/ice-boar-hello-world-swing-${version}-jar-with-dependencies.jar"/>
<property name="jnlp.IceBoar.splash" value="${jre.and.jars.host}/img/ice-boar-splash.png"/>
</resources>
<application-desc main-class="com.roche.iceboar.IceBoar">
</application-desc>
</jnlp>
38. Other features of IceBoar?
● Custom splash screen during loading
● No frame around splash screen
● Custom title and icon
● Starting application using pre-installed JRE
● Cache for downloaded JRE (for slow connections)
● Window with logs output
● Disable auto close IceBoar window after starting target
application
58. Continuous Integration
https://travis-ci.org
● Free for Open Source Projects
● Easy setup with GitHub
● Container base architecture (Doker)
● Stateless
● Multi language support (ANDROID, C, C#, C++, CLOJURE,
CRYSTAL, D, DART, ERLANG, ELIXIR, F#, GO, GROOVY,
HASKELL, HAXE, JAVA, JAVASCRIPT (WITH NODE.JS), JULIA,
OBJECTIVE-C, PERL, PERL6, PHP, PYTHON, R, RUBY, RUST,
SCALA, SMALLTALK, VISUAL BASIC)
● For Java: Oracle JDK 7 (default), Oracle JDK 8, OpenJDK 6,
OpenJDK 7, Gradle 2.0, Maven 3.2 and Ant 1.8
● Notifications via: Slack, HipChat, Emails and more
59. How to setup Travis-CI
.travis.yml
language: java
script: mvn clean install
jdk:
- oraclejdk8
● Sign travis-ci.org using GitHub account
● Choose project (you need to have admin rights to this project)
● Add .travis.yml to your root project folder
68. Release artifact to Maven Central is not so easy
● Complicated Requirements
● Hard to sign in / create account (need to find link and create an issue)
● Manual verification of uploaded artifact
69. Release artifact to bintray
● Sign in with GitHub
● Add new package to maven repository, configure it
● Deploy to bintray (from Travis-CI)
● You don’t need to sign your artifact
71. Bintray deploy to Maven Central
● You can’t store user token password :-(
● This will be manual step :-(
72. Google Developers: The Secret to Safe Continuous Deployment
www.youtube.com/watch?v=UMnZiTL0tUc
github.com/bslatkin/dpxdt
73. Continuous Delivery to GitHub Pages
4 commit
to
gh-pages
5 update
gh-pages
Build on Travis-CI build
GitHub Pages project and
commit to gh-pages
branch
81. Current IceBoar Build in details
language: java
script: ./build-travis.sh
jdk:
- oraclejdk8
before_install:
- pip install --user codecov
after_success:
- codecov
cache:
directories:
- $HOME/.m2 // cache dir between builds
install: true // skip install script
.travis.yml
82. Current IceBoar Build in details
#!/bin/bash
set -ev
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
...
else
cd ice-boar
mvn clean install
cd ..
mvn clean install -U
fi
build-travis.sh
set -ev
-e fail fast
-v print all lines in
the script before
executing them
83. Current IceBoar Build in details
cd ice-boar
mvn clean deploy --settings settings.xml
cd ..
mvn clean install -U
cd ice-boar-samples/ice-boar-demo-gh-pages/
mvn clean install -P ghpages
git clone https://github.com/Roche/IceBoar
cd IceBoar
git checkout gh-pages &&
cp -R ../target/ice-boar-demo-gh-pages/* .
build-travis.sh Roche/IceBoar
ice-boar
ice-boar-samples
ice-boar-demo-gh-pages
ice-boar-demo
ice-boar-hello-world-swing
84. Current IceBoar Build in details
cd ice-boar
mvn clean deploy --settings settings.xml
cd ..
mvn clean install -U
cd ice-boar-samples/ice-boar-demo-gh-pages/
mvn clean install -P ghpages
git clone https://github.com/Roche/IceBoar
cd IceBoar
git checkout gh-pages &&
cp -R ../target/ice-boar-demo-gh-pages/* .
build-travis.sh Roche/IceBoar
ice-boar
ice-boar-samples
ice-boar-demo-gh-pages
ice-boar-demo
ice-boar-hello-world-swing
85. Current IceBoar Build in details
cd ice-boar
mvn clean deploy --settings settings.xml
cd ..
mvn clean install -U
cd ice-boar-samples/ice-boar-demo-gh-pages/
mvn clean install -P ghpages
git clone https://github.com/Roche/IceBoar
cd IceBoar
git checkout gh-pages &&
cp -R ../target/ice-boar-demo-gh-pages/* .
build-travis.sh Roche/IceBoar
ice-boar
ice-boar-samples
ice-boar-demo-gh-pages
ice-boar-demo
ice-boar-hello-world-swing
86. Current IceBoar Build in details
cd ice-boar
mvn clean deploy --settings settings.xml
cd ..
mvn clean install -U
cd ice-boar-samples/ice-boar-demo-gh-pages/
mvn clean install -P ghpages
git clone https://github.com/Roche/IceBoar
cd IceBoar
git checkout gh-pages &&
cp -R ../target/ice-boar-demo-gh-pages/* .
build-travis.sh Roche/IceBoar
ice-boar
ice-boar-samples
ice-boar-demo-gh-pages
ice-boar-demo
ice-boar-hello-world-swing
IceBoar
87. Current IceBoar Build in details
cd ice-boar
mvn clean deploy --settings settings.xml
cd ..
mvn clean install -U
cd ice-boar-samples/ice-boar-demo-gh-pages/
mvn clean install -P ghpages
git clone https://github.com/Roche/IceBoar
cd IceBoar
git checkout gh-pages &&
cp -R ../target/ice-boar-demo-gh-pages/* .
build-travis.sh Roche/IceBoar
ice-boar
ice-boar-samples
ice-boar-demo-gh-pages
ice-boar-demo
ice-boar-hello-world-swing
IceBoar
88. Current IceBoar Build in details
git config user.name "Marcin Stachniuk"
git config user.email mstachniuk@...com
git add -A
git commit -m "update gh-pages by Travis-CI"
git push ${GIT_HUB_REPO_SECRET}
build-travis.sh Roche/IceBoar
ice-boar
ice-boar-samples
ice-boar-demo-gh-pages
ice-boar-demo
ice-boar-hello-world-swing
IceBoar
94. What is important for promotion?
● Stack Overflow: stackoverflow.com/search?q=ice+boar
95. How to promote in the Internet?
● Blogposts
● Another forums, groups, etc.
● Hackergarten (1 Pull Request,1 commit, 2 contributors)
● Presentations on JUG’s and conferences
● Coding in train (1 Pull Request, 16 commits, 1 contributor)
103. Links
● https://puppet.com/blog/continuous-delivery-vs-continuous-deployment-what-s-diff Continuous Delivery Vs.
Continuous Deployment: What's the Diff?
● https://www.youtube.com/watch?v=Lda4RuQDQN0 Szczepan Faber about Continuous Delivery
● https://docs.oracle.com/javase/8/docs/ Java Platform Standard Edition 8 Documentation
● https://github.com/Roche/IceBoar IceBoar on GitHub
● https://github.com GitHub Source Code repository
● https://github.io GitHub Pages
● https://travis-ci.org Travis-CI Continuous Integration Server
● https://codecov.io Collect your code coverage
● https://bintray.com Popular repository for your artifacts (not only Jar files)
● https://oss.jfrog.org Repository for OSS snapshots
● https://search.maven.org The Maven Central
● https://docs.travis-ci.com/user/pull-requests#Security-Restrictions-when-testing-Pull-Requests Why sometimes
PR from fork fail on Travis-Ci
● http://central.sonatype.org/pages/requirements.html Requirements for release in to Maven Central
● https://issues.sonatype.org Create issue for new account on Maven Central
● https://www.youtube.com/watch?v=UMnZiTL0tUc Google Developers The Secret to Safe Continuous Deployment
● https://chrome.google.com/webstore/detail/codecov-extension Codecov extension (for Google Chrome)
● http://shields.io Nice badges generator
● https://roche.github.io/IceBoar Demo page for IceBoar
● http://stackoverflow.com/search?q=ice+boar IceBoar on Stack Overflow
104. Java Web Start czyli jak żyć z
tą dziwną technologią? &
Continuous Delivery w
projekcie Open Source
Marcin Stachniuk
@MarcinStachniuk
mstachniuk.blogspot.com
WrocJUG 04.04.2017 Dziękuję!