Skip to content

Commit 960e631

Browse files
committed
By default build jar library for controller modules. Add executable profile which builds images. Activate executable profile when deploying. Fixes #2012
1 parent 2d541a1 commit 960e631

File tree

2 files changed

+50
-33
lines changed

2 files changed

+50
-33
lines changed

scripts/deploy.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
set -e
33

44
./mvnw deploy -DskipTests -B -Pfast,deploy ${@}
5+
./mvnw clean package -pl :spring-cloud-kubernetes-configuration-watcher,:spring-cloud-kubernetes-discoveryserver,:spring-cloud-kubernetes-configserver -Pexecutable -DskipTests
56
./mvnw dockerfile:push -pl :spring-cloud-kubernetes-configuration-watcher -Pdockerpush ${@}
67
./mvnw dockerfile:push -pl :spring-cloud-kubernetes-discoveryserver -Pdockerpush ${@}
78
./mvnw dockerfile:push -pl :spring-cloud-kubernetes-configserver -Pdockerpush ${@}

spring-cloud-kubernetes-controllers/pom.xml

Lines changed: 49 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -21,42 +21,58 @@
2121

2222
<build>
2323
<plugins>
24-
2524
<plugin>
26-
<groupId>org.springframework.boot</groupId>
27-
<artifactId>spring-boot-maven-plugin</artifactId>
28-
<configuration>
29-
<image>
30-
<name>${env.IMAGE}</name>
31-
<pullPolicy>IF_NOT_PRESENT</pullPolicy>
32-
</image>
33-
<goal>build-image</goal>
34-
</configuration>
35-
<executions>
36-
<execution>
37-
<id>build-image</id>
38-
<phase>package</phase>
39-
<goals>
40-
<goal>build-image-no-fork</goal>
41-
</goals>
42-
</execution>
43-
<execution>
44-
<id>repackage</id>
45-
<phase>package</phase>
46-
<goals>
47-
<goal>repackage</goal>
48-
</goals>
49-
</execution>
50-
<execution>
51-
<goals>
52-
<goal>repackage</goal>
53-
</goals>
54-
</execution>
55-
</executions>
25+
<groupId>org.apache.maven.plugins</groupId>
26+
<artifactId>maven-jar-plugin</artifactId>
5627
</plugin>
57-
5828
</plugins>
59-
6029
</build>
6130

31+
<profiles>
32+
<profile>
33+
<id>executable</id>
34+
<build>
35+
<plugins>
36+
<plugin>
37+
<groupId>org.springframework.boot</groupId>
38+
<artifactId>spring-boot-maven-plugin</artifactId>
39+
<configuration>
40+
<image>
41+
<name>${env.IMAGE}</name>
42+
<pullPolicy>IF_NOT_PRESENT</pullPolicy>
43+
</image>
44+
<goal>build-image</goal>
45+
</configuration>
46+
<executions>
47+
<execution>
48+
<id>build-image</id>
49+
<phase>package</phase>
50+
<goals>
51+
<goal>build-image-no-fork</goal>
52+
</goals>
53+
</execution>
54+
<execution>
55+
<id>repackage</id>
56+
<phase>package</phase>
57+
<goals>
58+
<goal>repackage</goal>
59+
</goals>
60+
<configuration>
61+
<classifier>exec</classifier>
62+
</configuration>
63+
</execution>
64+
<execution>
65+
<goals>
66+
<goal>repackage</goal>
67+
</goals>
68+
<configuration>
69+
<classifier>exec</classifier>
70+
</configuration>
71+
</execution>
72+
</executions>
73+
</plugin>
74+
</plugins>
75+
</build>
76+
</profile>
77+
</profiles>
6278
</project>

0 commit comments

Comments
 (0)