Skip to content

Commit 332f6cd

Browse files
committed
Adapt pom to other samples
fix target, parent
1 parent e2fbed2 commit 332f6cd

File tree

1 file changed

+60
-22
lines changed

1 file changed

+60
-22
lines changed

samples/tomcat/pom.xml

+60-22
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,31 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66

7-
<groupId>com.example.jaxdemo</groupId>
8-
<artifactId>tomcat-operator</artifactId>
9-
<version>1.0-SNAPSHOT</version>
7+
<parent>
8+
<groupId>com.github.containersolutions</groupId>
9+
<artifactId>java-operator-sdk-samples</artifactId>
10+
<version>1.3.1-SNAPSHOT</version>
11+
</parent>
12+
13+
<artifactId>tomcat-sample</artifactId>
14+
<name>Operator SDK - Samples - Tomcat</name>
15+
<description>Provisions a Tomcat server based on CRDs</description>
16+
<packaging>jar</packaging>
1017

1118
<properties>
1219
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1320
<java-operator-sdk.version>1.3.0</java-operator-sdk.version>
14-
<maven.compiler.source>11</maven.compiler.source>
15-
<maven.compiler.target>11</maven.compiler.target>
21+
<java.version>8</java.version>
22+
<maven.compiler.source>1.8</maven.compiler.source>
23+
<maven.compiler.target>1.8</maven.compiler.target>
1624
<jib-maven-plugin.version>2.5.2</jib-maven-plugin.version>
1725
</properties>
1826

1927
<dependencies>
2028
<dependency>
2129
<groupId>com.github.containersolutions</groupId>
2230
<artifactId>operator-framework</artifactId>
23-
<version>${java-operator-sdk.version}</version>
31+
<version>${project.version}</version>
2432
</dependency>
2533
<dependency>
2634
<groupId>org.apache.logging.log4j</groupId>
@@ -37,36 +45,66 @@
3745
<artifactId>commons-io</artifactId>
3846
<version>2.6</version>
3947
</dependency>
48+
<dependency>
49+
<groupId>io.fabric8</groupId>
50+
<artifactId>kubernetes-client</artifactId>
51+
<version>4.12.0</version>
52+
</dependency>
4053
</dependencies>
4154

4255
<build>
4356
<plugins>
4457
<plugin>
45-
<groupId>com.google.cloud.tools</groupId>
46-
<artifactId>jib-maven-plugin</artifactId>
47-
<version>${jib-maven-plugin.version}</version>
58+
<groupId>org.apache.maven.plugins</groupId>
59+
<artifactId>maven-compiler-plugin</artifactId>
60+
<version>3.8.1</version>
61+
</plugin>
62+
<plugin>
63+
<groupId>com.spotify</groupId>
64+
<artifactId>dockerfile-maven-plugin</artifactId>
65+
<version>1.4.13</version>
4866
<configuration>
49-
<from>
50-
<image>gcr.io/distroless/java:11</image>
51-
</from>
52-
<to>
53-
<image>eu.gcr.io/adamsandor-test/tomcat-operator</image>
54-
</to>
67+
<repository>tomcat-operator</repository>
68+
<tag>latest</tag>
69+
<buildArgs>
70+
<JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
71+
</buildArgs>
5572
</configuration>
73+
</plugin>
74+
<plugin>
75+
<groupId>org.apache.maven.plugins</groupId>
76+
<artifactId>maven-shade-plugin</artifactId>
77+
<version>3.2.4</version>
5678
<executions>
5779
<execution>
5880
<phase>package</phase>
5981
<goals>
60-
<goal>build</goal>
82+
<goal>shade</goal>
6183
</goals>
84+
<configuration>
85+
<createDependencyReducedPom>false</createDependencyReducedPom>
86+
<transformers>
87+
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
88+
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
89+
<manifestEntries>
90+
<Main-Class>com.github.containersolutions.operator.sample.TomcatOperator</Main-Class>
91+
<Build-Number>1.0</Build-Number>
92+
<Multi-Release>true</Multi-Release>
93+
</manifestEntries>
94+
</transformer>
95+
</transformers>
96+
<filters>
97+
<filter>
98+
<artifact>io.fabric8:openshift-client</artifact>
99+
<excludes>
100+
<exclude>io/fabric8/kubernetes/client/Config*</exclude>
101+
</excludes>
102+
</filter>
103+
</filters>
104+
</configuration>
62105
</execution>
63106
</executions>
64107
</plugin>
65-
<plugin>
66-
<groupId>org.apache.maven.plugins</groupId>
67-
<artifactId>maven-compiler-plugin</artifactId>
68-
<version>3.8.1</version>
69-
</plugin>
70108
</plugins>
71109
</build>
72-
</project>
110+
</project>

0 commit comments

Comments
 (0)