From 081a5b15e4e215605d29cac846c303743cf5048f Mon Sep 17 00:00:00 2001 From: Karl Heinz Marbaise Date: Sat, 28 Oct 2023 01:23:11 +0200 Subject: [PATCH] Fixed #379 - Deprecated debug option --- .../release-notes/_release-notes-0.13.0.adoc | 8 ++- .../com/soebes/itf/examples/LogoutputIT.java | 4 +- .../itf/examples/MavenIntegrationIT.java | 4 +- .../com/soebes/itf/examples/ProjectIT.java | 6 +-- .../soebes/itf/examples/ProjectSecondIT.java | 6 +-- .../jupiter/extension/MavenCLIOptions.java | 12 +++++ .../itf/jupiter/extension/MavenDebug.java | 2 + .../itf/jupiter/extension/MavenVerbose.java | 50 +++++++++++++++++++ 8 files changed, 81 insertions(+), 11 deletions(-) create mode 100644 itf-jupiter-extension/src/main/java/com/soebes/itf/jupiter/extension/MavenVerbose.java diff --git a/itf-documentation/src/main/asciidoc/release-notes/_release-notes-0.13.0.adoc b/itf-documentation/src/main/asciidoc/release-notes/_release-notes-0.13.0.adoc index e835f86d3f..19f6f49c71 100644 --- a/itf-documentation/src/main/asciidoc/release-notes/_release-notes-0.13.0.adoc +++ b/itf-documentation/src/main/asciidoc/release-notes/_release-notes-0.13.0.adoc @@ -40,6 +40,7 @@ :issue-374: https://github.com/khmarbaise/maven-it-extension/issues/374[Fixed #374] :issue-375: https://github.com/khmarbaise/maven-it-extension/issues/375[Fixed #375] :issue-376: https://github.com/khmarbaise/maven-it-extension/issues/376[Fixed #376] +:issue-379: https://github.com/khmarbaise/maven-it-extension/issues/379[Fixed #379] :issue-??: https://github.com/khmarbaise/maven-it-extension/issues/??[Fixed #??] :release_0_13_0: https://github.com/khmarbaise/maven-it-extension/milestone/13 @@ -55,9 +56,14 @@ * {issue-326} - Failing IT's based on Maven 3.8.7 * {issue-329} - Upgrade to smpp 5.3.14 + *Breaking Changes* - * {issue-277} - Remove Deprecated Code. + * {issue-277} - Remove Deprecated Code. Take a look into the release notes of Release 0.12. + * If you have used `@MavenDebug` annotation you have to replace that usage with `@MavenVerbose`. You will + get `deprecated warnings` during the compilation. + * {issue-379} - Deprecated `@MavenDebug`; Replace the usage with `@MavenVerbose`. + `@MavenDebug` will be removed with release 0.14.0. *Reporter of this release* diff --git a/itf-examples/src/test/java/com/soebes/itf/examples/LogoutputIT.java b/itf-examples/src/test/java/com/soebes/itf/examples/LogoutputIT.java index b6a3b834af..9fa208a6e0 100644 --- a/itf-examples/src/test/java/com/soebes/itf/examples/LogoutputIT.java +++ b/itf-examples/src/test/java/com/soebes/itf/examples/LogoutputIT.java @@ -19,9 +19,9 @@ * under the License. */ -import com.soebes.itf.jupiter.extension.MavenDebug; import com.soebes.itf.jupiter.extension.MavenJupiterExtension; import com.soebes.itf.jupiter.extension.MavenTest; +import com.soebes.itf.jupiter.extension.MavenVerbose; import com.soebes.itf.jupiter.maven.MavenExecutionResult; import com.soebes.itf.jupiter.maven.MavenLog; import org.junit.jupiter.api.condition.EnabledOnOs; @@ -38,7 +38,7 @@ * @author Karl Heinz Marbaise */ @MavenJupiterExtension -@MavenDebug +@MavenVerbose class LogoutputIT { @MavenTest diff --git a/itf-examples/src/test/java/com/soebes/itf/examples/MavenIntegrationIT.java b/itf-examples/src/test/java/com/soebes/itf/examples/MavenIntegrationIT.java index 31f4662af5..575d4f03c7 100644 --- a/itf-examples/src/test/java/com/soebes/itf/examples/MavenIntegrationIT.java +++ b/itf-examples/src/test/java/com/soebes/itf/examples/MavenIntegrationIT.java @@ -19,11 +19,11 @@ * under the License. */ -import com.soebes.itf.jupiter.extension.MavenDebug; import com.soebes.itf.jupiter.extension.MavenGoal; import com.soebes.itf.jupiter.extension.MavenJupiterExtension; import com.soebes.itf.jupiter.extension.MavenRepository; import com.soebes.itf.jupiter.extension.MavenTest; +import com.soebes.itf.jupiter.extension.MavenVerbose; import com.soebes.itf.jupiter.maven.MavenExecutionResult; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.MethodOrderer.OrderAnnotation; @@ -59,7 +59,7 @@ void setup_2(MavenExecutionResult result) { } @MavenTest - @MavenDebug + @MavenVerbose @MavenGoal({"clean", "verify"}) @DisplayName("and the test case tries to check for resultion issue.") void first_integration_test(MavenExecutionResult result) { diff --git a/itf-examples/src/test/java/com/soebes/itf/examples/ProjectIT.java b/itf-examples/src/test/java/com/soebes/itf/examples/ProjectIT.java index d05a88e0bf..29ed21134a 100644 --- a/itf-examples/src/test/java/com/soebes/itf/examples/ProjectIT.java +++ b/itf-examples/src/test/java/com/soebes/itf/examples/ProjectIT.java @@ -19,10 +19,10 @@ * under the License. */ -import com.soebes.itf.jupiter.extension.MavenDebug; import com.soebes.itf.jupiter.extension.MavenJupiterExtension; import com.soebes.itf.jupiter.extension.MavenPredefinedRepository; import com.soebes.itf.jupiter.extension.MavenTest; +import com.soebes.itf.jupiter.extension.MavenVerbose; import com.soebes.itf.jupiter.maven.MavenExecutionResult; import static com.soebes.itf.extension.assertj.MavenITAssertions.assertThat; @@ -35,13 +35,13 @@ class ProjectIT { @MavenTest - @MavenDebug + @MavenVerbose void project_001(MavenExecutionResult result) { assertThat(result).isSuccessful(); } @MavenTest - @MavenDebug + @MavenVerbose void project_002(MavenExecutionResult result) { assertThat(result).isSuccessful(); } diff --git a/itf-examples/src/test/java/com/soebes/itf/examples/ProjectSecondIT.java b/itf-examples/src/test/java/com/soebes/itf/examples/ProjectSecondIT.java index 09e62b9fd6..dc0c915f73 100644 --- a/itf-examples/src/test/java/com/soebes/itf/examples/ProjectSecondIT.java +++ b/itf-examples/src/test/java/com/soebes/itf/examples/ProjectSecondIT.java @@ -19,10 +19,10 @@ * under the License. */ -import com.soebes.itf.jupiter.extension.MavenDebug; import com.soebes.itf.jupiter.extension.MavenJupiterExtension; import com.soebes.itf.jupiter.extension.MavenPredefinedRepository; import com.soebes.itf.jupiter.extension.MavenTest; +import com.soebes.itf.jupiter.extension.MavenVerbose; import com.soebes.itf.jupiter.maven.MavenExecutionResult; import static com.soebes.itf.extension.assertj.MavenITAssertions.assertThat; @@ -33,14 +33,14 @@ @MavenJupiterExtension class ProjectSecondIT { - @MavenDebug + @MavenVerbose @MavenTest @MavenPredefinedRepository void project_001(MavenExecutionResult result) { assertThat(result).isSuccessful(); } - @MavenDebug + @MavenVerbose @MavenTest @MavenPredefinedRepository void project_002(MavenExecutionResult result) { diff --git a/itf-jupiter-extension/src/main/java/com/soebes/itf/jupiter/extension/MavenCLIOptions.java b/itf-jupiter-extension/src/main/java/com/soebes/itf/jupiter/extension/MavenCLIOptions.java index 78f55711fe..7feb1ff943 100644 --- a/itf-jupiter-extension/src/main/java/com/soebes/itf/jupiter/extension/MavenCLIOptions.java +++ b/itf-jupiter-extension/src/main/java/com/soebes/itf/jupiter/extension/MavenCLIOptions.java @@ -52,6 +52,7 @@ * @see MavenCLIOptions#ALSO_MAKE_DEPENDENCIES * @see MavenCLIOptions#ALSO_MAKE * @see MavenCLIOptions#DEBUG + * @see MavenCLIOptions#VERBOSE * @see MavenCLIOptions#NO_TRANSFER_PROGRESS * @see MavenCLIOptions#SHOW_VERSION * @see MavenCLIOptions#BATCH_MODE @@ -193,9 +194,20 @@ public final class MavenCLIOptions { /** * {@code --debug} + * + * @apiNote use {@link #VERBOSE} instead. + * @deprecated Will be removed with 0.14.0 */ + @Deprecated public static final String DEBUG = "--debug"; + /** + * {@code --verbose} + * + * @since 0.13.0 + */ + public static final String VERBOSE = "--verbose"; + /** * {@code --no-transfer-progress} */ diff --git a/itf-jupiter-extension/src/main/java/com/soebes/itf/jupiter/extension/MavenDebug.java b/itf-jupiter-extension/src/main/java/com/soebes/itf/jupiter/extension/MavenDebug.java index adb3ab1b6a..ec6e56814a 100644 --- a/itf-jupiter-extension/src/main/java/com/soebes/itf/jupiter/extension/MavenDebug.java +++ b/itf-jupiter-extension/src/main/java/com/soebes/itf/jupiter/extension/MavenDebug.java @@ -40,11 +40,13 @@ * @since 0.9.0 * @see MavenOption * @author Karl Heinz Marbaise + * @deprecated Will be removed with Release 0.14.0. Use {@link MavenVerbose} instead. */ @Target({ElementType.METHOD, ElementType.TYPE}) @Retention(RUNTIME) @Inherited @MavenOption(value = MavenCLIOptions.DEBUG) @API(status = EXPERIMENTAL, since = "0.9.0") +@Deprecated public @interface MavenDebug { } diff --git a/itf-jupiter-extension/src/main/java/com/soebes/itf/jupiter/extension/MavenVerbose.java b/itf-jupiter-extension/src/main/java/com/soebes/itf/jupiter/extension/MavenVerbose.java new file mode 100644 index 0000000000..f4c99e5e08 --- /dev/null +++ b/itf-jupiter-extension/src/main/java/com/soebes/itf/jupiter/extension/MavenVerbose.java @@ -0,0 +1,50 @@ +package com.soebes.itf.jupiter.extension; + +/* + * 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 + * + * 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. + */ + +import org.apiguardian.api.API; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static org.apiguardian.api.API.Status.EXPERIMENTAL; + +/** + * {@code @MavenVerbose} is a meta annotation for convenience purposes + * to make it easier to activate verbose option for a Maven build + * just by simply adding {@code @MavenVerbose}. + * + *

When applied at the class level, all test methods within that class + * are automatically inheriting the given goal.

+ * + * @since 0.13.0 + * @see MavenOption + * @author Karl Heinz Marbaise + */ +@Target({ElementType.METHOD, ElementType.TYPE}) +@Retention(RUNTIME) +@Inherited +@MavenOption(value = MavenCLIOptions.VERBOSE) +@API(status = EXPERIMENTAL, since = "0.13.0") +public @interface MavenVerbose { +}