Skip to content

Commit e9c84d3

Browse files
author
Vincent Potucek
committed
rewrite-maven-plugin
1 parent 740f1c8 commit e9c84d3

File tree

109 files changed

+1350
-477
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+1350
-477
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ updates:
8686
- dependency-name: org.apache.maven.plugins:*
8787
- dependency-name: org.codehaus.mojo:*
8888
- dependency-name: io.fabric8:docker-maven-plugin
89-
- dependency-name: org.openrewrite.maven:rewrite-maven-plugin
90-
- dependency-name: com.diffplug.spotless:spotless-maven-plugin
89+
- dependency-name: net.revelc.code.formatter:formatter-maven-plugin
90+
- dependency-name: net.revelc.code:impsort-maven-plugin
9191
# Narayana
9292
- dependency-name: org.jboss.narayana.jta:*
9393
- dependency-name: org.jboss.narayana.jts:*

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,10 @@ in `quarkus-parent` (root `pom.xml`).
406406

407407
When contributing to Quarkus, it is recommended to respect the following rules.
408408

409+
> **Note:** The `impsort-maven-plugin` uses the `.cache` directory on each module to speed up the build.
410+
> Because we have configured the plugin to store in a versioned directory, you may notice over time that the `.cache` directory grows in size. You can safely delete the `.cache` directory in each module to reclaim the space.
411+
> Running `./mvnw clean -Dclean-cache` automatically deletes that directory for you.
412+
409413
**Contributing to an extension**
410414

411415
When you contribute to an extension, after having applied your changes, run:

build-parent/pom.xml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,87 @@
683683
</build>
684684

685685
<profiles>
686+
<profile>
687+
<id>format</id>
688+
<activation>
689+
<activeByDefault>true</activeByDefault>
690+
<property>
691+
<name>!no-format</name>
692+
</property>
693+
</activation>
694+
<build>
695+
<plugins>
696+
<plugin>
697+
<groupId>net.revelc.code.formatter</groupId>
698+
<artifactId>formatter-maven-plugin</artifactId>
699+
<executions>
700+
<execution>
701+
<phase>process-sources</phase>
702+
<goals>
703+
<goal>format</goal>
704+
</goals>
705+
</execution>
706+
</executions>
707+
</plugin>
708+
<plugin>
709+
<groupId>net.revelc.code</groupId>
710+
<artifactId>impsort-maven-plugin</artifactId>
711+
<configuration>
712+
<removeUnused>true</removeUnused>
713+
</configuration>
714+
<executions>
715+
<execution>
716+
<id>sort-imports</id>
717+
<goals>
718+
<goal>sort</goal>
719+
</goals>
720+
</execution>
721+
</executions>
722+
</plugin>
723+
</plugins>
724+
</build>
725+
</profile>
726+
<profile>
727+
<id>validate</id>
728+
<activation>
729+
<activeByDefault>true</activeByDefault>
730+
<property>
731+
<name>no-format</name>
732+
</property>
733+
</activation>
734+
<build>
735+
<plugins>
736+
<plugin>
737+
<groupId>net.revelc.code.formatter</groupId>
738+
<artifactId>formatter-maven-plugin</artifactId>
739+
<executions>
740+
<execution>
741+
<phase>process-sources</phase>
742+
<goals>
743+
<goal>validate</goal>
744+
</goals>
745+
</execution>
746+
</executions>
747+
</plugin>
748+
<plugin>
749+
<groupId>net.revelc.code</groupId>
750+
<artifactId>impsort-maven-plugin</artifactId>
751+
<configuration>
752+
<removeUnused>true</removeUnused>
753+
</configuration>
754+
<executions>
755+
<execution>
756+
<id>check-imports</id>
757+
<goals>
758+
<goal>check</goal>
759+
</goals>
760+
</execution>
761+
</executions>
762+
</plugin>
763+
</plugins>
764+
</build>
765+
</profile>
766+
686767
<profile>
687768
<id>format-kotlin</id>
688769
<activation>

