summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Bentele2021-12-16 16:26:22 +0100
committerManuel Bentele2021-12-16 16:26:22 +0100
commit8a2bf6b784b5e3f8e0ad86a926dbcb86371809e3 (patch)
tree053ac46c4f6a213f05a8b829c3c95cf852ddc958
parent[daemon] Add log4j2 configuration for proper logging levels (diff)
downloadtaskman-lite-8a2bf6b784b5e3f8e0ad86a926dbcb86371809e3.tar.gz
taskman-lite-8a2bf6b784b5e3f8e0ad86a926dbcb86371809e3.tar.xz
taskman-lite-8a2bf6b784b5e3f8e0ad86a926dbcb86371809e3.zip
[daemon] Add printing of app information from MANIFEST.MF
-rw-r--r--daemon/pom.xml43
-rw-r--r--daemon/src/main/java/org/openslx/taskmanager/App.java5
2 files changed, 45 insertions, 3 deletions
diff --git a/daemon/pom.xml b/daemon/pom.xml
index 6253441..d4f8397 100644
--- a/daemon/pom.xml
+++ b/daemon/pom.xml
@@ -7,14 +7,38 @@
<version>1.0-SNAPSHOT</version>
<name>taskmanager-daemon</name>
<url>https://git.openslx.org/openslx-ng/taskman-lite.git</url>
-
+ <scm>
+ <connection>scm:git:git://git.openslx.org/openslx-ng/taskman-lite.git</connection>
+ </scm>
<properties>
+ <main.class>org.openslx.taskmanager.App</main.class>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>buildnumber-maven-plugin</artifactId>
+ <version>3.0.0</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>create</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <doCheck>false</doCheck>
+ <doUpdate>false</doUpdate>
+ <timezone>UTC</timezone>
+ <timestampPropertyName>build.time</timestampPropertyName>
+ <scmBranchPropertyName>revision.branch</scmBranchPropertyName>
+ <buildNumberPropertyName>revision.version</buildNumberPropertyName>
+ </configuration>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
@@ -28,7 +52,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
- <version>3.3.0</version>
+ <version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
@@ -40,8 +64,15 @@
<configuration>
<archive>
<manifest>
- <mainClass>org.openslx.taskmanager.App</mainClass>
+ <mainClass>${main.class}</mainClass>
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
+ <manifestEntries>
+ <Build-Timestamp>${build.time}</Build-Timestamp>
+ <Revision-Branch>${revision.branch}</Revision-Branch>
+ <Revision-Version>${revision.version}</Revision-Version>
+ </manifestEntries>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
@@ -67,6 +98,12 @@
<scope>compile</scope>
</dependency>
<dependency>
+ <groupId>org.openslx.bwlp</groupId>
+ <artifactId>master-sync-shared</artifactId>
+ <version>1.1-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>[2.0,3.0)</version>
diff --git a/daemon/src/main/java/org/openslx/taskmanager/App.java b/daemon/src/main/java/org/openslx/taskmanager/App.java
index 4251478..ac3dc71 100644
--- a/daemon/src/main/java/org/openslx/taskmanager/App.java
+++ b/daemon/src/main/java/org/openslx/taskmanager/App.java
@@ -13,6 +13,7 @@ import org.openslx.taskmanager.main.Taskmanager;
import org.openslx.taskmanager.network.NetworkHandlerTcp;
import org.openslx.taskmanager.network.NetworkHandlerUdp;
import org.openslx.taskmanager.network.RequestParser;
+import org.openslx.util.AppUtil;
/**
* Hello world!
@@ -23,6 +24,8 @@ public class App
private static final Logger log = LogManager.getLogger( App.class );
+ private static final String NAME = "bwLehrpool-Taskmanager";
+
public static void main( String[] args ) throws InterruptedException, IOException
{
// setup basic logging appender to log output on console if no external appender (log4j.properties) is configured
@@ -30,6 +33,8 @@ public class App
Configurator.initialize(new DefaultConfiguration());
}
+ AppUtil.logHeader(log, App.NAME, App.class.getPackage().getImplementationVersion());
+
if (Global.PORT_UDP == -1 && Global.PORT_TCP == -1) {
log.fatal( "Neither UDP nor TCP configured" );
System.exit( 1 );