Skip to content

Commit 19c92fa

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

4 files changed

Lines changed: 195 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: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
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+
29+
<properties>
30+
<assembly.skipAssembly>false</assembly.skipAssembly>
31+
</properties>
32+
33+
<dependencies>
34+
<dependency>
35+
<groupId>com.google.protobuf</groupId>
36+
<artifactId>protobuf-java</artifactId>
37+
</dependency>
38+
</dependencies>
39+
40+
41+
<build>
42+
<plugins>
43+
<plugin>
44+
<groupId>org.codehaus.mojo</groupId>
45+
<artifactId>build-helper-maven-plugin</artifactId>
46+
<version>3.3.0</version>
47+
<executions>
48+
<execution>
49+
<id>test</id>
50+
<phase>generate-sources</phase>
51+
<goals>
52+
<goal>add-source</goal>
53+
</goals>
54+
<configuration>
55+
<sources>
56+
<source>${project.basedir}/target/generated-sources</source>
57+
</sources>
58+
</configuration>
59+
</execution>
60+
</executions>
61+
</plugin>
62+
<plugin>
63+
<groupId>org.apache.maven.plugins</groupId>
64+
<artifactId>maven-javadoc-plugin</artifactId>
65+
<version>3.6.3</version>
66+
<configuration>
67+
<source>8</source>
68+
<sourcepath>${project.build.directory}/generated-sources</sourcepath>
69+
</configuration>
70+
<executions>
71+
<execution>
72+
<id>attach-javadocs</id>
73+
<goals>
74+
<goal>jar</goal>
75+
</goals>
76+
</execution>
77+
</executions>
78+
</plugin>
79+
<plugin>
80+
<groupId>com.github.os72</groupId>
81+
<artifactId>protoc-jar-maven-plugin</artifactId>
82+
<version>3.11.4</version>
83+
<executions>
84+
<execution>
85+
<phase>generate-sources</phase>
86+
<goals>
87+
<goal>run</goal>
88+
</goals>
89+
<configuration>
90+
<optimizeCodegen>false</optimizeCodegen>
91+
<protocVersion>3.23.0</protocVersion>
92+
<includeStdTypes>true</includeStdTypes>
93+
<outputOptions></outputOptions>
94+
</configuration>
95+
</execution>
96+
</executions>
97+
</plugin>
98+
99+
<plugin>
100+
<groupId>org.apache.maven.plugins</groupId>
101+
<artifactId>maven-compiler-plugin</artifactId>
102+
<version>3.14.0</version>
103+
<configuration>
104+
<source>8</source>
105+
<target>8</target>
106+
<fork>true</fork>
107+
<compilerArgs>
108+
<arg>-XDcompilePolicy=simple</arg>
109+
<arg>-Xlint:-options</arg> <!-- ignore warning about deprecated java 8 src -->
110+
<arg>--should-stop=ifError=FLOW</arg>
111+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
112+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
113+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
114+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
115+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
116+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
117+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
118+
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
119+
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
120+
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
121+
</compilerArgs>
122+
<annotationProcessorPaths>
123+
<path>
124+
<groupId>com.google.errorprone</groupId>
125+
<artifactId>error_prone_core</artifactId>
126+
<version>2.41.0</version>
127+
</path>
128+
</annotationProcessorPaths>
129+
<failOnWarning>true</failOnWarning>
130+
</configuration>
131+
<executions>
132+
<!-- compile generated sources first, with lint disabled -->
133+
<execution>
134+
<id>default-compile</id>
135+
<phase>compile</phase>
136+
<goals>
137+
<goal>compile</goal>
138+
</goals>
139+
<configuration>
140+
<compileSourceRoots>
141+
<compileSourceRoot>${project.basedir}/target/generated-sources</compileSourceRoot>
142+
</compileSourceRoots>
143+
<failOnWarning>false</failOnWarning>
144+
</configuration>
145+
</execution>
146+
</executions>
147+
</plugin>
148+
149+
<plugin>
150+
<groupId>org.apache.maven.plugins</groupId>
151+
<artifactId>maven-jar-plugin</artifactId>
152+
<version>3.4.2</version>
153+
<executions>
154+
<execution>
155+
<goals>
156+
<goal>test-jar</goal>
157+
</goals>
158+
</execution>
159+
</executions>
160+
</plugin>
161+
<plugin>
162+
<groupId>org.apache.maven.plugins</groupId>
163+
<artifactId>maven-dependency-plugin</artifactId>
164+
<configuration>
165+
<usedDependencies>
166+
<!-- This dependency is not used at compile-time. -->
167+
<dependency>ch.qos.logback:logback-classic</dependency>
168+
</usedDependencies>
169+
</configuration>
170+
</plugin>
171+
</plugins>
172+
</build>
173+
<profiles>
174+
<profile>
175+
<id>google-conscript</id>
176+
<dependencies>
177+
<dependency>
178+
<groupId>org.conscrypt</groupId>
179+
<artifactId>conscrypt-openjdk-uber</artifactId>
180+
<version>2.5.2</version>
181+
</dependency>
182+
<dependency>
183+
<groupId>org.bouncycastle</groupId>
184+
<artifactId>bcpkix-jdk15on</artifactId>
185+
<version>1.70</version>
186+
<scope>provided</scope>
187+
</dependency>
188+
</dependencies>
189+
</profile>
190+
</profiles>
191+
</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)