Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

Commit c7ecf4d

Browse files
use plugins in profiles instead of outside (#5)
1 parent 7df0fe2 commit c7ecf4d

File tree

1 file changed

+114
-83
lines changed

1 file changed

+114
-83
lines changed

pom.xml

Lines changed: 114 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,86 @@
162162
</execution>
163163
</executions>
164164
</plugin>
165+
166+
<!-- detect os -->
167+
<plugin>
168+
<groupId>kr.motd.maven</groupId>
169+
<artifactId>os-maven-plugin</artifactId>
170+
<version>${os-maven-plugin.version}</version>
171+
<executions>
172+
<execution>
173+
<goals>
174+
<goal>detect</goal>
175+
</goals>
176+
</execution>
177+
</executions>
178+
</plugin>
179+
180+
<!-- checkstyle -->
181+
<plugin>
182+
<groupId>org.apache.maven.plugins</groupId>
183+
<artifactId>maven-checkstyle-plugin</artifactId>
184+
<version>${maven-checkstyle-plugin.version}</version>
185+
<dependencies>
186+
<dependency>
187+
<groupId>com.puppycrawl.tools</groupId>
188+
<artifactId>checkstyle</artifactId>
189+
<version>${checkstyle.version}</version>
190+
</dependency>
191+
</dependencies>
192+
<configuration>
193+
<configLocation>dev-support/google_checks.xml</configLocation>
194+
<suppressionsLocation>dev-support/checkstyle-suppressions.xml</suppressionsLocation>
195+
<consoleOutput>true</consoleOutput>
196+
<failsOnError>true</failsOnError>
197+
<failOnViolation>true</failOnViolation>
198+
<violationSeverity>warning</violationSeverity>
199+
<linkXRef>false</linkXRef>
200+
</configuration>
201+
<executions>
202+
<execution>
203+
<id>validate</id>
204+
<phase>validate</phase>
205+
<goals>
206+
<goal>check</goal>
207+
</goals>
208+
</execution>
209+
</executions>
210+
</plugin>
211+
212+
<!-- generate java sources from proto -->
213+
<plugin>
214+
<groupId>org.xolstice.maven.plugins</groupId>
215+
<artifactId>protobuf-maven-plugin</artifactId>
216+
<version>${protobuf-maven-plugin.version}</version>
217+
<configuration>
218+
<protocArtifact>
219+
com.google.protobuf:protoc:${protobuf-java.version}:exe:${os.detected.classifier}
220+
</protocArtifact>
221+
<pluginId>grpc-java</pluginId>
222+
<pluginArtifact>
223+
io.grpc:protoc-gen-grpc-java:${io.grpc.version}:exe:${os.detected.classifier}
224+
</pluginArtifact>
225+
</configuration>
226+
<executions>
227+
<execution>
228+
<goals>
229+
<goal>compile</goal>
230+
<goal>compile-custom</goal>
231+
</goals>
232+
</execution>
233+
</executions>
234+
</plugin>
235+
236+
<!-- compile java -->
237+
<plugin>
238+
<groupId>org.apache.maven.plugins</groupId>
239+
<artifactId>maven-compiler-plugin</artifactId>
240+
<version>${maven-compiler-plugin.version}</version>
241+
<configuration>
242+
<release>${maven-compiler-plugin.release}</release>
243+
</configuration>
244+
</plugin>
165245
</plugins>
166246
</build>
167247
</profile>
@@ -198,94 +278,45 @@
198278
</execution>
199279
</executions>
200280
</plugin>
281+
282+
<!-- generate java sources from proto -->
283+
<plugin>
284+
<groupId>org.xolstice.maven.plugins</groupId>
285+
<artifactId>protobuf-maven-plugin</artifactId>
286+
<version>${protobuf-maven-plugin.version}</version>
287+
<configuration>
288+
<protocArtifact>
289+
com.google.protobuf:protoc:${protobuf-java.version}:exe:${os.detected.classifier}
290+
</protocArtifact>
291+
<pluginId>grpc-java</pluginId>
292+
<pluginArtifact>
293+
io.grpc:protoc-gen-grpc-java:${io.grpc.version}:exe:${os.detected.classifier}
294+
</pluginArtifact>
295+
</configuration>
296+
<executions>
297+
<execution>
298+
<goals>
299+
<goal>compile</goal>
300+
<goal>compile-custom</goal>
301+
</goals>
302+
</execution>
303+
</executions>
304+
</plugin>
305+
306+
<!-- compile java -->
307+
<plugin>
308+
<groupId>org.apache.maven.plugins</groupId>
309+
<artifactId>maven-compiler-plugin</artifactId>
310+
<version>${maven-compiler-plugin.version}</version>
311+
<configuration>
312+
<release>${maven-compiler-plugin.release}</release>
313+
</configuration>
314+
</plugin>
201315
</plugins>
202316
</build>
203317
</profile>
204318
</profiles>
205319

206-
<build>
207-
<plugins>
208-
<!-- detect os -->
209-
<plugin>
210-
<groupId>kr.motd.maven</groupId>
211-
<artifactId>os-maven-plugin</artifactId>
212-
<version>${os-maven-plugin.version}</version>
213-
<executions>
214-
<execution>
215-
<goals>
216-
<goal>detect</goal>
217-
</goals>
218-
</execution>
219-
</executions>
220-
</plugin>
221-
222-
<!-- compile java -->
223-
<plugin>
224-
<groupId>org.apache.maven.plugins</groupId>
225-
<artifactId>maven-compiler-plugin</artifactId>
226-
<version>${maven-compiler-plugin.version}</version>
227-
<configuration>
228-
<release>${maven-compiler-plugin.release}</release>
229-
</configuration>
230-
</plugin>
231-
232-
<!-- generate java sources from proto -->
233-
<plugin>
234-
<groupId>org.xolstice.maven.plugins</groupId>
235-
<artifactId>protobuf-maven-plugin</artifactId>
236-
<version>${protobuf-maven-plugin.version}</version>
237-
<configuration>
238-
<protocArtifact>
239-
com.google.protobuf:protoc:${protobuf-java.version}:exe:${os.detected.classifier}
240-
</protocArtifact>
241-
<pluginId>grpc-java</pluginId>
242-
<pluginArtifact>
243-
io.grpc:protoc-gen-grpc-java:${io.grpc.version}:exe:${os.detected.classifier}
244-
</pluginArtifact>
245-
</configuration>
246-
<executions>
247-
<execution>
248-
<goals>
249-
<goal>compile</goal>
250-
<goal>compile-custom</goal>
251-
</goals>
252-
</execution>
253-
</executions>
254-
</plugin>
255-
256-
<plugin>
257-
<groupId>org.apache.maven.plugins</groupId>
258-
<artifactId>maven-checkstyle-plugin</artifactId>
259-
<version>${maven-checkstyle-plugin.version}</version>
260-
<dependencies>
261-
<dependency>
262-
<groupId>com.puppycrawl.tools</groupId>
263-
<artifactId>checkstyle</artifactId>
264-
<version>${checkstyle.version}</version>
265-
</dependency>
266-
</dependencies>
267-
<configuration>
268-
<configLocation>dev-support/google_checks.xml</configLocation>
269-
<suppressionsLocation>dev-support/checkstyle-suppressions.xml</suppressionsLocation>
270-
<consoleOutput>true</consoleOutput>
271-
<failsOnError>true</failsOnError>
272-
<failOnViolation>true</failOnViolation>
273-
<violationSeverity>warning</violationSeverity>
274-
<linkXRef>false</linkXRef>
275-
</configuration>
276-
<executions>
277-
<execution>
278-
<id>validate</id>
279-
<phase>validate</phase>
280-
<goals>
281-
<goal>check</goal>
282-
</goals>
283-
</execution>
284-
</executions>
285-
</plugin>
286-
</plugins>
287-
</build>
288-
289320
<dependencies>
290321
<dependency>
291322
<groupId>io.grpc</groupId>

0 commit comments

Comments
 (0)