Skip to content

Commit fb523c8

Browse files
ericbottardilayaperumalg
authored andcommitted
(Maven) Run format:apply locally, CI runs format:check.
Signed-off-by: Eric Bottard <[email protected]>
1 parent cb6afde commit fb523c8

File tree

1 file changed

+57
-14
lines changed

1 file changed

+57
-14
lines changed

pom.xml

Lines changed: 57 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -366,20 +366,6 @@
366366

367367
<build>
368368
<plugins>
369-
<plugin>
370-
<groupId>io.spring.javaformat</groupId>
371-
<artifactId>spring-javaformat-maven-plugin</artifactId>
372-
<version>${spring-javaformat-maven-plugin.version}</version>
373-
<executions>
374-
<execution>
375-
<phase>validate</phase>
376-
<inherited>true</inherited>
377-
<goals>
378-
<goal>validate</goal>
379-
</goals>
380-
</execution>
381-
</executions>
382-
</plugin>
383369
<plugin>
384370
<groupId>org.apache.maven.plugins</groupId>
385371
<artifactId>maven-checkstyle-plugin</artifactId>
@@ -611,6 +597,63 @@
611597
</build>
612598

613599
<profiles>
600+
<profile>
601+
<id>format-check</id>
602+
<activation>
603+
<property>
604+
<name>env.CI</name>
605+
<value>true</value>
606+
</property>
607+
</activation>
608+
<build>
609+
<plugins>
610+
<plugin>
611+
<groupId>io.spring.javaformat</groupId>
612+
<artifactId>spring-javaformat-maven-plugin</artifactId>
613+
<version>${spring-javaformat-maven-plugin.version}</version>
614+
<executions>
615+
<execution>
616+
<phase>validate</phase>
617+
<inherited>true</inherited>
618+
<goals>
619+
<goal>validate</goal>
620+
</goals>
621+
</execution>
622+
</executions>
623+
</plugin>
624+
625+
</plugins>
626+
</build>
627+
628+
</profile>
629+
<profile>
630+
<id>format-apply</id>
631+
<activation>
632+
<property>
633+
<name>!env.CI</name>
634+
</property>
635+
</activation>
636+
<build>
637+
<plugins>
638+
<plugin>
639+
<groupId>io.spring.javaformat</groupId>
640+
<artifactId>spring-javaformat-maven-plugin</artifactId>
641+
<version>${spring-javaformat-maven-plugin.version}</version>
642+
<executions>
643+
<execution>
644+
<phase>process-sources</phase>
645+
<inherited>true</inherited>
646+
<goals>
647+
<goal>apply</goal>
648+
</goals>
649+
</execution>
650+
</executions>
651+
</plugin>
652+
653+
</plugins>
654+
</build>
655+
656+
</profile>
614657
<profile>
615658
<id>license</id>
616659
<activation>

0 commit comments

Comments
 (0)