Skip to content

Commit c4682a1

Browse files
committed
refactor: Move generated protobuf into a separate module to fix compiler issues.
1 parent 22137c8 commit c4682a1

4 files changed

Lines changed: 199 additions & 82 deletions

File tree

core/pom.xml

Lines changed: 3 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -211,69 +211,15 @@
211211
<scope>test</scope>
212212
</dependency>
213213
<dependency>
214-
<groupId>com.google.protobuf</groupId>
215-
<artifactId>protobuf-java</artifactId>
214+
<groupId>com.google.cloud.sql</groupId>
215+
<artifactId>mdxprotocol</artifactId>
216+
<version>${project.parent.version}</version>
216217
</dependency>
217218

218219
</dependencies>
219220

220221
<build>
221222
<plugins>
222-
<plugin>
223-
<groupId>org.codehaus.mojo</groupId>
224-
<artifactId>build-helper-maven-plugin</artifactId>
225-
<version>3.3.0</version>
226-
<executions>
227-
<execution>
228-
<id>test</id>
229-
<phase>generate-sources</phase>
230-
<goals>
231-
<goal>add-source</goal>
232-
</goals>
233-
<configuration>
234-
<sources>
235-
<source>${project.basedir}/target/generated-sources</source>
236-
</sources>
237-
</configuration>
238-
</execution>
239-
</executions>
240-
</plugin>
241-
<plugin>
242-
<groupId>org.apache.maven.plugins</groupId>
243-
<artifactId>maven-javadoc-plugin</artifactId>
244-
<version>3.6.3</version>
245-
<configuration>
246-
<source>8</source>
247-
<sourcepath>${project.build.directory}/generated-sources</sourcepath>
248-
</configuration>
249-
<executions>
250-
<execution>
251-
<id>attach-javadocs</id>
252-
<goals>
253-
<goal>jar</goal>
254-
</goals>
255-
</execution>
256-
</executions>
257-
</plugin>
258-
<plugin>
259-
<groupId>com.github.os72</groupId>
260-
<artifactId>protoc-jar-maven-plugin</artifactId>
261-
<version>3.11.4</version>
262-
<executions>
263-
<execution>
264-
<phase>generate-sources</phase>
265-
<goals>
266-
<goal>run</goal>
267-
</goals>
268-
<configuration>
269-
<optimizeCodegen>false</optimizeCodegen>
270-
<protocVersion>3.23.0</protocVersion>
271-
<includeStdTypes>true</includeStdTypes>
272-
<outputOptions></outputOptions>
273-
</configuration>
274-
</execution>
275-
</executions>
276-
</plugin>
277223
<plugin>
278224
<groupId>org.apache.maven.plugins</groupId>
279225
<artifactId>maven-jar-plugin</artifactId>

