BAEL-5633 - dockersing a simple java jar (#12454)

This commit is contained in:
Sumit Pal Singh 2022-07-09 20:12:38 +05:30 committed by GitHub
parent 2823129540
commit 58c7385029
5 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,4 @@
FROM openjdk:11
MAINTAINER baeldung.com
COPY target/docker-java-jar-0.0.1-SNAPSHOT.jar app.jar
ENTRYPOINT ["java","-jar","/app.jar"]

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-boot-2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../../parent-boot-2</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>docker-java-jar</artifactId>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
<configuration>
<archive>
<manifest>
<mainClass>com.baeldung.HelloWorld</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,8 @@
package com.baeldung;
public class HelloWorld {
public static void main(String[] args){
System.out.println("Welcome to our application");
}
}

View File

@ -23,6 +23,7 @@
<module>docker-images</module>
<module>docker-spring-boot</module>
<module>docker-spring-boot-postgres</module>
<module>docker-java-jar</module>
</modules>
<properties>

View File

@ -1400,6 +1400,7 @@
<lombok.version>1.18.20</lombok.version>
<h2.version>1.4.200</h2.version>
<guava.version>31.0.1-jre</guava.version>
<maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
</properties>
</project>