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

crazyhzm pushed a commit to branch 3.3
in repository https://gitbox.apache.org/repos/asf/dubbo.git

commit a3096054ed65ed1225bb99b11fef633801c7c2b3
Author: crazyhzm <[email protected]>
AuthorDate: Mon Nov 13 11:57:36 2023 +0800

    Add spotless for dubo-distribution
    
    Signed-off-by: crazyhzm <[email protected]>
---
 dubbo-distribution/pom.xml | 66 +++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 60 insertions(+), 6 deletions(-)

diff --git a/dubbo-distribution/pom.xml b/dubbo-distribution/pom.xml
index cb85215347..ac8f517f98 100644
--- a/dubbo-distribution/pom.xml
+++ b/dubbo-distribution/pom.xml
@@ -27,6 +27,13 @@
   <artifactId>dubbo-distribution</artifactId>
   <packaging>pom</packaging>
 
+  <properties>
+    <spotless-maven-plugin.version>2.40.0</spotless-maven-plugin.version>
+    <spotless.action>check</spotless.action>
+    <dubbo-shared-resources.version>1.0.0</dubbo-shared-resources.version>
+    <palantirJavaFormat.version>2.38.0</palantirJavaFormat.version>
+  </properties>
+
   <profiles>
     <profile>
       <id>release</id>
@@ -41,7 +48,7 @@
     <profile>
       <id>dubbo-all</id>
       <activation>
-        <activeByDefault>true</activeByDefault>
+        <jdk>[8,)</jdk>
       </activation>
       <modules>
         <module>dubbo-all</module>
@@ -55,11 +62,58 @@
       </modules>
     </profile>
     <profile>
-      <id>dubbo-all-shaded</id>
-      <modules>
-        <module>dubbo-all-shaded</module>
-        <module>dubbo-bom</module>
-      </modules>
+      <id>java11+</id>
+      <activation>
+        <jdk>[11,)</jdk>
+      </activation>
+      <build>
+        <!--- newer versions of plugins requires JDK 11 -->
+        <plugins>
+          <plugin>
+            <groupId>com.diffplug.spotless</groupId>
+            <artifactId>spotless-maven-plugin</artifactId>
+            <version>${spotless-maven-plugin.version}</version>
+            <configuration>
+              <java>
+                <palantirJavaFormat>
+                  <version>${palantirJavaFormat.version}</version>
+                </palantirJavaFormat>
+                <removeUnusedImports />
+                <importOrder>
+                  <file>dubbo-importorder.txt</file>
+                </importOrder>
+                <licenseHeader>
+                  <file>checkstyle-header.txt</file>
+                </licenseHeader>
+              </java>
+              <pom>
+                <sortPom>
+                  <expandEmptyElements>false</expandEmptyElements>
+                  
<spaceBeforeCloseEmptyElement>true</spaceBeforeCloseEmptyElement>
+                </sortPom>
+              </pom>
+              <upToDateChecking>
+                <enabled>true</enabled>
+              </upToDateChecking>
+            </configuration>
+            <dependencies>
+              <dependency>
+                <groupId>com.alibaba</groupId>
+                <artifactId>dubbo-shared-resources</artifactId>
+                <version>${dubbo-shared-resources.version}</version>
+              </dependency>
+            </dependencies>
+            <executions>
+              <execution>
+                <goals>
+                  <goal>${spotless.action}</goal>
+                </goals>
+                <phase>process-sources</phase>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
     </profile>
   </profiles>
 </project>

Reply via email to