Skip to content

Commit 617ea2c

Browse files
committed
Add prettier
1 parent 8a4b6f5 commit 617ea2c

File tree

1 file changed

+50
-20
lines changed

1 file changed

+50
-20
lines changed

pom.xml

Lines changed: 50 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
</scm>
4646
<properties>
4747
<jreleaser-maven-plugin.version>1.20.0</jreleaser-maven-plugin.version>
48+
<sonar-maven-plugin.version>5.1.0.4751</sonar-maven-plugin.version>
49+
<prettier-java.version>2.1.0</prettier-java.version>
50+
<prettier-maven-plugin.version>0.22</prettier-maven-plugin.version>
51+
<plugin.prettier.goal>write</plugin.prettier.goal>
4852
</properties>
4953
<build>
5054
<plugins>
@@ -90,29 +94,25 @@
9094
</jreleaser>
9195
</configuration>
9296
</plugin>
97+
<plugin>
98+
<groupId>com.hubspot.maven.plugins</groupId>
99+
<artifactId>prettier-maven-plugin</artifactId>
100+
<version>${prettier-maven-plugin.version}</version>
101+
<configuration>
102+
<prettierJavaVersion>${prettier-java.version}</prettierJavaVersion>
103+
</configuration>
104+
<executions>
105+
<execution>
106+
<phase>validate</phase>
107+
<goals>
108+
<goal>${plugin.prettier.goal}</goal>
109+
</goals>
110+
</execution>
111+
</executions>
112+
</plugin>
93113
</plugins>
94114
</build>
95115
<profiles>
96-
<profile>
97-
<id>sonar</id>
98-
<activation>
99-
<activeByDefault>false</activeByDefault>
100-
</activation>
101-
102-
<properties>
103-
<sonar-maven-plugin.version>3.7.0.1746</sonar-maven-plugin.version>
104-
</properties>
105-
106-
<build>
107-
<plugins>
108-
<plugin>
109-
<groupId>org.sonarsource.scanner.maven</groupId>
110-
<artifactId>sonar-maven-plugin</artifactId>
111-
<version>${sonar-maven-plugin.version}</version>
112-
</plugin>
113-
</plugins>
114-
</build>
115-
</profile>
116116
<profile>
117117
<id>publication</id>
118118
<properties>
@@ -154,5 +154,35 @@
154154
</plugins>
155155
</build>
156156
</profile>
157+
<profile>
158+
<id>sonar</id>
159+
<activation>
160+
<activeByDefault>false</activeByDefault>
161+
</activation>
162+
<build>
163+
<plugins>
164+
<plugin>
165+
<groupId>org.sonarsource.scanner.maven</groupId>
166+
<artifactId>sonar-maven-plugin</artifactId>
167+
<version>${sonar-maven-plugin.version}</version>
168+
</plugin>
169+
<plugin>
170+
<groupId>com.hubspot.maven.plugins</groupId>
171+
<artifactId>prettier-maven-plugin</artifactId>
172+
<version>${prettier-maven-plugin.version}</version>
173+
<configuration>
174+
<skip>true</skip>
175+
</configuration>
176+
</plugin>
177+
</plugins>
178+
</build>
179+
</profile>
180+
<profile>
181+
<id>prettierCheck</id>
182+
<properties>
183+
<!-- In the CI environment we want to validate that code is formatted -->
184+
<plugin.prettier.goal>check</plugin.prettier.goal>
185+
</properties>
186+
</profile>
157187
</profiles>
158188
</project>

0 commit comments

Comments
 (0)