From 56a9ba0c01dd1c980b44874cea947a51d37d08c2 Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Mon, 9 Jan 2023 08:19:11 +0100 Subject: [PATCH] Fix spotless config to include all java files --- .../mvndaemon/mvnd/client/DefaultClient.java | 30 ++++++++++--------- .../mvndaemon/mvnd/client/DefaultClient.java | 5 ++-- .../mvndaemon/mvnd/common/ProcessHelper.java | 26 ++++++++-------- .../mvndaemon/mvnd/common/SocketHelper.java | 25 +++++++++------- .../mvnd/logging/internal/SimpleAppender.java | 4 +-- pom.xml | 16 ++++++++++ 6 files changed, 65 insertions(+), 41 deletions(-) diff --git a/client/src/main/java-fallback/org/mvndaemon/mvnd/client/DefaultClient.java b/client/src/main/java-fallback/org/mvndaemon/mvnd/client/DefaultClient.java index 4f483bc06..ddc55b562 100644 --- a/client/src/main/java-fallback/org/mvndaemon/mvnd/client/DefaultClient.java +++ b/client/src/main/java-fallback/org/mvndaemon/mvnd/client/DefaultClient.java @@ -1,17 +1,20 @@ /* - * Copyright 2019 the original author or authors. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package org.mvndaemon.mvnd.client; @@ -19,7 +22,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; - public class DefaultClient { public static void main(String[] argv) throws Exception { final String logbackConfFallback = System.getProperty("logback.configurationFile.fallback"); @@ -29,8 +31,8 @@ public static void main(String[] argv) throws Exception { } final Logger LOGGER = LoggerFactory.getLogger(DefaultClient.class); - LOGGER.warn("Found old JDK, fallback to the embedded maven!"); - LOGGER.warn("Use JDK 11+ to run maven-mvnd client!"); + LOGGER.warn("Found old JDK, fallback to the embedded maven!"); + LOGGER.warn("Use JDK 11+ to run maven-mvnd client!"); MavenCli.main(argv); } diff --git a/client/src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java b/client/src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java index 2792652e7..2089b5a0c 100644 --- a/client/src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java +++ b/client/src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java @@ -18,8 +18,6 @@ */ package org.mvndaemon.mvnd.client; -import static org.mvndaemon.mvnd.client.DaemonParameters.LOG_EXTENSION; - import java.io.IOException; import java.io.PrintWriter; import java.nio.file.Files; @@ -42,6 +40,7 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; import java.util.stream.Stream; + import org.fusesource.jansi.Ansi; import org.fusesource.jansi.internal.CLibrary; import org.jline.utils.AttributedString; @@ -61,6 +60,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import static org.mvndaemon.mvnd.client.DaemonParameters.LOG_EXTENSION; + public class DefaultClient implements Client { private static final Logger LOGGER = LoggerFactory.getLogger(DefaultClient.class); diff --git a/common/src/main/java11/org/mvndaemon/mvnd/common/ProcessHelper.java b/common/src/main/java11/org/mvndaemon/mvnd/common/ProcessHelper.java index 46a53bf83..875bbda48 100644 --- a/common/src/main/java11/org/mvndaemon/mvnd/common/ProcessHelper.java +++ b/common/src/main/java11/org/mvndaemon/mvnd/common/ProcessHelper.java @@ -1,17 +1,20 @@ /* - * Copyright 2021 the original author or authors. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package org.mvndaemon.mvnd.common; @@ -20,5 +23,4 @@ public class ProcessHelper { public static void killChildrenProcesses() { ProcessHandle.current().descendants().forEach(ProcessHandle::destroy); } - } diff --git a/common/src/main/java16/org/mvndaemon/mvnd/common/SocketHelper.java b/common/src/main/java16/org/mvndaemon/mvnd/common/SocketHelper.java index f0ce0f6c0..e5671f900 100644 --- a/common/src/main/java16/org/mvndaemon/mvnd/common/SocketHelper.java +++ b/common/src/main/java16/org/mvndaemon/mvnd/common/SocketHelper.java @@ -1,17 +1,20 @@ /* - * Copyright 2021 the original author or authors. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package org.mvndaemon.mvnd.common; diff --git a/daemon/src/main/java-fallback/org/mvndaemon/mvnd/logging/internal/SimpleAppender.java b/daemon/src/main/java-fallback/org/mvndaemon/mvnd/logging/internal/SimpleAppender.java index 1a8482754..24b4f6861 100644 --- a/daemon/src/main/java-fallback/org/mvndaemon/mvnd/logging/internal/SimpleAppender.java +++ b/daemon/src/main/java-fallback/org/mvndaemon/mvnd/logging/internal/SimpleAppender.java @@ -18,8 +18,6 @@ */ package org.mvndaemon.mvnd.logging.internal; -import static org.apache.maven.shared.utils.logging.MessageUtils.level; - import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.classic.spi.IThrowableProxy; @@ -27,6 +25,8 @@ import ch.qos.logback.core.AppenderBase; import ch.qos.logback.core.CoreConstants; +import static org.apache.maven.shared.utils.logging.MessageUtils.level; + /** * This appender acts like the slf4j simple logger. * It's used diff --git a/pom.xml b/pom.xml index 1aee1e598..f24912b3f 100644 --- a/pom.xml +++ b/pom.xml @@ -322,6 +322,22 @@ + + com.diffplug.spotless + spotless-maven-plugin + + + + src/main/java/**/*.java + src/main/java-fallback/**/*.java + src/main/java-mvnd/**/*.java + src/main/java11/**/*.java + src/main/java16/**/*.java + src/test/java/**/*.java + + + + org.apache.rat apache-rat-plugin