Skip to content

Commit 081a508

Browse files
committed
wrap the enforcer rule with a profile that is activated by default
1 parent 4efc30b commit 081a508

File tree

1 file changed

+63
-36
lines changed

1 file changed

+63
-36
lines changed

google-cloud-bigtable/pom.xml

Lines changed: 63 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,69 @@
349349
</dependencies>
350350

351351
<profiles>
352+
<profile>
353+
<id>enable-enforcer-rules</id>
354+
<activation>
355+
<property>
356+
<!-- By default, Maven runs the enforcer rules. The shared release script
357+
may pass profile name that doesn't exist in this project. Let's ignore
358+
the enforcer rule (requireProfileIdsExist) in that case, leveraging
359+
the presence of the performRelease property. -->
360+
<name>!performRelease</name>
361+
</property>
362+
</activation>
363+
<build>
364+
<plugins>
365+
<plugin>
366+
<groupId>org.apache.maven.plugins</groupId>
367+
<artifactId>maven-enforcer-plugin</artifactId>
368+
<version>3.5.0</version>
369+
<executions>
370+
<!-- Prevent users from mistyping a profile name -->
371+
<execution>
372+
<id>enforce-valid-profile</id>
373+
<configuration>
374+
<rules>
375+
<requireProfileIdsExist/>
376+
</rules>
377+
</configuration>
378+
<goals>
379+
<goal>enforce</goal>
380+
</goals>
381+
</execution>
382+
<!-- Ensure that greatest version of each transitive dependency got selected -->
383+
<execution>
384+
<id>enforce-dependency-upper-bound</id>
385+
<configuration>
386+
<rules>
387+
<requireUpperBoundDeps/>
388+
</rules>
389+
</configuration>
390+
<goals>
391+
<goal>enforce</goal>
392+
</goals>
393+
</execution>
394+
</executions>
395+
<!--
396+
workaround for https://github.com/mojohaus/extra-enforcer-rules/issues/132
397+
Remove when it's fixed upstream.
398+
-->
399+
<dependencies>
400+
<dependency>
401+
<groupId>org.codehaus.mojo</groupId>
402+
<artifactId>extra-enforcer-rules</artifactId>
403+
<version>1.8.0</version>
404+
</dependency>
405+
<dependency>
406+
<groupId>org.apache.maven.shared</groupId>
407+
<artifactId>maven-dependency-tree</artifactId>
408+
<version>3.3.0</version>
409+
</dependency>
410+
</dependencies>
411+
</plugin>
412+
</plugins>
413+
</build>
414+
</profile>
352415
<profile>
353416
<id>enable-verbose-grpc-logs</id>
354417
<properties>
@@ -668,42 +731,6 @@
668731
</execution>
669732
</executions>
670733
</plugin>
671-
<plugin>
672-
<groupId>org.apache.maven.plugins</groupId>
673-
<artifactId>maven-enforcer-plugin</artifactId>
674-
<version>3.5.0</version>
675-
<executions>
676-
<!-- Ensure that greatest version of each transitive dependency got selected -->
677-
<execution>
678-
<id>enforce-dependency-upper-bound</id>
679-
<configuration>
680-
<rules>
681-
<requireUpperBoundDeps/>
682-
</rules>
683-
</configuration>
684-
<goals>
685-
<goal>enforce</goal>
686-
</goals>
687-
</execution>
688-
</executions>
689-
<!--
690-
workaround for https://github.com/mojohaus/extra-enforcer-rules/issues/132
691-
Remove when it's fixed upstream.
692-
-->
693-
<dependencies>
694-
<dependency>
695-
<groupId>org.codehaus.mojo</groupId>
696-
<artifactId>extra-enforcer-rules</artifactId>
697-
<version>1.8.0</version>
698-
</dependency>
699-
<dependency>
700-
<groupId>org.apache.maven.shared</groupId>
701-
<artifactId>maven-dependency-tree</artifactId>
702-
<version>3.3.0</version>
703-
</dependency>
704-
</dependencies>
705-
</plugin>
706-
707734
<plugin>
708735
<groupId>org.apache.maven.plugins</groupId>
709736
<artifactId>maven-dependency-plugin</artifactId>

0 commit comments

Comments
 (0)