Skip to content

Commit b0ae773

Browse files
cheswoop
authored andcommitted
Set build requirements, minimum Maven version
Urge the use of <dependencyManagement> by disallowing duplicate dependency declarations. See #262. Making final releases with SNAPSHOT dependencies in use is a really bad idea that can happen by accidental oversight. Enforcer helps ensure it doesn't. For build reproducibility it's good to specify what Maven versions are supported for the project's build to work. 3.0.5 is the minimum required version by all our plugins currently, according to: $ mvn versions:display-plugin-updates
1 parent 437a192 commit b0ae773

2 files changed

Lines changed: 48 additions & 6 deletions

File tree

ingestion/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,10 @@
184184
<dependency>
185185
<groupId>com.google.protobuf</groupId>
186186
<artifactId>protobuf-java</artifactId>
187-
<version>${protobufVersion}</version>
188187
</dependency>
189188
<dependency>
190189
<groupId>com.google.protobuf</groupId>
191190
<artifactId>protobuf-java-util</artifactId>
192-
<version>${protobufVersion}</version>
193191
</dependency>
194192

195193
<dependency>
@@ -202,7 +200,6 @@
202200
<dependency>
203201
<groupId>org.apache.kafka</groupId>
204202
<artifactId>kafka-clients</artifactId>
205-
<version>2.3.0</version>
206203
</dependency>
207204

208205
<dependency>
@@ -257,8 +254,6 @@
257254
<dependency>
258255
<groupId>com.github.kstyrc</groupId>
259256
<artifactId>embedded-redis</artifactId>
260-
<version>0.6</version>
261-
<scope>test</scope>
262257
</dependency>
263258

264259
<!-- To run actual Kafka for ingestion integration test -->
@@ -269,7 +264,6 @@
269264
<scope>test</scope>
270265
</dependency>
271266

272-
273267
<dependency>
274268
<groupId>com.google.guava</groupId>
275269
<artifactId>guava</artifactId>

pom.xml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,54 @@
348348
</compilerArgs>
349349
</configuration>
350350
</plugin>
351+
<plugin>
352+
<groupId>org.apache.maven.plugins</groupId>
353+
<artifactId>maven-enforcer-plugin</artifactId>
354+
<version>3.0.0-M2</version>
355+
<executions>
356+
<execution>
357+
<id>valid-build-environment</id>
358+
<goals>
359+
<goal>enforce</goal>
360+
</goals>
361+
<configuration>
362+
<rules>
363+
<requireMavenVersion>
364+
<version>3.0.5</version>
365+
</requireMavenVersion>
366+
<requireJavaVersion>
367+
<version>1.8.0</version>
368+
</requireJavaVersion>
369+
<reactorModuleConvergence />
370+
</rules>
371+
</configuration>
372+
</execution>
373+
<execution>
374+
<id>consistent-dependency-versions</id>
375+
<goals>
376+
<goal>enforce</goal>
377+
</goals>
378+
<configuration>
379+
<rules>
380+
<banDuplicatePomDependencyVersions />
381+
</rules>
382+
</configuration>
383+
</execution>
384+
<execution>
385+
<id>no-snapshot-deps-at-release</id>
386+
<goals>
387+
<goal>enforce</goal>
388+
</goals>
389+
<configuration>
390+
<rules>
391+
<requireReleaseDeps>
392+
<onlyWhenRelease>true</onlyWhenRelease>
393+
</requireReleaseDeps>
394+
</rules>
395+
</configuration>
396+
</execution>
397+
</executions>
398+
</plugin>
351399
<plugin>
352400
<groupId>org.apache.maven.plugins</groupId>
353401
<artifactId>maven-surefire-plugin</artifactId>

0 commit comments

Comments
 (0)