mdxprotocol/pom.xml

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright 2025 Google LLC
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<project xmlns="http://maven.apache.org/POM/4.0.0"
18+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
20+
<modelVersion>4.0.0</modelVersion>
21+
<parent>
22+
<groupId>com.google.cloud.sql</groupId>
23+
<artifactId>jdbc-socket-factory-parent</artifactId>
24+
<version>1.27.2-SNAPSHOT</version>
25+
</parent>
26+
27+
<artifactId>mdxprotocol</artifactId>
28+
<name>Cloud SQL Metadata Exchange Protocol (Core Library, don't depend on this directly)</name>
29+
<description>
30+
Generated source code to support the Metadata Exchange Protocol.
31+
</description>
32+
33+
<properties>
34+
<assembly.skipAssembly>false</assembly.skipAssembly>
35+
</properties>
36+
37+
<dependencies>
38+
<dependency>
39+
<groupId>com.google.protobuf</groupId>
40+
<artifactId>protobuf-java</artifactId>
41+
</dependency>
42+
</dependencies>
43+
44+
45+
<build>
46+
<plugins>
47+
<plugin>
48+
<groupId>org.codehaus.mojo</groupId>
49+
<artifactId>build-helper-maven-plugin</artifactId>
50+
<version>3.3.0</version>
51+
<executions>
52+
<execution>
53+
<id>test</id>
54+
<phase>generate-sources</phase>
55+
<goals>
56+
<goal>add-source</goal>
57+
</goals>
58+
<configuration>
59+
<sources>
60+
<source>${project.basedir}/target/generated-sources</source>
61+
</sources>
62+
</configuration>
63+
</execution>
64+
</executions>
65+
</plugin>
66+
<plugin>
67+
<groupId>org.apache.maven.plugins</groupId>
68+
<artifactId>maven-javadoc-plugin</artifactId>
69+
<version>3.6.3</version>
70+
<configuration>
71+
<source>8</source>
72+
<sourcepath>${project.build.directory}/generated-sources</sourcepath>
73+
</configuration>
74+
<executions>
75+
<execution>
76+
<id>attach-javadocs</id>
77+
<goals>
78+
<goal>jar</goal>
79+
</goals>
80+
</execution>
81+
</executions>
82+
</plugin>
83+
<plugin>
84+
<groupId>com.github.os72</groupId>
85+
<artifactId>protoc-jar-maven-plugin</artifactId>
86+
<version>3.11.4</version>
87+
<executions>
88+
<execution>
89+
<phase>generate-sources</phase>
90+
<goals>
91+
<goal>run</goal>
92+
</goals>
93+
<configuration>
94+
<optimizeCodegen>false</optimizeCodegen>
95+
<protocVersion>3.23.0</protocVersion>
96+
<includeStdTypes>true</includeStdTypes>
97+
<outputOptions></outputOptions>
98+
</configuration>
99+
</execution>
100+
</executions>
101+
</plugin>
102+
103+
<plugin>
104+
<groupId>org.apache.maven.plugins</groupId>
105+
<artifactId>maven-compiler-plugin</artifactId>
106+
<version>3.14.0</version>
107+
<configuration>
108+
<source>8</source>
109+
<target>8</target>
110+
<fork>true</fork>
111+
<compilerArgs>
112+
<arg>-XDcompilePolicy=simple</arg>
113+
<arg>-Xlint:-options</arg> <!-- ignore warning about deprecated java 8 src -->
114+
<arg>--should-stop=ifError=FLOW</arg>
115+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
116+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
117+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
118+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
119+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
120+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
121+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
122+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
123+
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
124+
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
125+
</compilerArgs>
126+
<annotationProcessorPaths>
127+
<path>
128+
<groupId>com.google.errorprone</groupId>
129+
<artifactId>error_prone_core</artifactId>
130+
<version>2.41.0</version>
131+
</path>
132+
</annotationProcessorPaths>
133+
<failOnWarning>true</failOnWarning>
134+
</configuration>
135+
<executions>
136+
<!-- compile generated sources first, with lint disabled -->
137+
<execution>
138+
<id>default-compile</id>
139+
<phase>compile</phase>
140+
<goals>
141+
<goal>compile</goal>
142+
</goals>
143+
<configuration>
144+
<compileSourceRoots>
145+
<compileSourceRoot>${project.basedir}/target/generated-sources</compileSourceRoot>
146+
</compileSourceRoots>
147+
<failOnWarning>false</failOnWarning>
148+
</configuration>
149+
</execution>
150+
</executions>
151+
</plugin>
152+
153+
<plugin>
154+
<groupId>org.apache.maven.plugins</groupId>
155+
<artifactId>maven-jar-plugin</artifactId>
156+
<version>3.4.2</version>
157+
<executions>
158+
<execution>
159+
<goals>
160+
<goal>test-jar</goal>
161+
</goals>
162+
</execution>
163+
</executions>
164+
</plugin>
165+
<plugin>
166+
<groupId>org.apache.maven.plugins</groupId>
167+
<artifactId>maven-dependency-plugin</artifactId>
168+
<configuration>
169+
<usedDependencies>
170+
<!-- This dependency is not used at compile-time. -->
171+
<dependency>ch.qos.logback:logback-classic</dependency>
172+
</usedDependencies>
173+
</configuration>
174+
</plugin>
175+
</plugins>
176+
</build>
177+
<profiles>
178+
<profile>
179+
<id>google-conscript</id>
180+
<dependencies>
181+
<dependency>
182+
<groupId>org.conscrypt</groupId>
183+
<artifactId>conscrypt-openjdk-uber</artifactId>
184+
<version>2.5.2</version>
185+
</dependency>
186+
<dependency>
187+
<groupId>org.bouncycastle</groupId>
188+
<artifactId>bcpkix-jdk15on</artifactId>
189+
<version>1.70</version>
190+
<scope>provided</scope>
191+
</dependency>
192+
</dependencies>
193+
</profile>
194+
</profiles>
195+
</project>
File renamed without changes.

pom.xml

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@
339339
</dependencyManagement>
340340

341341
<modules>
342+
<module>mdxprotocol</module>
342343
<module>core</module>
343344
<module>jdbc/mariadb</module>
344345
<module>jdbc/mysql-j-8</module>
@@ -532,31 +533,6 @@
532533
</annotationProcessorPaths>
533534
<failOnWarning>true</failOnWarning>
534535
</configuration>
535-
<executions>
536-
<!-- compile generated sources first, with lint disabled -->
537-
<execution>
538-
<id>default-compile</id>
539-
<phase>compile</phase>
540-
<goals><goal>compile</goal></goals>
541-
<configuration>
542-
<compileSourceRoots>
543-
<compileSourceRoot>${project.basedir}/target/generated-sources</compileSourceRoot>
544-
</compileSourceRoots>
545-
<failOnWarning>false</failOnWarning>
546-
</configuration>
547-
</execution>
548-
<!-- compile the real sources -->
549-
<execution>
550-
<id>compile-main-java</id>
551-
<phase>compile</phase>
552-
<goals><goal>compile</goal></goals>
553-
<configuration>
554-
<compileSourceRoots>
555-
<compileSourceRoot>${project.build.sourceDirectory}</compileSourceRoot>
556-
</compileSourceRoots>
557-
</configuration>
558-
</execution>
559-
</executions>
560536
</plugin>
561537

562538
<plugin>

0 commit comments

Comments
 (0)