core/deployment/src/main/java/io/quarkus/deployment/QuarkusAugmentor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ public BuildResult run() throws Exception {
9797
long start = System.nanoTime();
9898
log.debug("Beginning Quarkus augmentation");
9999
ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
100-
try (QuarkusBuildCloseablesBuildItem buildCloseables = new QuarkusBuildCloseablesBuildItem()) {
100+
QuarkusBuildCloseablesBuildItem buildCloseables = new QuarkusBuildCloseablesBuildItem();
101+
try {
101102
Thread.currentThread().setContextClassLoader(deploymentClassLoader);
102103

103104
final BuildChainBuilder chainBuilder = BuildChain.builder();
@@ -183,6 +184,7 @@ public BuildResult run() throws Exception {
183184

184185
}
185186
Thread.currentThread().setContextClassLoader(originalClassLoader);
187+
buildCloseables.close();
186188
}
187189
}
188190

devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package io.quarkus.maven;
22

33
import static io.quarkus.analytics.dto.segment.TrackEventType.DEV_MODE;
4+
import static io.quarkus.maven.QuarkusBootstrapMojo.CLOSE_BOOTSTRAPPED_APP_PARAM;
5+
import static io.quarkus.maven.QuarkusBootstrapMojo.MODE_PARAM;
46
import static io.smallrye.common.expression.Expression.Flag.LENIENT_SYNTAX;
57
import static io.smallrye.common.expression.Expression.Flag.NO_TRIM;
68
import static java.util.Collections.emptyMap;

devtools/maven/src/main/java/io/quarkus/maven/components/Prompter.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ public void collectInput() throws IOException {
4848
return;
4949
}
5050
final TerminalConnection connection = new TerminalConnection();
51-
try (connection) {
52-
connection.setSignalHandler(interruptionSignalHandler());
51+
connection.setSignalHandler(interruptionSignalHandler());
52+
try {
5353
read(connection, ReadlineBuilder.builder().enableHistory(false).build(), prompts.iterator());
5454
connection.openBlocking();
55+
} finally {
56+
connection.close();
5557
}
5658
}
5759

extensions/grpc/deployment/src/test/java/io/quarkus/grpc/client/bd/ClientBlockingDeadlineTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.quarkus.grpc.client.bd;
22

3+
import static org.junit.jupiter.api.Assertions.assertEquals;
34
import static org.junit.jupiter.api.Assertions.assertNotNull;
45

56
import org.jboss.shrinkwrap.api.ShrinkWrap;

extensions/grpc/stubs/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@
6969
</exclusion>
7070
</exclusions>
7171
</dependency>
72-
<dependency>
73-
<groupId>javax.annotation</groupId>
74-
<artifactId>javax.annotation-api</artifactId>
75-
</dependency>
7672
</dependencies>
7773

7874
<build>

extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/proxies/ProxyDefinitions.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import org.hibernate.internal.util.ReflectHelper;
1414
import org.hibernate.internal.util.collections.ArrayHelper;
1515
import org.hibernate.mapping.PersistentClass;
16+
import org.hibernate.proxy.pojo.ProxyFactoryHelper;
1617
import org.hibernate.proxy.pojo.bytebuddy.ByteBuddyProxyHelper;
1718
import org.jboss.logging.Logger;
1819

extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/mapping/id/optimizer/optimizer/AbstractIdOptimizerDefaultTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import org.assertj.core.api.AbstractObjectAssert;
1010
import org.assertj.core.api.InstanceOfAssertFactories;
11+
import org.hibernate.SessionFactory;
1112
import org.hibernate.id.OptimizableGenerator;
1213
import org.hibernate.id.enhanced.Optimizer;
1314
import org.hibernate.id.enhanced.PooledLoOptimizer;

0 commit comments

Comments
 (0)