diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 38031544df..6b36749392 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -60,6 +60,6 @@ repos: # Spotless Hooks - id: spotless name: spotless lint - entry: ./mvnw spotless:apply + entry: ./mvnw spotless:check language: script pass_filenames: false diff --git a/dolphinscheduler-alert/dolphinscheduler-alert-server/pom.xml b/dolphinscheduler-alert/dolphinscheduler-alert-server/pom.xml index b044e94881..ec67b31996 100644 --- a/dolphinscheduler-alert/dolphinscheduler-alert-server/pom.xml +++ b/dolphinscheduler-alert/dolphinscheduler-alert-server/pom.xml @@ -96,18 +96,6 @@ org.springframework.cloud spring-cloud-starter-kubernetes-fabric8-config - - - org.mockito - mockito-core - test - - - - org.mockito - mockito-inline - test - diff --git a/dolphinscheduler-api/pom.xml b/dolphinscheduler-api/pom.xml index 66df53785b..7e03f01b6e 100644 --- a/dolphinscheduler-api/pom.xml +++ b/dolphinscheduler-api/pom.xml @@ -156,12 +156,6 @@ test - - org.mockito - mockito-core - test - - org.apache.curator curator-test @@ -201,14 +195,6 @@ test - - org.mockito - mockito-inline - 3.12.4 - - test - - diff --git a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/LoggerServiceTest.java b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/LoggerServiceTest.java index 5430fd2ec5..2bb9b6edeb 100644 --- a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/LoggerServiceTest.java +++ b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/LoggerServiceTest.java @@ -128,8 +128,6 @@ public class LoggerServiceTest { // success taskInstance.setHost("127.0.0.1:8080"); taskInstance.setLogPath("/temp/log"); - // if use @RunWith(PowerMockRunner.class) mock object,sonarcloud will not calculate the coverage, - // so no assert will be added here Mockito.when(logClient.getLogBytes(Mockito.anyString(), Mockito.anyInt(), Mockito.anyString())) .thenReturn(new byte[0]); loggerService.getLogBytes(1); diff --git a/dolphinscheduler-bom/pom.xml b/dolphinscheduler-bom/pom.xml index 3267ad3578..aacfc896f1 100644 --- a/dolphinscheduler-bom/pom.xml +++ b/dolphinscheduler-bom/pom.xml @@ -666,14 +666,6 @@ import - - org.mockito - mockito-core - 3.12.4 - - test - - org.lz4 lz4-java diff --git a/dolphinscheduler-common/pom.xml b/dolphinscheduler-common/pom.xml index 4bd4034ead..1f13e92552 100644 --- a/dolphinscheduler-common/pom.xml +++ b/dolphinscheduler-common/pom.xml @@ -55,18 +55,6 @@ com.google.guava guava - - org.mockito - mockito-core - test - - - org.mockito - mockito-inline - 3.12.4 - - test - org.springframework diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/pom.xml b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/pom.xml index e51857888a..8a69dd557f 100644 --- a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/pom.xml +++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/pom.xml @@ -137,12 +137,6 @@ - - org.mockito - mockito-core - jar - test - com.zaxxer diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-clickhouse/pom.xml b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-clickhouse/pom.xml index 20898fcb2f..6f57908868 100644 --- a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-clickhouse/pom.xml +++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-clickhouse/pom.xml @@ -15,22 +15,20 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 - dolphinscheduler-datasource-plugin org.apache.dolphinscheduler + dolphinscheduler-datasource-plugin dev-SNAPSHOT - 4.0.0 dolphinscheduler-datasource-clickhouse - ${project.artifactId} jar + ${project.artifactId} - org.apache.dolphinscheduler dolphinscheduler-spi @@ -47,8 +45,8 @@ clickhouse-jdbc - jaxb-api javax.xml.bind + jaxb-api com.fasterxml.jackson.core @@ -69,12 +67,5 @@ org.lz4 lz4-java - - - org.mockito - mockito-core - jar - test - diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-db2/pom.xml b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-db2/pom.xml index 872e502f26..c596351918 100644 --- a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-db2/pom.xml +++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-db2/pom.xml @@ -15,22 +15,20 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 - dolphinscheduler-datasource-plugin org.apache.dolphinscheduler + dolphinscheduler-datasource-plugin dev-SNAPSHOT - 4.0.0 dolphinscheduler-datasource-db2 - ${project.artifactId} jar + ${project.artifactId} - org.apache.dolphinscheduler dolphinscheduler-spi @@ -42,14 +40,5 @@ dolphinscheduler-datasource-api ${project.version} - - - - - org.mockito - mockito-core - jar - test - diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-hive/pom.xml b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-hive/pom.xml index 9ca1289992..bcc11a6618 100644 --- a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-hive/pom.xml +++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-hive/pom.xml @@ -322,12 +322,5 @@ - - - org.mockito - mockito-core - jar - test - diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-mysql/pom.xml b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-mysql/pom.xml index 07604e3d38..8c996cb2df 100644 --- a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-mysql/pom.xml +++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-mysql/pom.xml @@ -15,22 +15,20 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 - dolphinscheduler-datasource-plugin org.apache.dolphinscheduler + dolphinscheduler-datasource-plugin dev-SNAPSHOT - 4.0.0 dolphinscheduler-datasource-mysql - ${project.artifactId} jar + ${project.artifactId} - org.apache.dolphinscheduler dolphinscheduler-spi @@ -47,13 +45,5 @@ mysql mysql-connector-java - - - - org.mockito - mockito-core - jar - test - diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-oracle/pom.xml b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-oracle/pom.xml index 7ffa17f73d..ac8ac1ae6a 100644 --- a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-oracle/pom.xml +++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-oracle/pom.xml @@ -15,22 +15,20 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 - dolphinscheduler-datasource-plugin org.apache.dolphinscheduler + dolphinscheduler-datasource-plugin dev-SNAPSHOT - 4.0.0 dolphinscheduler-datasource-oracle - ${project.artifactId} jar + ${project.artifactId} - org.apache.dolphinscheduler dolphinscheduler-spi @@ -47,12 +45,5 @@ com.oracle.database.jdbc ojdbc8 - - - org.mockito - mockito-core - jar - test - diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-postgresql/pom.xml b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-postgresql/pom.xml index e2c20d7c93..d7e379c81a 100644 --- a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-postgresql/pom.xml +++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-postgresql/pom.xml @@ -15,22 +15,20 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 - dolphinscheduler-datasource-plugin org.apache.dolphinscheduler + dolphinscheduler-datasource-plugin dev-SNAPSHOT - 4.0.0 dolphinscheduler-datasource-postgresql - ${project.artifactId} jar + ${project.artifactId} - org.apache.dolphinscheduler dolphinscheduler-spi @@ -47,13 +45,5 @@ org.postgresql postgresql - - - - - org.mockito - mockito-core - test - diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-presto/pom.xml b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-presto/pom.xml index 9abe5161b2..a0942ea86b 100644 --- a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-presto/pom.xml +++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-presto/pom.xml @@ -15,22 +15,20 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 - dolphinscheduler-datasource-plugin org.apache.dolphinscheduler + dolphinscheduler-datasource-plugin dev-SNAPSHOT - 4.0.0 dolphinscheduler-datasource-presto - ${project.artifactId} jar + ${project.artifactId} - org.apache.dolphinscheduler dolphinscheduler-spi @@ -45,12 +43,5 @@ com.facebook.presto presto-jdbc - - - org.mockito - mockito-core - jar - test - diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-spark/pom.xml b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-spark/pom.xml index c0f348c4f4..7ff09b0edb 100644 --- a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-spark/pom.xml +++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-spark/pom.xml @@ -15,22 +15,20 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 - dolphinscheduler-datasource-plugin org.apache.dolphinscheduler + dolphinscheduler-datasource-plugin dev-SNAPSHOT - 4.0.0 dolphinscheduler-datasource-spark - ${project.artifactId} jar + ${project.artifactId} - org.apache.dolphinscheduler dolphinscheduler-spi @@ -53,12 +51,5 @@ dolphinscheduler-datasource-api ${project.version} - - - org.mockito - mockito-core - jar - test - diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-sqlserver/pom.xml b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-sqlserver/pom.xml index 9031f7d116..6e0d48cbf8 100644 --- a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-sqlserver/pom.xml +++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-sqlserver/pom.xml @@ -15,20 +15,18 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - - + 4.0.0 - dolphinscheduler-datasource-plugin org.apache.dolphinscheduler + dolphinscheduler-datasource-plugin dev-SNAPSHOT - 4.0.0 dolphinscheduler-datasource-sqlserver - ${project.artifactId} jar + ${project.artifactId} @@ -47,18 +45,10 @@ mssql-jdbc - azure-keyvault com.microsoft.azure + azure-keyvault - - - - - org.mockito - mockito-core - test - diff --git a/dolphinscheduler-datasource-plugin/pom.xml b/dolphinscheduler-datasource-plugin/pom.xml index 959b6d447f..81877cf2d0 100644 --- a/dolphinscheduler-datasource-plugin/pom.xml +++ b/dolphinscheduler-datasource-plugin/pom.xml @@ -65,13 +65,5 @@ org.apache.dolphinscheduler dolphinscheduler-common - - - org.mockito - mockito-inline - 3.12.4 - - test - diff --git a/dolphinscheduler-master/pom.xml b/dolphinscheduler-master/pom.xml index 66291e6a78..ff77fa085d 100644 --- a/dolphinscheduler-master/pom.xml +++ b/dolphinscheduler-master/pom.xml @@ -247,11 +247,6 @@ - - org.mockito - mockito-core - test - org.springframework.boot spring-boot-starter-test @@ -268,15 +263,6 @@ org.springframework.cloud spring-cloud-starter-kubernetes-fabric8-config - - - org.mockito - mockito-inline - 3.12.4 - - test - - diff --git a/dolphinscheduler-service/pom.xml b/dolphinscheduler-service/pom.xml index 0b6e66507f..21f0e8b793 100644 --- a/dolphinscheduler-service/pom.xml +++ b/dolphinscheduler-service/pom.xml @@ -63,20 +63,6 @@ dolphinscheduler-task-api - - org.mockito - mockito-core - test - - - - org.mockito - mockito-inline - 3.12.4 - - test - - com.cronutils cron-utils diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-pigeon/pom.xml b/dolphinscheduler-task-plugin/dolphinscheduler-task-pigeon/pom.xml index c58710e0d0..e4f036ae7d 100644 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-pigeon/pom.xml +++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-pigeon/pom.xml @@ -15,17 +15,16 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + + 4.0.0 - dolphinscheduler-task-plugin org.apache.dolphinscheduler + dolphinscheduler-task-plugin dev-SNAPSHOT - 4.0.0 - dolphinscheduler-task-pigeon jar @@ -82,10 +81,5 @@ org.apache.httpcomponents httpcore - - org.mockito - mockito-core - test - diff --git a/dolphinscheduler-task-plugin/pom.xml b/dolphinscheduler-task-plugin/pom.xml index 0f92c2e4b3..14fe703d7e 100644 --- a/dolphinscheduler-task-plugin/pom.xml +++ b/dolphinscheduler-task-plugin/pom.xml @@ -78,13 +78,4 @@ - - - org.mockito - mockito-inline - 3.12.4 - - test - - diff --git a/dolphinscheduler-worker/pom.xml b/dolphinscheduler-worker/pom.xml index 74590602ff..50a07e07ac 100644 --- a/dolphinscheduler-worker/pom.xml +++ b/dolphinscheduler-worker/pom.xml @@ -90,11 +90,6 @@ com.amazonaws aws-java-sdk-s3 - - org.mockito - mockito-core - test - org.springframework.boot spring-boot-starter-test diff --git a/pom.xml b/pom.xml index 6b956b8b54..f56ef035c2 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ 2.6.1 1.8 5.9.0 - 3.9.0 + 3.12.4 3.1.12 3.3 3.3.0 @@ -331,6 +331,12 @@ ${mockito.version} test + + org.mockito + mockito-inline + ${mockito.version} + test + org.mockito mockito-junit-jupiter @@ -648,6 +654,11 @@ import\s+[^\*\s]+\*;(\r\n|\r|\n) $1 + + Block powermock + import\s+org\.powermock\.[^\*\s]*(|\*);(\r\n|\r|\n) + $1 +