Skip to content

Commit 7c29a58

Browse files
committed
refactor: simplify formatting pluging handling
1 parent 7805d0a commit 7c29a58

File tree

10 files changed

+117
-138
lines changed

10 files changed

+117
-138
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# IDE Config and Code Style
22

33
This project has a strictly enforced code style. Code formatting is done by the Eclipse code
4-
formatter, using the config files found in the `build-tools` directory. By
4+
formatter, using the config files found in the `contributing` directory. By
55
default when you run `mvn install` the code will be formatted automatically. When submitting a
66
pull request the CI build will fail if running the formatter results in any code changes, so it is
77
recommended that you always run a full Maven build before submitting a pull request.
@@ -11,7 +11,7 @@ If you want to run the formatting without doing a full build, you can run `mvn p
1111
#### Eclipse Setup
1212

1313
Open the *Preferences* window, and then navigate to _Java_ -> _Code Style_ -> _Formatter_. Click _
14-
Import_ and then select the `eclipse-format.xml` file in the `build-tools`
14+
Import_ and then select the `eclipse-format.xml` file in the `contributing`
1515
directory.
1616

1717
Next navigate to _Java_ -> _Code Style_ -> _Organize Imports_. Click _Import_ and select
@@ -29,11 +29,11 @@ Settings_ -> _Eclipse Code Formatter_.
2929

3030
Select _Use the Eclipse Code Formatter_, then change the _Eclipse Java Formatter Config File_ to
3131
point to the
32-
`eclipse-format.xml` file in the `build-tools` directory. Make sure the _
32+
`eclipse-format.xml` file in the `contributing` directory. Make sure the _
3333
Optimize Imports_ box is ticked, and select the `eclipse.importorder` file as the import order
3434
config file.
3535

3636
Next, disable wildcard imports:
3737
navigate to _Editor_ -> _Code Style_ -> _Java_ -> _Imports_
3838
and set _Class count to use import with '\*'_ to `999`. Do the same with _Names count to use static
39-
import with '\*'_.
39+
import with '\*'_.

analysis/pom.xml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,15 @@
3131
</dependencies>
3232

3333
<build>
34-
<pluginManagement>
35-
<plugins>
36-
<plugin>
37-
<groupId>net.revelc.code.formatter</groupId>
38-
<artifactId>formatter-maven-plugin</artifactId>
39-
<dependencies>
40-
<dependency>
41-
<groupId>net.laprun.sustainability</groupId>
42-
<artifactId>build-tools</artifactId>
43-
<version>0.1.1-SNAPSHOT</version>
44-
</dependency>
45-
</dependencies>
46-
</plugin>
47-
</plugins>
48-
</pluginManagement>
34+
<plugins>
35+
<plugin>
36+
<groupId>net.revelc.code.formatter</groupId>
37+
<artifactId>formatter-maven-plugin</artifactId>
38+
<configuration>
39+
<configFile>../contributing/eclipse-format.xml</configFile>
40+
</configuration>
41+
</plugin>
42+
</plugins>
4943
</build>
5044

5145
</project>

build-tools/pom.xml

Lines changed: 0 additions & 15 deletions
This file was deleted.

if-manifest-export/pom.xml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,9 @@
3030
<plugin>
3131
<groupId>net.revelc.code.formatter</groupId>
3232
<artifactId>formatter-maven-plugin</artifactId>
33-
<dependencies>
34-
<dependency>
35-
<groupId>net.laprun.sustainability</groupId>
36-
<artifactId>build-tools</artifactId>
37-
<version>${project.version}</version>
38-
</dependency>
39-
</dependencies>
33+
<configuration>
34+
<configFile>../contributing/eclipse-format.xml</configFile>
35+
</configuration>
4036
</plugin>
4137
</plugins>
4238
</build>

measure/pom.xml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,14 @@
2525
</dependencies>
2626

2727
<build>
28-
<pluginManagement>
29-
<plugins>
30-
<plugin>
31-
<groupId>net.revelc.code.formatter</groupId>
32-
<artifactId>formatter-maven-plugin</artifactId>
33-
<dependencies>
34-
<dependency>
35-
<groupId>net.laprun.sustainability</groupId>
36-
<artifactId>build-tools</artifactId>
37-
<version>0.1.1-SNAPSHOT</version>
38-
</dependency>
39-
</dependencies>
40-
</plugin>
41-
</plugins>
42-
</pluginManagement>
28+
<plugins>
29+
<plugin>
30+
<groupId>net.revelc.code.formatter</groupId>
31+
<artifactId>formatter-maven-plugin</artifactId>
32+
<configuration>
33+
<configFile>../contributing/eclipse-format.xml</configFile>
34+
</configuration>
35+
</plugin>
36+
</plugins>
4337
</build>
4438
</project>

metadata/pom.xml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,14 @@
2020
</dependencies>
2121

2222
<build>
23-
<pluginManagement>
2423
<plugins>
2524
<plugin>
2625
<groupId>net.revelc.code.formatter</groupId>
2726
<artifactId>formatter-maven-plugin</artifactId>
28-
<dependencies>
29-
<dependency>
30-
<groupId>net.laprun.sustainability</groupId>
31-
<artifactId>build-tools</artifactId>
32-
<version>0.1.1-SNAPSHOT</version>
33-
</dependency>
34-
</dependencies>
27+
<configuration>
28+
<configFile>../contributing/eclipse-format.xml</configFile>
29+
</configuration>
3530
</plugin>
3631
</plugins>
37-
</pluginManagement>
3832
</build>
3933
</project>

pom.xml

Lines changed: 80 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
4646
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
4747
<skipITs>true</skipITs>
48+
<format.skip>false</format.skip>
4849

4950
<quarkus.platform.version>3.17.4</quarkus.platform.version>
5051
<assertj.version>3.26.3</assertj.version>
@@ -68,7 +69,6 @@
6869
</properties>
6970

7071
<modules>
71-
<module>build-tools</module>
7272
<module>metadata</module>
7373
<module>measure</module>
7474
<module>server</module>
@@ -121,7 +121,7 @@
121121
<artifactId>formatter-maven-plugin</artifactId>
122122
<version>${formatter-plugin.version}</version>
123123
<configuration>
124-
<configFile>eclipse-format.xml</configFile>
124+
<configFile>contributing/eclipse-format.xml</configFile>
125125
<lineEnding>LF</lineEnding>
126126
<skip>${format.skip}</skip>
127127
</configuration>
@@ -137,84 +137,106 @@
137137
<skip>${format.skip}</skip>
138138
</configuration>
139139
</plugin>
140+
<plugin>
141+
<groupId>org.apache.maven.plugins</groupId>
142+
<artifactId>maven-deploy-plugin</artifactId>
143+
<version>${maven-deploy-plugin.version}</version>
144+
</plugin>
145+
<plugin>
146+
<groupId>${quarkus.platform.group-id}</groupId>
147+
<artifactId>quarkus-maven-plugin</artifactId>
148+
<version>${quarkus.platform.version}</version>
149+
<extensions>true</extensions>
150+
<executions>
151+
<execution>
152+
<goals>
153+
<goal>build</goal>
154+
<goal>generate-code</goal>
155+
<goal>generate-code-tests</goal>
156+
</goals>
157+
</execution>
158+
</executions>
159+
</plugin>
160+
<plugin>
161+
<groupId>org.apache.maven.plugins</groupId>
162+
<artifactId>maven-compiler-plugin</artifactId>
163+
<version>${compiler-plugin.version}</version>
164+
<configuration>
165+
<compilerArgs>
166+
<arg>-parameters</arg>
167+
</compilerArgs>
168+
</configuration>
169+
</plugin>
170+
<plugin>
171+
<groupId>org.apache.maven.plugins</groupId>
172+
<artifactId>maven-surefire-plugin</artifactId>
173+
<version>${maven-surefire-plugin.version}</version>
174+
<dependencies>
175+
<dependency>
176+
<groupId>me.fabriciorby</groupId>
177+
<artifactId>maven-surefire-junit5-tree-reporter</artifactId>
178+
<version>1.4.0</version>
179+
</dependency>
180+
</dependencies>
181+
<configuration>
182+
<reportFormat>plain</reportFormat>
183+
<consoleOutputReporter>
184+
<disable>true</disable>
185+
</consoleOutputReporter>
186+
<statelessTestsetInfoReporter
187+
implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoTreeReporter">
188+
<theme>UNICODE</theme>
189+
</statelessTestsetInfoReporter>
190+
<systemPropertyVariables>
191+
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
192+
<maven.home>${maven.home}</maven.home>
193+
</systemPropertyVariables>
194+
</configuration>
195+
</plugin>
196+
<plugin>
197+
<groupId>org.apache.maven.plugins</groupId>
198+
<artifactId>maven-failsafe-plugin</artifactId>
199+
<version>${maven-failsafe-plugin.version}</version>
200+
<executions>
201+
<execution>
202+
<goals>
203+
<goal>integration-test</goal>
204+
<goal>verify</goal>
205+
</goals>
206+
<configuration>
207+
<systemPropertyVariables>
208+
<native.image.path>${project.build.directory}/${project.build.finalName}-runner
209+
</native.image.path>
210+
<java.util.logging.manager>org.jboss.logmanager.LogManager
211+
</java.util.logging.manager>
212+
<maven.home>${maven.home}</maven.home>
213+
</systemPropertyVariables>
214+
</configuration>
215+
</execution>
216+
</executions>
217+
</plugin>
140218
</plugins>
141219
</pluginManagement>
142220
<plugins>
143221
<plugin>
144222
<groupId>org.apache.maven.plugins</groupId>
145223
<artifactId>maven-deploy-plugin</artifactId>
146-
<version>${maven-deploy-plugin.version}</version>
147224
</plugin>
148225
<plugin>
149226
<groupId>${quarkus.platform.group-id}</groupId>
150227
<artifactId>quarkus-maven-plugin</artifactId>
151-
<version>${quarkus.platform.version}</version>
152-
<extensions>true</extensions>
153-
<executions>
154-
<execution>
155-
<goals>
156-
<goal>build</goal>
157-
<goal>generate-code</goal>
158-
<goal>generate-code-tests</goal>
159-
</goals>
160-
</execution>
161-
</executions>
162228
</plugin>
163229
<plugin>
164230
<groupId>org.apache.maven.plugins</groupId>
165231
<artifactId>maven-compiler-plugin</artifactId>
166-
<version>${compiler-plugin.version}</version>
167-
<configuration>
168-
<compilerArgs>
169-
<arg>-parameters</arg>
170-
</compilerArgs>
171-
</configuration>
172232
</plugin>
173233
<plugin>
174234
<groupId>org.apache.maven.plugins</groupId>
175235
<artifactId>maven-surefire-plugin</artifactId>
176-
<version>${maven-surefire-plugin.version}</version>
177-
<dependencies>
178-
<dependency>
179-
<groupId>me.fabriciorby</groupId>
180-
<artifactId>maven-surefire-junit5-tree-reporter</artifactId>
181-
<version>1.4.0</version>
182-
</dependency>
183-
</dependencies>
184-
<configuration>
185-
<reportFormat>plain</reportFormat>
186-
<consoleOutputReporter>
187-
<disable>true</disable>
188-
</consoleOutputReporter>
189-
<statelessTestsetInfoReporter implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoTreeReporter">
190-
<theme>UNICODE</theme>
191-
</statelessTestsetInfoReporter>
192-
<systemPropertyVariables>
193-
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
194-
<maven.home>${maven.home}</maven.home>
195-
</systemPropertyVariables>
196-
</configuration>
197236
</plugin>
198237
<plugin>
199238
<groupId>org.apache.maven.plugins</groupId>
200239
<artifactId>maven-failsafe-plugin</artifactId>
201-
<version>${maven-failsafe-plugin.version}</version>
202-
<executions>
203-
<execution>
204-
<goals>
205-
<goal>integration-test</goal>
206-
<goal>verify</goal>
207-
</goals>
208-
<configuration>
209-
<systemPropertyVariables>
210-
<native.image.path>${project.build.directory}/${project.build.finalName}-runner
211-
</native.image.path>
212-
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
213-
<maven.home>${maven.home}</maven.home>
214-
</systemPropertyVariables>
215-
</configuration>
216-
</execution>
217-
</executions>
218240
</plugin>
219241
<plugin>
220242
<groupId>net.revelc.code.formatter</groupId>

server/pom.xml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,15 @@
3131
<version>${os-maven-plugin.version}</version>
3232
</extension>
3333
</extensions>
34-
<pluginManagement>
35-
<plugins>
36-
<plugin>
37-
<groupId>net.revelc.code.formatter</groupId>
38-
<artifactId>formatter-maven-plugin</artifactId>
39-
<dependencies>
40-
<dependency>
41-
<groupId>net.laprun.sustainability</groupId>
42-
<artifactId>build-tools</artifactId>
43-
<version>${project.version}</version>
44-
</dependency>
45-
</dependencies>
46-
</plugin>
47-
</plugins>
48-
</pluginManagement>
34+
<plugins>
35+
<plugin>
36+
<groupId>net.revelc.code.formatter</groupId>
37+
<artifactId>formatter-maven-plugin</artifactId>
38+
<configuration>
39+
<configFile>../contributing/eclipse-format.xml</configFile>
40+
</configuration>
41+
</plugin>
42+
</plugins>
4943
</build>
5044
<profiles>
5145
<profile>

0 commit comments

Comments
 (0)