Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop' into 'main'
Browse files Browse the repository at this point in the history
Update dependencies and site

See merge request bot-by/ijhttp-maven-plugin!17
  • Loading branch information
vitalijr2 committed Jan 18, 2024
2 parents e7ef220 + 92f4321 commit 522184b
Show file tree
Hide file tree
Showing 23 changed files with 69 additions and 103 deletions.
1 change: 0 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ test:
reports:
junit:
- command-line/target/surefire-reports/TEST-*.xml
- command-line/target/failsafe-reports/TEST-*.xml
- maven-plugin/target/surefire-reports/TEST-*.xml
- maven-plugin/target/failsafe-reports/TEST-*.xml
- spring-boot-test/target/surefire-reports/TEST-*.xml
Expand Down
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2023 bot-by
Copyright 2023-2024 bot-by

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 1.2.1 - 2024-01-18
### Fixed
- Deprecated methods in `commons-exec`.
### Updated
- Update dependencies

## 1.2.0 - 2023-12-30
### Added
- Directories
Expand Down
2 changes: 1 addition & 1 deletion command-line/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2023 Vitalij Berdinskih
Copyright 2023-2024 bot-by
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Vitalij Berdinskih
* Copyright 2023-2024 bot-by
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -48,6 +48,7 @@
* value. The component implements it by two methods: {@link #report(boolean)} and
* {@link #reportPath(Path)}.
*
* @author Vitalij Berdinskih
* @since 1.1.0
*/
public class HttpClientCommandLine {
Expand Down Expand Up @@ -316,8 +317,7 @@ private void logLevel(CommandLine commandLine) {

private void privateEnvironment(CommandLine commandLine) throws IOException {
if (nonNull(privateEnvironmentFile)) {
commandLine.addArgument(PRIVATE_ENV_FILE)
.addArgument(privateEnvironmentFile.toString());
commandLine.addArgument(PRIVATE_ENV_FILE).addArgument(privateEnvironmentFile.toString());
}
if (nonNull(privateEnvironmentVariables)) {
privateEnvironmentVariables.forEach(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Vitalij Berdinskih
* Copyright 2023-2024 bot-by
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,6 +18,7 @@
/**
* Logging levels.
*
* @author Vitalij Berdinskih
* @since 1.1.0
*/
public enum LogLevel {
Expand Down
4 changes: 2 additions & 2 deletions maven-plugin/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2023 Vitalij Berdinskih
Copyright 2023-2024 bot-by
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -184,7 +184,7 @@
</profile>
</profiles>
<properties>
<plugin-annotations.version>3.10.2</plugin-annotations.version>
<plugin-annotations.version>3.11.0</plugin-annotations.version>
<plugin-api.version>3.9.4</plugin-api.version>
</properties>
<version>${revision}${changelist}${sha1}</version>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Vitalij Berdinskih
* Copyright 2023-2024 bot-by
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,6 +24,7 @@
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.time.Duration;
import java.util.List;
import org.apache.commons.exec.CommandLine;
import org.apache.commons.exec.DefaultExecutor;
Expand Down Expand Up @@ -156,7 +157,6 @@ public void execute() throws MojoExecutionException, MojoFailureException {
* Number of milliseconds for connection. Defaults to <em>3000</em>.
*/
@Parameter(property = "ijhttp.connect-timeout")

public void setConnectTimeout(Integer connectTimeout) {
this.connectTimeout = connectTimeout;
}
Expand Down Expand Up @@ -463,17 +463,20 @@ private void timeouts(HttpClientCommandLine httpClientCommandLine) {

@VisibleForTesting
Executor getExecutor() throws IOException, MojoExecutionException {
var executor = new DefaultExecutor();
var builder = DefaultExecutor.builder();

handleWorkingDirectory(builder);

var executor = builder.get();

handleWatchdog(executor);
handleWorkingDirectory(executor);

return executor;
}

private void handleWatchdog(DefaultExecutor executor) {
if (nonNull(timeout)) {
var watchdog = new ExecuteWatchdog(timeout);
var watchdog = ExecuteWatchdog.builder().setTimeout(Duration.ofMillis(timeout)).get();

executor.setWatchdog(watchdog);
if (getLog().isDebugEnabled()) {
Expand All @@ -482,7 +485,8 @@ private void handleWatchdog(DefaultExecutor executor) {
}
}

private void handleWorkingDirectory(DefaultExecutor executor)
@SuppressWarnings("rawtypes")
private void handleWorkingDirectory(DefaultExecutor.Builder builder)
throws IOException, MojoExecutionException {
if (nonNull(workingDirectory)) {
if (!workingDirectory.exists()) {
Expand All @@ -491,10 +495,10 @@ private void handleWorkingDirectory(DefaultExecutor executor)
throw new MojoExecutionException(
"the working directory is a file: " + workingDirectory.getPath());
}
executor.setWorkingDirectory(workingDirectory);
}
if (getLog().isDebugEnabled()) {
getLog().debug("Working directory: " + executor.getWorkingDirectory());
builder.setWorkingDirectory(workingDirectory);
if (getLog().isDebugEnabled()) {
getLog().debug("Working directory: " + workingDirectory);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ void stderr(int exitCode) throws IOException, MojoExecutionException {
when(file.toPath()).thenReturn(path);
when(path.toString()).thenReturn(Integer.toString(exitCode));
when(mojo.getExecutor()).thenAnswer(invocationOnMock -> {
var executor = new DefaultExecutor();
var executor = DefaultExecutor.builder().get();

executor.setExitValue(exitCode);

Expand Down
16 changes: 8 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2023 Vitalij Berdinskih
Copyright 2023-2024 bot-by
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -52,7 +52,7 @@
</properties>
</configuration>
<groupId>org.apache.maven.plugins</groupId>
<version>3.2.3</version>
<version>3.2.5</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
Expand Down Expand Up @@ -87,7 +87,7 @@
</execution>
</executions>
<groupId>org.apache.maven.plugins</groupId>
<version>3.2.3</version>
<version>3.2.5</version>
</plugin>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
Expand Down Expand Up @@ -257,7 +257,7 @@
</execution>
</executions>
<groupId>org.codehaus.mojo</groupId>
<version>1.5.0</version>
<version>1.6.0</version>
</plugin>
</plugins>
</build>
Expand Down Expand Up @@ -317,7 +317,7 @@
</dependency>
</dependencies>
</dependencyManagement>
<description>Run HTTP requests of integration tests</description>
<description>Maven plugin and Spring Boot Test autoconfiguration for IntelliJ HTTP Client</description>
<developers>
<developer>
<email>vitalij_r2@outlook.com</email>
Expand Down Expand Up @@ -518,7 +518,7 @@
</profiles>
<properties>
<changelist>-SNAPSHOT</changelist>
<commons-exec.version>1.3</commons-exec.version>
<commons-exec.version>1.4.0</commons-exec.version>
<docs-maven-skin.version>2.3.2</docs-maven-skin.version>
<github.release.url>https://github.com/bot-by/ijhttp-maven-plugin/releases</github.release.url>
<gitlab.release.url>https://gitlab.com/bot-by/ijhttp-maven-plugin/-/releases
Expand All @@ -528,10 +528,10 @@
<jetbrains-annotations.version>24.1.0</jetbrains-annotations.version>
<junit-jupiter.version>5.10.1</junit-jupiter.version>
<maven-minimal.version>3.8.5</maven-minimal.version>
<mockito.version>5.8.0</mockito.version>
<mockito.version>5.9.0</mockito.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<revision>1.2.0</revision>
<revision>1.2.1</revision>
<sha1/>
</properties>
<scm>
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ See [Changelog](changelog.md)

## License

Copyright 2023 Vitalij Berdinskih
Copyright 2023-2024 bot-by

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions spring-boot-test/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2023 Vitalij Berdinskih
Copyright 2023-2024 bot-by
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -99,7 +99,7 @@
<dependency>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
<version>2.0.9</version>
<version>2.0.11</version>
</dependency>
<!-- test -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Vitalij Berdinskih
* Copyright 2023-2024 bot-by
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,6 +27,7 @@
/**
* HTTP Client Command Line autoconfiguration.
*
* @author Vitalij Berdinskih
* @since 1.1.0
*/
@Target(ElementType.TYPE)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Vitalij Berdinskih
* Copyright 2023-2024 bot-by
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,6 +18,7 @@
import static java.util.Objects.nonNull;

import java.nio.file.Path;
import java.time.Duration;
import org.apache.commons.exec.DefaultExecutor;
import org.apache.commons.exec.ExecuteWatchdog;
import org.apache.commons.exec.Executor;
Expand All @@ -35,6 +36,7 @@
* HTTP Client configuration provides {@linkplain org.apache.commons.exec.Executor executor} and
* {@linkplain uk.bot_by.ijhttp_tools.command_line.HttpClientCommandLine command line} beans.
*
* @author Vitalij Berdinskih
* @since 1.1.0
*/
@ConditionalOnWebApplication(type = Type.SERVLET)
Expand Down Expand Up @@ -113,10 +115,10 @@ private static void handleTimeout(HttpClientCommandLineParameters parameters,
@Bean
@ConditionalOnMissingBean
Executor executor(@Value("${ijhttp.timeout:-1}") int timeout) {
var executor = new DefaultExecutor();
var executor = DefaultExecutor.builder().get();

if (timeout > 0) {
executor.setWatchdog(new ExecuteWatchdog(timeout));
executor.setWatchdog(ExecuteWatchdog.builder().setTimeout(Duration.ofMillis(timeout)).get());
if (logger.isDebugEnabled()) {
logger.debug(String.format("Set the watchdog (%s) ms", timeout));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Vitalij Berdinskih
* Copyright 2023-2024 bot-by
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,6 +24,7 @@
/**
* HTTP Client parameters.
*
* @author Vitalij Berdinskih
* @see <a href="https://www.jetbrains.com/help/idea/http-client-cli.html">HTTP Client CLI</a>
* @since 1.1.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
* <dt>{@link uk.bot_by.ijhttp_tools.spring_boot_test.HttpClientCommandLineParameters}</dt>
* <dd>HTTP Client parameters from Spring Boot properties.</dd>
* </dl>
*
* @author Vitalij Berdinskih
* @since 1.1.0
*/
package uk.bot_by.ijhttp_tools.spring_boot_test;
2 changes: 1 addition & 1 deletion src/site/markdown/autoconfiguration.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Srping Boot Test autoconfiguration
# Usage of the Srping Boot Test autoconfiguration

**Important!** The autoconfiguration does not contain the HTTP client: you need to install it
by yourself then add to `PATH`. You can also set the full path to the ijhttp
Expand Down
31 changes: 0 additions & 31 deletions src/site/markdown/changelog.md

This file was deleted.

Loading

0 comments on commit 522184b

Please sign in to comment.