Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update citrus-remote to Citrus version 4 #6

Merged
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b0437a8
Switch spark-core to updated fork
maletic Jul 2, 2024
726be08
Fix imports caused by dependency change
maletic Jul 2, 2024
e7aa5a0
Increase citrus version
maletic Jul 2, 2024
a65285f
Attempt to fix code problems caused by new citrus version
maletic Jul 2, 2024
dccab41
Remove archiver as provided
maletic Jul 4, 2024
9daf6bf
Use shade plugin to shade jetty and jakarta servlet API
maletic Jul 12, 2024
f81a2bd
Upgrade apache http client to version 5
maletic Jul 12, 2024
11bd025
Update other dependencies to same version as citrus bom
maletic Jul 15, 2024
8c65b33
Change packages from com.consol.citrus to org.citrusframework
maletic Jul 15, 2024
fc5b88f
ci: add maven wrapper
bbortt Jul 15, 2024
3828749
chore: code refactoring using sonar
bbortt Jul 15, 2024
60dcf60
Merge pull request #1 from bbortt/chore/cleanup
maletic Jul 24, 2024
0c1d026
Rename assemblyConfiguration to assembly for backwards compatibility
maletic Jul 24, 2024
0372289
ci: add sample project
bbortt Aug 18, 2024
6514180
Fix plugin not being able to read response content
maletic Aug 20, 2024
a999e19
Incorporate requested changes regarding version upgrades without samp…
maletic Aug 20, 2024
95a953b
Increase plugin versions
maletic Aug 21, 2024
a9d9f7a
Merge branch 'update-citrus-remote-to-newest' into fix/add-sample-to-…
maletic Aug 21, 2024
fc31eb2
Merge pull request #2 from bbortt/fix/add-sample-to-build
maletic Aug 21, 2024
bf57096
Revert "add sample project"
maletic Aug 21, 2024
b6472cd
Merge pull request #3 from maletic/revert-2-fix/add-sample-to-build
maletic Aug 21, 2024
1d45907
Increase version
maletic Aug 21, 2024
154ee61
Changed version to 4.4.0-SNAPSHOT
maletic Sep 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip
12 changes: 6 additions & 6 deletions citrus-remote-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

<parent>
<artifactId>citrus-remote</artifactId>
<groupId>com.consol.citrus</groupId>
<version>3.5.0-SNAPSHOT</version>
<groupId>org.citrusframework</groupId>
<version>4.3.0-SNAPSHOT</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should set this to 4.3.1.-SNAPSHOT

Copy link
Contributor

@bbortt bbortt Aug 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because you want to sync it with citrus? I think that's a bad idea. what if there's a bugfix in citrus-remote, but not in citrus? versions get out of sync so easily. I think it should just be 4.0.0 (and -SNAPSHOT).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christophd I think you'd agree here (before merging)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should try to keep in sync and yes it may be tedious. I would try to only differ in minor releases when there is a bugfix. As a long-term objective we should bring citrus-remote back to citrus core project

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, if that's the goal :)

<relativePath>../pom.xml</relativePath>
</parent>

Expand All @@ -16,21 +16,21 @@

<dependencies>
<dependency>
<groupId>com.consol.citrus</groupId>
<groupId>org.citrusframework</groupId>
<artifactId>citrus-remote-server</artifactId>
<version>${project.version}</version>
</dependency>

<!-- Citrus -->
<dependency>
<groupId>com.consol.citrus</groupId>
<groupId>org.citrusframework</groupId>
<artifactId>citrus-base</artifactId>
</dependency>

<!-- Http client -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
* limitations under the License.
*/

package com.consol.citrus.remote.plugin;
package org.citrusframework.remote.plugin;

import com.consol.citrus.remote.plugin.assembly.CitrusRemoteAssemblerConfigurationSource;
import com.consol.citrus.remote.plugin.config.*;
import org.apache.maven.archiver.MavenArchiveConfiguration;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
Expand All @@ -34,6 +32,10 @@
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectHelper;
import org.apache.maven.shared.filtering.MavenReaderFilter;
import org.citrusframework.remote.plugin.assembly.CitrusRemoteAssemblerConfigurationSource;
import org.citrusframework.remote.plugin.config.AssemblyConfiguration;
import org.citrusframework.remote.plugin.config.AssemblyDescriptorConfiguration;
import org.citrusframework.remote.plugin.config.TestJarConfiguration;

