You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by kw...@apache.org on 2025/03/14 14:58:38 UTC

(jackrabbit-filevault) 01/01: JCRVLT-782 Add spotless-m-p with palantir-java-formatter

This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch feature/spotless
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git

commit ff815e167379c69406413bdfdf293bd5ebdc7091
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Fri Mar 14 15:58:27 2025 +0100

    JCRVLT-782 Add spotless-m-p with palantir-java-formatter
    
    WIP, source not yet formatted
---
 parent/pom.xml | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 77 insertions(+), 1 deletion(-)

diff --git a/parent/pom.xml b/parent/pom.xml
index 9fc3c99a..d14427f2 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -284,7 +284,57 @@ Bundle-Category: jackrabbit
                         </execution>
                     </executions>
                 </plugin>
-            </plugins>
+                <plugin>
+                  <groupId>com.diffplug.spotless</groupId>
+                  <artifactId>spotless-maven-plugin</artifactId>
+                  <version>2.44.3</version>
+                  <configuration>
+                    <java>
+                      <!-- orders of used formatters are important MPOM-376 -->
+                      <!-- eg. palantir override importOrder, so should be first -->
+                      <palantirJavaFormat>
+                          <version>2.58.0</version>
+                      </palantirJavaFormat>
+                      <removeUnusedImports />
+                      <importOrder>
+                        <file>config/maven-eclipse-importorder.txt</file>
+                      </importOrder>
+                      <licenseHeader>
+                        <file>config/maven-header-plain.txt</file>
+                      </licenseHeader>
+                    </java>
+                    <!-- accept all endings to support validations on top of source archives -->
+                    <lineEndings>PRESERVE</lineEndings>
+                    <pom>
+                      <sortPom>
+                        <expandEmptyElements>false</expandEmptyElements>
+                        <!-- https://issues.apache.org/jira/browse/MRELEASE-1111 -->
+                        <spaceBeforeCloseEmptyElement>true</spaceBeforeCloseEmptyElement>
+                        <quiet>true</quiet>
+                      </sortPom>
+                    </pom>
+                    <upToDateChecking>
+                      <enabled>true</enabled>
+                    </upToDateChecking>
+                  </configuration>
+                  <dependencies>
+                    <dependency>
+                      <groupId>org.apache.maven.shared</groupId>
+                      <artifactId>maven-shared-resources</artifactId>
+                      <version>6</version>
+                    </dependency>
+                  </dependencies>
+                  <executions>
+                    <execution>
+                      <id>spotless-format</id>
+                      <goals>
+                        <goal>${spotless.action}</goal>
+                      </goals>
+                      <phase>process-sources</phase>
+                    </execution>
+                  </executions>
+                </plugin>
+              </plugins>
         </pluginManagement>
         <plugins>
             <plugin>
@@ -330,6 +380,10 @@ Bundle-Category: jackrabbit
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <groupId>com.diffplug.spotless</groupId>
+                <artifactId>spotless-maven-plugin</artifactId>
+              </plugin>
             <!-- deploy site.xml as being used in downstream dependencies -->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -694,6 +748,28 @@ Bundle-Category: jackrabbit
                 </plugins>
             </build>
         </profile>
+        <profile>
+          <id>format-check</id>
+          <activation>
+            <property>
+              <name>env.CI</name>
+            </property>
+          </activation>
+          <properties>
+            <spotless.action>check</spotless.action>
+          </properties>
+        </profile>
+        <profile>
+          <id>format</id>
+          <activation>
+            <property>
+              <name>!env.CI</name>
+            </property>
+          </activation>
+          <properties>
+            <spotless.action>check</spotless.action>
+          </properties>
+        </profile>
     </profiles>
 
 </project>