forked from GoogleContainerTools/jib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pom.xml
123 lines (113 loc) · 4.46 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?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">
<modelVersion>4.0.0</modelVersion>
<groupId>example</groupId>
<artifactId>java-agent</artifactId>
<version>1</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>2.7.1</jib-maven-plugin.version>
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
<download-maven-plugin.version>1.4.2</download-maven-plugin.version>
<git-commit-id-plugin.version>3.0.1</git-commit-id-plugin.version>
<!-- agents will be extracted relative to this build location -->
<agent-extraction-root>${project.build.directory}/jib-agents</agent-extraction-root>
<!-- location of Stackdriver Debugger Java Agent https://cloud.google.com/debugger/docs/setup/java -->
<stackdriver-debugger-agent-url>https://storage.googleapis.com/cloud-debugger/compute-java/debian-wheezy/cdbg_java_agent_gce.tar.gz</stackdriver-debugger-agent-url>
<!-- where to place the Stackdriver Debugger Java Agent in the container -->
<stackdriver-debugger-agent-location>/opt/cdbg</stackdriver-debugger-agent-location>
</properties>
<dependencies>
<dependency>
<groupId>com.sparkjava</groupId>
<artifactId>spark-core</artifactId>
<version>2.9.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.28</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>${git-commit-id-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>revision</goal>
</goals>
<!-- *NOTE*: The default phase of revision is initialize, but
in case you want to change it, you can do so by adding the phase here -->
<phase>initialize</phase>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
</configuration>
</execution>
</executions>
</plugin>
<!-- Jib -->
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>${jib-maven-plugin.version}</version>
<configuration>
<to>
<image>gcr.io/REPLACE-WITH-YOUR-GCP-PROJECT/image-built-with-jib</image>
</to>
<extraDirectories>
<paths>${agent-extraction-root}</paths>
</extraDirectories>
<container>
<ports>4567</ports>
<jvmFlags>
<jvmFlag>-agentpath:${stackdriver-debugger-agent-location}/cdbg_java_agent.so=--logtostderr=1</jvmFlag>
<jvmFlag>-Dcom.google.cdbg.module=${project.artifactId}</jvmFlag>
<jvmFlag>-Dcom.google.cdbg.version=${project.version}</jvmFlag>
</jvmFlags>
</container>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<version>${download-maven-plugin.version}</version>
<executions>
<execution>
<id>install-stackdriver-debugger</id>
<phase>prepare-package</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>${stackdriver-debugger-agent-url}</url>
<unpack>true</unpack>
<outputDirectory>${agent-extraction-root}/${stackdriver-debugger-agent-location}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>