import java.io.File;
import java.util.List;
Expand Down Expand Up @@ -72,7 +74,7 @@ public abstract class AbstractCitrusRemoteAssemblyMojo extends AbstractCitrusRem
@Parameter(defaultValue = "${project.build.testOutputDirectory}", required = true, readonly = true)
private File testClassesDirectory;

@Parameter( property = "citrus.remote.mainClass", required = true, defaultValue = "com.consol.citrus.remote.CitrusRemoteServer")
@Parameter( property = "citrus.remote.mainClass", required = true, defaultValue = "org.citrusframework.remote.CitrusRemoteServer")
private String mainClass;

/**
Expand All @@ -96,10 +98,8 @@ public void doExecute() throws MojoExecutionException, MojoFailureException {

protected void createDirs(AssemblyConfiguration assemblyConfig) {
for (File dir : new File[] { assemblyConfig.getTemporaryRootDirectory(), assemblyConfig.getOutputDirectory(), assemblyConfig.getWorkingDirectory() }) {
if (!dir.exists()) {
if(!dir.mkdirs()) {
throw new IllegalArgumentException("Cannot create directory " + dir.getAbsolutePath());
}
if (!dir.exists() && !dir.mkdirs()) {
throw new IllegalArgumentException("Cannot create directory " + dir.getAbsolutePath());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,22 @@
* limitations under the License.
*/

package com.consol.citrus.remote.plugin;

import com.consol.citrus.remote.plugin.config.ReportConfiguration;
import com.consol.citrus.remote.plugin.config.ServerConfiguration;
import org.apache.http.client.HttpClient;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.impl.client.HttpClients;
package org.citrusframework.remote.plugin;

import org.apache.hc.client5.http.config.ConnectionConfig;
import org.apache.hc.client5.http.config.RequestConfig;
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
import org.apache.hc.client5.http.impl.classic.HttpClients;
import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager;
import org.apache.hc.core5.util.Timeout;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.*;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.citrusframework.remote.plugin.config.ReportConfiguration;
import org.citrusframework.remote.plugin.config.ServerConfiguration;

import java.io.File;

Expand Down Expand Up @@ -68,26 +73,36 @@ public abstract class AbstractCitrusRemoteMojo extends AbstractMojo {
private ReportConfiguration report;

/** Http client */
private final HttpClient httpClient;
private final CloseableHttpClient httpClient;

/**
* Constructor using default client.
*/
public AbstractCitrusRemoteMojo() {
protected AbstractCitrusRemoteMojo() {
Timeout timoutMillis = Timeout.ofMilliseconds(timeout);

ConnectionConfig connectionConfig = ConnectionConfig.custom()
.setConnectTimeout(timoutMillis)
.build();

PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager();
connectionManager.setDefaultConnectionConfig(connectionConfig);

httpClient = HttpClients.custom()
.setDefaultRequestConfig(RequestConfig.copy(RequestConfig.DEFAULT)
.setConnectionRequestTimeout(timeout)
.setConnectTimeout(timeout)
.setSocketTimeout(timeout)
.build())
.setConnectionManager(connectionManager)
.setDefaultRequestConfig(
RequestConfig.custom()
.setConnectionRequestTimeout(timoutMillis)
.setResponseTimeout(timoutMillis)
.build())
.build();
}

/**
* Constructor using given client.
* @param httpClient
*/
public AbstractCitrusRemoteMojo(HttpClient httpClient) {
protected AbstractCitrusRemoteMojo(CloseableHttpClient httpClient) {
this.httpClient = httpClient;
}

Expand Down Expand Up @@ -164,7 +179,7 @@ public File getOutputDirectory() {
*
* @return
*/
public HttpClient getHttpClient() {
public CloseableHttpClient getHttpClient() {
return httpClient;
}
}
Loading