Skip to content

Commit d944de2

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

4 files changed

Lines changed: 102 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>schemas</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>

pom.xml

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@
350350
</dependencyManagement>
351351

352352
<modules>
353+
<module>schemas</module>
353354
<module>core</module>
354355
<module>jdbc/mariadb</module>
355356
<module>jdbc/mysql-j-8</module>
@@ -525,31 +526,6 @@
525526
</compilerArgs>
526527
<failOnWarning>true</failOnWarning>
527528
</configuration>
528-
<executions>
529-
<!-- compile generated sources first, with lint disabled -->
530-
<execution>
531-
<id>default-compile</id>
532-
<phase>compile</phase>
533-
<goals><goal>compile</goal></goals>
534-
<configuration>
535-
<compileSourceRoots>
536-
<compileSourceRoot>${project.basedir}/target/generated-sources</compileSourceRoot>
537-
</compileSourceRoots>
538-
<failOnWarning>false</failOnWarning>
539-
</configuration>
540-
</execution>
541-
<!-- compile the real sources -->
542-
<execution>
543-
<id>compile-main-java</id>
544-
<phase>compile</phase>
545-
<goals><goal>compile</goal></goals>
546-
<configuration>
547-
<compileSourceRoots>
548-
<compileSourceRoot>${project.build.sourceDirectory}</compileSourceRoot>
549-
</compileSourceRoots>
550-
</configuration>
551-
</execution>
552-
</executions>
553529
</plugin>
554530

555531
<plugin>

schemas/pom.xml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
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.28.4</version><!-- {x-version-update:jdbc-socket-factory-parent:current} -->
25+
</parent>
26+
27+
<artifactId>schemas</artifactId>
28+
<version>1.28.4</version><!-- {x-version-update:jdbc-socket-factory-core:current} -->
29+
<packaging>jar</packaging>
30+
31+
<name>Cloud SQL Metadata Exchange Protocol (Core Library, don't depend on this directly)</name>
32+
<description>
33+
Generated source code to support the Metadata Exchange Protocol.
34+
</description>
35+
36+
<properties>
37+
<assembly.skipAssembly>false</assembly.skipAssembly>
38+
</properties>
39+
40+
<dependencies>
41+
<dependency>
42+
<groupId>com.google.protobuf</groupId>
43+
<artifactId>protobuf-java</artifactId>
44+
</dependency>
45+
</dependencies>
46+
47+
48+
<build>
49+
<plugins>
50+
<!--
51+
<plugin>
52+
<groupId>org.apache.maven.plugins</groupId>
53+
<artifactId>maven-javadoc-plugin</artifactId>
54+
<version>3.6.3</version>
55+
<configuration>
56+
<source>8</source>
57+
<sourcepath>${project.build.directory}/generated-sources</sourcepath>
58+
</configuration>
59+
<executions>
60+
<execution>
61+
<id>attach-javadocs</id>
62+
<goals>
63+
<goal>jar</goal>
64+
</goals>
65+
</execution>
66+
</executions>
67+
</plugin>
68+
-->
69+
<plugin>
70+
<groupId>com.github.os72</groupId>
71+
<artifactId>protoc-jar-maven-plugin</artifactId>
72+
<version>3.11.4</version>
73+
<executions>
74+
<execution>
75+
<phase>generate-sources</phase>
76+
<goals>
77+
<goal>run</goal>
78+
</goals>
79+
<configuration>
80+
<optimizeCodegen>false</optimizeCodegen>
81+
<protocVersion>3.23.0</protocVersion>
82+
<includeStdTypes>true</includeStdTypes>
83+
<outputOptions></outputOptions>
84+
</configuration>
85+
</execution>
86+
</executions>
87+
</plugin>
88+
89+
<plugin>
90+
<groupId>org.apache.maven.plugins</groupId>
91+
<artifactId>maven-compiler-plugin</artifactId>
92+
<configuration>
93+
<failOnWarning>false</failOnWarning>
94+
</configuration>
95+
</plugin>
96+
</plugins>
97+
</build>
98+
</project>
File renamed without changes.

0 commit comments

Comments
 (0)