Skip to content

Commit

Permalink
Merge pull request #30 from FunThomas424242/#27_appimage
Browse files Browse the repository at this point in the history
close #27 appimage
  • Loading branch information
Huluvu424242 authored Nov 6, 2019
2 parents fe61f4e + 6f63dd6 commit 92babae
Show file tree
Hide file tree
Showing 22 changed files with 3,674 additions and 30 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ hs_err_pid*
# build
/target
/generated
/src/jmods/jdeps

# AppImage build
/OpenJDK*.gz
/usr
/jdk*
/AppDir/usr
/*.AppImage
*~
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ language: java


jdk:
- openjdk11
- openjdk13

script: ./mvnw -Pheadless clean site install
install: skip

script:
- ./mvnw -U -Pheadless clean site install
- ./buildAppImage.sh

after_success:
- bash <(curl -s https://codecov.io/bash)
5 changes: 5 additions & 0 deletions ArchitekturEntscheidungen.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ Bei Color.red gibt es keine Anomalie.
[##literatur]
=== Literatur und Quellen im Netz

*
* https://maven.apache.org/plugins/maven-jlink-plugin/usage.html
* https://www.youtube.com/watch?v=a8xnnR3Bz6w&feature=youtu.be&t=2570
* https://stackoverflow.com/questions/47727869/creating-module-info-for-automatic-modules-with-jdeps-in-java-9
* https://github.com/codetojoy/easter_eggs_for_java_9/blob/master/egg_34_stack_overflow_47727869/run.sh
* https://winterbe.com/posts/2018/08/29/migrate-maven-projects-to-java-11-jigsaw/
* https://medium.com/@adam_carroll/java-packager-with-jdk11-31b3d620f4a8
* http://discoveration.de/it/javafx-mit-java-runtime-als-exe-ausliefern/636/
Expand Down
1 change: 1 addition & 0 deletions GitCommitMessage.template
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[${ticket:".*"}]
56 changes: 56 additions & 0 deletions buildAppImage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/env sh

export ARCH=x86_64
export CUR_DIR=${PWD}/
export APP_DIR=target/AppDir/
export BUILD_DIR=target/appbuild/
export RESOURCE_DIR=src/appimage-resources/
export JDK_ARCHIVE_NAME=OpenJDK11U-jdk_x64_linux_openj9_11.0.3_7_openj9-0.14.3.tar.gz

# download jre 11
wget -P ${BUILD_DIR} -c https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.3%2B7_openj9-0.14.3/${JDK_ARCHIVE_NAME}
tar -C ${BUILD_DIR} -xf ${BUILD_DIR}${JDK_ARCHIVE_NAME}

# list deps modules
${BUILD_DIR}jdk-11.0.3+7/bin/jdeps --list-deps ./target/jenkinsmonitor-*-jar-with-dependencies.jar

# spezielles jre bauen
${BUILD_DIR}jdk-11.0.3+7/bin/jlink --no-header-files --no-man-pages --compress=2 --strip-debug --add-modules java.base,java.desktop,java.logging,java.management,java.naming,java.security.jgss,java.sql,java.xml --output ${BUILD_DIR}usr

# copy binary
mkdir ${APP_DIR}
cp -Rf ${BUILD_DIR}usr ${APP_DIR}

# download AppImageKit and give permissions und run it
wget -P ${BUILD_DIR} -c https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage
chmod +x ${BUILD_DIR}appimagetool-x86_64.AppImage
#wget -P ${BUILD_DIR} https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
#chmod +x ${BUILD_DIR}linuxdeploy-x86_64.AppImage


# copy resources at final place and create sym links
cp -a ./target/jenkinsmonitor-*-jar-with-dependencies.jar ${APP_DIR}usr/bin/jenkinsmonitor-jar-with-dependencies.jar
cp -Rf ${RESOURCE_DIR}* ${APP_DIR}
cd "${APP_DIR}"
ln -s ./usr/bin/jenkinsmonitor.wrapper ./AppRun
ln -s ./usr/share/metainfo/com.github.funthomas424242.jenkinsmonitor.metainfo.xml ./usr/share/metainfo/jenkinsmonitor.appdata.xml
ln -s ./usr/share/applications/jenkinsmonitor.desktop ./jenkinsmonitor.desktop
ln -s ./usr/share/icons/theme/320x235/1984EmmanuelGoldstein.png ./usr/share/icons/theme/256x256/1984EmmanuelGoldstein.png
ln -s ./usr/share/icons/theme/320x235/1984EmmanuelGoldstein.png ./1984EmmanuelGoldstein.png
cd "${CUR_DIR}"

#read -p "Press [Enter] Resourcenprüfung jetzt möglich ..."

# loesche altes Image und erstelle neu
rm Jenkins_Monitor*.AppImage
${BUILD_DIR}appimagetool-x86_64.AppImage ${APP_DIR}
#${BUILD_DIR}/linuxdeploy-x86_64.AppImage --appdir ${APP_DIR} -e src/appimage-resources/launch.sh -i src/appimage-resources/1984EmmanuelGoldstein.png -d src/appimage-resources/myapp.desktop --output appimage

#read -p "Press [Enter] to start remove waste files ..."
#rm ${BUILD_DIR}linuxdeploy*.AppImage
rm -rf ${APP_DIR}*
rm -rf ${APP_DIR}.DirIcon
rm -rf ${BUILD_DIR}usr



4 changes: 4 additions & 0 deletions build_bundle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
jlink --module-path "output;$JAVA_HOME/jmods" --add-modules com.github.funthomas424242.jenkinsmonitor --output laufZeitImage

#java --module-path com.mydeveloperplanet.jpmshello/target/jpmshello-1.0-SNAPSHOT.jar;com.mydeveloperplanet.jpmshi/target/jpmshi-1.0-SNAPSHOT.jar --module com.mydeveloperplanet.jpmshello/com.mydeveloperplanet.jpmshello.HelloModules
20 changes: 20 additions & 0 deletions mkJmod.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
# Herstellung der jmod Dateien für auto module
#
# Gezeigt am Beispiel von commons-lang
#
export GROUP_ID="commons-lang"
export ARTIFACT_ID="commons-lang"
export ARTIFACT_ID_DOT="commons.lang"
export VERSION="2.6"
# bereinige jdeps
rm -rf ./jdeps/*
# generiere Module Definition
jdeps --generate-open-module ./jdeps ~/.m2/repository/${GROUP_ID}/${ARTIFACT_ID}/${VERSION}/${ARTIFACT_ID}-${VERSION}.jar
jdeps --generate-module-info ./jdeps ~/.m2/repository/${GROUP_ID}/${ARTIFACT_ID}/${VERSION}/${ARTIFACT_ID}-${VERSION}.jar
# compiliere module-info
unzip ~/.m2/repository/${GROUP_ID}/${ARTIFACT_ID}/${VERSION}/${ARTIFACT_ID}-${VERSION}.jar -d ./jdeps/${ARTIFACT_ID_DOT}/classes
javac -d ./jdeps/commons.lang/classes ./jdeps/${ARTIFACT_ID_DOT}/module-info.java
# erzeuge jmod module
jmod create --class-path ./jdeps/${ARTIFACT_ID_DOT}/classes src/jmods/${ARTIFACT_ID}-${VERSION}.jmod

135 changes: 107 additions & 28 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.github.funthomas424242</groupId>
<version>0.0.2-SNAPSHOT</version>
<artifactId>jenkinsmonitor</artifactId>
<packaging>jar</packaging>
<packaging>${mypackaging}</packaging>
<name>Jenkins Monitor</name>
<description>Ein Jenkinsmonitor für den Systemtray</description>
<inceptionYear>2019</inceptionYear>
Expand Down Expand Up @@ -49,6 +49,7 @@
</distributionManagement>

<properties>
<mypackaging>jar</mypackaging>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<maven.compiler.release>11</maven.compiler.release>
Expand All @@ -73,22 +74,17 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.28</version>
<version>2.0.0-alpha1</version>
<scope>compile</scope>
</dependency>
<!-- APIs von denen die Generate abhängen -->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>nl.jqno.equalsverifier</groupId>
<artifactId>equalsverifier</artifactId>
<version>3.1.10</version>
<scope>test</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>javax.validation</groupId>-->
<!-- <artifactId>validation-api</artifactId>-->
<!-- <version>2.0.1.Final</version>-->
<!-- <scope>compile</scope>-->
<!-- </dependency>-->

<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
Expand Down Expand Up @@ -118,7 +114,12 @@
<version>${junit-jupiter-engine.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>nl.jqno.equalsverifier</groupId>
<artifactId>equalsverifier</artifactId>
<version>3.1.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.bval</groupId>
<artifactId>bval-jsr</artifactId>
Expand Down Expand Up @@ -160,7 +161,7 @@
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.1.0</version>
<version>3.2.0</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
Expand All @@ -180,7 +181,11 @@
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.2</version>
<version>3.2.0</version>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
Expand All @@ -194,7 +199,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<version>0.8.5</version>
</plugin>
</plugins>
</pluginManagement>
Expand Down Expand Up @@ -252,14 +257,6 @@
</phase>
<goals>
<goal>display-dependency-updates</goal>
</goals>
</execution>
<execution>
<id>show-plugin-updates</id>
<phase>
validate
</phase>
<goals>
<goal>display-plugin-updates</goal>
</goals>
</execution>
Expand Down Expand Up @@ -328,14 +325,23 @@
<configuration>
<encoding>UTF-8</encoding>
<release>11</release>
<compilerArgument>-Xlint:all</compilerArgument>
<compilerArgs>
<arg>-Xlint:all</arg>
<arg>--add-opens=java.base/java.lang=ALL-UNNAMED</arg>
<arg>--add-opens=java.base/java.net=ALL-UNNAMED</arg>
</compilerArgs>
<fork>true</fork>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M2</version>
<configuration>
<forkMode>never</forkMode>
<argLine>
--illegal-access=deny
</argLine>
<excludedGroups>
${junit-excluded-groups}
</excludedGroups>
Expand Down Expand Up @@ -370,6 +376,16 @@
</archive>
</configuration>
</plugin>
<!-- <plugin>-->
<!-- <artifactId>maven-jlink-plugin</artifactId>-->
<!-- <version>3.0.0-alpha-1</version>-->
<!-- <extensions>true</extensions>-->
<!-- <configuration>-->
<!-- <verbose>false</verbose>-->
<!-- <noHeaderFiles>true</noHeaderFiles>-->
<!-- <noManPages>true</noManPages>-->
<!-- </configuration>-->
<!-- </plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
Expand Down Expand Up @@ -404,7 +420,6 @@
<!-- NOTE: We don't need a groupId specification because the group is
org.apache.maven.plugins ...which is assumed by default. -->
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>package-assemblies</id>
Expand Down Expand Up @@ -454,12 +469,76 @@
</build>

<profiles>
<profile>
<id>local</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<toolchains>
<jdk>
<version>13</version>
<vendor>openjdk</vendor>
</jdk>
</toolchains>
</configuration>
<executions>
<execution>
<goals>
<goal>toolchain</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<activation>
<!-- nur aktive wenn noch kein anderes aktiv ist -->
<activeByDefault>false</activeByDefault>
</activation>
</profile>
<profile>
<id>headless</id>
<properties>
<junit-excluded-groups>headfull</junit-excluded-groups>
</properties>
</profile>
<!-- <profile>-->
<!-- <id>jmod</id>-->
<!-- <properties>-->
<!-- <mypackaging>jar</mypackaging>-->
<!-- <maven.test.skip>true</maven.test.skip>-->
<!-- </properties>-->
<!-- <build>-->
<!-- <defaultGoal>package</defaultGoal>-->
<!-- <plugins>-->
<!-- <plugin>-->
<!-- <artifactId>maven-jmod-plugin</artifactId>-->
<!-- <version>3.0.0-alpha-1</version>-->
<!-- <extensions>true</extensions>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <id>jmod</id>-->
<!-- <goals>-->
<!-- <goal>create</goal>-->
<!-- </goals>-->
<!-- <phase>package</phase>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<!-- </plugins>-->
<!-- </build>-->
<!-- </profile>-->
<!-- <profile>-->
<!-- <id>jlink</id>-->
<!-- <properties>-->
<!-- <mypackaging>jlink</mypackaging>-->
<!-- <maven.test.skip>false</maven.test.skip>-->
<!-- </properties>-->
<!-- </profile>-->

</profiles>

Expand Down
16 changes: 16 additions & 0 deletions src/appimage-resources/jenkinsmonitor.properties.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# config file of jenkinsmonitor


jenkinsauth.host-#1=http://192.168.178.54:8080
jenkinsauth.username-#1=admin
jenkinsauth.password-#1=admin

# valid valid >4 (value in seconds)
jenkinsmonitor.pollperiod=10

# id = [a-zA-Z0-9]+ (Zahlen und Buchstaben)
# joburl-id=http://localhost:8090/job/multibranchjob/job/master
joburl-#1=http://192.168.178.54:8080/job/jenkinsmonitor-single/
joburl-#3=http://192.168.178.54:8080/job/test/
joburl-#5=http://localhost:8090/job/localmod/

Loading

0 comments on commit 92babae

Please sign in to comment.