Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 91 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,11 @@ limitations under the License.
<plexusDistMgmtSnapshotsUrl>https://oss.sonatype.org/content/repositories/plexus-snapshots</plexusDistMgmtSnapshotsUrl>
<project.build.outputTimestamp>2023-05-06T22:13:46Z</project.build.outputTimestamp>
<gpg.useagent>true</gpg.useagent>
<spotless-maven-plugin.version>2.36.0</spotless-maven-plugin.version>
<mavenPluginToolsVersion>3.9.0</mavenPluginToolsVersion>
<mavenFluidoSkinVersion>1.11.2</mavenFluidoSkinVersion>
<junit5Version>5.9.3</junit5Version>
<spotless.action>check</spotless.action>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -424,7 +426,8 @@ limitations under the License.
<configuration>
<quiet>true</quiet>
<locale>en</locale>
<notimestamp>true</notimestamp><!-- avoid noise for svn/gitpubsub -->
<!-- avoid noise for svn/gitpubsub -->
<notimestamp>true</notimestamp>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -550,6 +553,41 @@ limitations under the License.
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>${spotless-maven-plugin.version}</version>
<configuration>
<java>
<!-- orders of used formatters are important -->
<!-- eg. palantir override importOrder, so should be first -->
<palantirJavaFormat />
<removeUnusedImports />
<importOrder>
<order>javax,java,,\#</order>
</importOrder>
</java>
<pom>
<sortPom>
<expandEmptyElements>false</expandEmptyElements>
<!-- https://issues.apache.org/jira/browse/MRELEASE-1111 -->
<spaceBeforeCloseEmptyElement>true</spaceBeforeCloseEmptyElement>
</sortPom>
</pom>
<upToDateChecking>
<enabled>true</enabled>
</upToDateChecking>
</configuration>
<executions>
<execution>
<id>spotless-check</id>
<goals>
<goal>${spotless.action}</goal>
</goals>
<phase>process-sources</phase>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
Expand Down Expand Up @@ -641,18 +679,6 @@ limitations under the License.
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<reportSets>
<reportSet>
<id>default</id>
<reports>
<report>checkstyle</report>
</reports>
</reportSet>
</reportSets>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
Expand Down Expand Up @@ -764,5 +790,57 @@ limitations under the License.
</plugins>
</build>
</profile>

<profile>
<id>java11+</id>
<activation>
<jdk>[11,)</jdk>
</activation>

<properties>
<maven.compiler.release>${javaVersion}</maven.compiler.release>
<!-- configuration for checkstyle to use with spotless -->
<checkstyle.spotless.config>config/maven_checks_nocodestyle.xml</checkstyle.spotless.config>
</properties>

<build>
<!--- newer versions of plugins requires JDK 11 -->
<plugins>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<configLocation>${checkstyle.spotless.config}</configLocation>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>format-check</id>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO additional profiles are not needed ... I simply execute mvn spotless:apply

<activation>
<property>
<name>!format</name>
</property>
</activation>
<properties>
<spotless.action>check</spotless.action>
</properties>
</profile>
<profile>
<id>format</id>
<activation>
<property>
<name>format</name>
</property>
</activation>
<properties>
<spotless.action>apply</spotless.action>
</properties>
</profile>
</profiles>
</project>