|
| 1 | +package templates |
| 2 | + |
| 3 | +import "sigs.k8s.io/kubebuilder/v3/pkg/model/file" |
| 4 | + |
| 5 | +var _ file.Template = &PomXmlFile{} |
| 6 | + |
| 7 | +type PomXmlFile struct { |
| 8 | + file.TemplateMixin |
| 9 | +} |
| 10 | + |
| 11 | +func (f *PomXmlFile) SetTemplateDefaults() error { |
| 12 | + if f.Path == "" { |
| 13 | + f.Path = "pom.xml" |
| 14 | + } |
| 15 | + |
| 16 | + f.TemplateBody = pomxmlTemplate |
| 17 | + |
| 18 | + return nil |
| 19 | +} |
| 20 | + |
| 21 | +// TODO: pass in the name of the operator i.e. replace Memcached |
| 22 | +const pomxmlTemplate = `<?xml version="1.0" encoding="UTF-8"?> |
| 23 | +<project xmlns="http://maven.apache.org/POM/4.0.0" |
| 24 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 25 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| 26 | + <parent> |
| 27 | + <artifactId>quarkus-operator-sdk-parent</artifactId> |
| 28 | + <groupId>io.quarkiverse.operatorsdk</groupId> |
| 29 | + <version>1.8.1-SNAPSHOT</version> |
| 30 | + </parent> |
| 31 | + <modelVersion>4.0.0</modelVersion> |
| 32 | +
|
| 33 | + <artifactId>quarkus-operator-sdk-samples</artifactId> |
| 34 | + <name>Quarkus - Operator SDK - Samples</name> |
| 35 | + <packaging>jar</packaging> |
| 36 | +
|
| 37 | + <properties> |
| 38 | + <maven.compiler.parameters>true</maven.compiler.parameters> |
| 39 | + </properties> |
| 40 | +
|
| 41 | + <dependencies> |
| 42 | + <dependency> |
| 43 | + <groupId>io.quarkiverse.operatorsdk</groupId> |
| 44 | + <artifactId>quarkus-operator-sdk</artifactId> |
| 45 | + <version>${project.version}</version> |
| 46 | + </dependency> |
| 47 | + <dependency> |
| 48 | + <groupId>io.fabric8</groupId> |
| 49 | + <artifactId>crd-generator-apt</artifactId> |
| 50 | + <version>${kubernetes-client.version}</version> |
| 51 | + </dependency> |
| 52 | + <dependency> |
| 53 | + <groupId>io.quarkus</groupId> |
| 54 | + <artifactId>quarkus-resteasy-jackson</artifactId> |
| 55 | + </dependency> |
| 56 | + <dependency> |
| 57 | + <groupId>io.quarkus</groupId> |
| 58 | + <artifactId>quarkus-rest-client</artifactId> |
| 59 | + </dependency> |
| 60 | + <dependency> |
| 61 | + <groupId>io.quarkus</groupId> |
| 62 | + <artifactId>quarkus-rest-client-jackson</artifactId> |
| 63 | + </dependency> |
| 64 | +
|
| 65 | +
|
| 66 | + </dependencies> |
| 67 | +
|
| 68 | + <build> |
| 69 | + <plugins> |
| 70 | + <plugin> |
| 71 | + <groupId>io.quarkus</groupId> |
| 72 | + <artifactId>quarkus-maven-plugin</artifactId> |
| 73 | + <executions> |
| 74 | + <execution> |
| 75 | + <goals> |
| 76 | + <goal>build</goal> |
| 77 | + </goals> |
| 78 | + </execution> |
| 79 | + </executions> |
| 80 | + </plugin> |
| 81 | + </plugins> |
| 82 | + </build> |
| 83 | +
|
| 84 | +</project> |
| 85 | +` |
| 86 | + |
0 commit comments