Skip to content

Commit

Permalink
Fix Job Service shading
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Rögner <benjamin.roegner@here.com>
  • Loading branch information
roegi committed Oct 21, 2024
1 parent f6974a4 commit a72331a
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 55 deletions.
4 changes: 2 additions & 2 deletions Dockerfile-job-service
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ ENV LOG_PATH /var/log/xyz
ENV LOCALSTACK_ENDPOINT http://aws-localstack:4566
ENV HUB_ENDPOINT http://xyz-hub:8080/hub

COPY xyz-jobs/xyz-job-service/target/xyz-job-service.jar .
COPY xyz-jobs/xyz-job-service/target/xyz-job-service-fat.jar .
ADD Dockerfile-job-service /

EXPOSE 7070
CMD java -jar xyz-job-service.jar
CMD java -jar xyz-job-service-fat.jar
48 changes: 0 additions & 48 deletions xyz-jobs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,54 +47,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>**/Log4j2Plugins.dat</exclude>
</excludes>
</filter>
<filter>
<artifact>org.apache.logging.log4j:log4j-jcl</artifact>
<includes>
<include>**</include>
</includes>
</filter>
<filter>
<artifact>commons-logging:commons-logging</artifact>
<includes>
<include>**</include>
</includes>
</filter>
</filters>
<createDependencyReducedPom>false</createDependencyReducedPom>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.here.xyz.jobs.service.JobService</mainClass>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
</transformers>
<finalName>${project.artifactId}</finalName>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
63 changes: 58 additions & 5 deletions xyz-jobs/xyz-job-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
<artifactId>xyz-job-service</artifactId>
<packaging>jar</packaging>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<!-- XYZ libraries -->
<dependency>
Expand Down Expand Up @@ -169,11 +175,58 @@
</dependency>
</dependencies>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>**/Log4j2Plugins.dat</exclude>
</excludes>
</filter>
<filter>
<artifact>org.apache.logging.log4j:log4j-jcl</artifact>
<includes>
<include>**</include>
</includes>
</filter>
<filter>
<artifact>commons-logging:commons-logging</artifact>
<includes>
<include>**</include>
</includes>
</filter>
</filters>
<createDependencyReducedPom>false</createDependencyReducedPom>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.here.xyz.jobs.service.JobService</mainClass>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
</transformers>
<finalName>${project.artifactId}-fat</finalName>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
Expand Down

0 comments on commit a72331a

Please sign in to comment.