Skip to content

Commit

Permalink
(#265) - Jakarta
Browse files Browse the repository at this point in the history
  • Loading branch information
andreoss committed Oct 29, 2023
1 parent 49a3f4b commit ab305f7
Show file tree
Hide file tree
Showing 32 changed files with 286 additions and 181 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/mvn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04, windows-2022, macos-12]
java: [11, 17]
java: [11, 17, 19, 21]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
Expand Down
196 changes: 129 additions & 67 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
</ciManagement>
<scm>
<connection>scm:git:github.com:jcabi/jcabi-http.git</connection>
<developerConnection>scm:git:github.com:jcabi/jcabi-http.git</developerConnection>
<developerConnection>scm:git:github.com:jcabi/jcabi-http.git
</developerConnection>
<url>https://github.com/jcabi/jcabi-http</url>
</scm>
<distributionManagement>
Expand All @@ -59,6 +60,11 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
<url>https://http.jcabi.com/</url>
</site>
</distributionManagement>
<properties>
<byte-buddy.version>
1.14.5
</byte-buddy.version>
</properties>
<dependencies>
<dependency>
<groupId>com.jcabi</groupId>
Expand All @@ -85,24 +91,6 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
<artifactId>lombok</artifactId>
<version>1.18.30</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>2.0.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand All @@ -116,13 +104,6 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
<version>1.1.4</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
Expand All @@ -132,29 +113,23 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
</dependency>
<dependency>
<!--
@todo #171:30m Transitive dependencies for hamcrest 1.3 and junit 4
comes from this dependency.
1) Upgrade jcabi-matchers to the same version of parent as jcabi-http.
2) Replace hamcrest 1.3 with hamcrest 2.2 (?) from parent
3) Replace junit 5 with junit 5
-->
@todo #171:30m Transitive dependencies for hamcrest 1.3 and junit 4
comes from this dependency.
1) Upgrade jcabi-matchers to the same version of parent as jcabi-http.
2) Replace hamcrest 1.3 with hamcrest 2.2 (?) from parent
3) Replace junit 5 with junit 5
-->
<groupId>com.jcabi</groupId>
<artifactId>jcabi-matchers</artifactId>
<version>1.6.0</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>2.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.3</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.jcabi</groupId>
Expand All @@ -170,31 +145,16 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
<optional>true</optional>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>javax.xml.bind</groupId>
<artifactId>jsr173_api</artifactId>
</exclusion>
</exclusions>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jsr173_api</artifactId>
<version>1.0</version>
<optional>true</optional>
<scope>provided</scope>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
<version>1.1.1</version>
<optional>true</optional>
<scope>provided</scope>
<groupId>jakarta.json</groupId>
<artifactId>jakarta.json-api</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.grizzly</groupId>
Expand Down Expand Up @@ -278,6 +238,12 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
<artifactId>testcontainers</artifactId>
<version>1.17.6</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
Expand All @@ -287,8 +253,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.1.4</version>
<artifactId>jakarta.json</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -297,9 +262,68 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
<version>1.2.25</version>
<scope>provided</scope>
</dependency>
<!-- logging dependencies-->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.4.8</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.4.8</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.9</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.parsson</groupId>
<artifactId>parsson</artifactId>
<version>1.1.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>${byte-buddy.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.objenesis</groupId>
<artifactId>objenesis</artifactId>
<version>2.6</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-bom</artifactId>
<version>10.0.0</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.wildfly.bom</groupId>
<artifactId>wildfly-jakartaee8-with-tools</artifactId>
<version>26.1.3.Final</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
Expand All @@ -321,10 +345,48 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
<version>${byte-buddy.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>
-javaagent:${project.basedir}/target/byte-buddy-agent-${byte-buddy.version}.jar
</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>process-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
<outputDirectory>
${project.build.directory}
</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/jcabi/http/RequestBody.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
package com.jcabi.http;

import com.jcabi.aspects.Immutable;
import jakarta.json.JsonStructure;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import javax.json.JsonStructure;

/**
* Request body.
Expand Down
23 changes: 14 additions & 9 deletions src/main/java/com/jcabi/http/request/BaseRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
import com.jcabi.http.Wire;
import com.jcabi.immutable.Array;
import com.jcabi.log.Logger;
import jakarta.json.Json;
import jakarta.json.JsonStructure;
import jakarta.ws.rs.core.HttpHeaders;
import jakarta.ws.rs.core.UriBuilder;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
Expand All @@ -55,10 +59,6 @@
import java.util.Collection;
import java.util.LinkedList;
import java.util.Map;
import javax.json.Json;
import javax.json.JsonStructure;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.UriBuilder;
import lombok.EqualsAndHashCode;

/**
Expand All @@ -81,7 +81,8 @@
// first one, since maybe qulice is counting the methods in the inner
// classes too - if it doesn't, then it can be left.
//@checkstyle LineLength (1 line)
@SuppressWarnings({"PMD.TooManyMethods", "PMD.GodClass", "PMD.ExcessiveImports"})
@SuppressWarnings({"PMD.TooManyMethods", "PMD.GodClass",
"PMD.ExcessiveImports"})
public final class BaseRequest implements Request {

/**
Expand Down Expand Up @@ -159,9 +160,11 @@ public BaseRequest(final Wire wre, final String uri) {
* @param method HTTP method
* @param body HTTP request body
*/
public BaseRequest(final Wire wre, final String uri,
public BaseRequest(
final Wire wre, final String uri,
final Iterable<Map.Entry<String, String>> headers,
final String method, final byte[] body) {
final String method, final byte[] body
) {
this(wre, uri, headers, method, body, 0, 0);
//@checkstyle ParameterNumber (15 lines)
}
Expand All @@ -176,10 +179,12 @@ public BaseRequest(final Wire wre, final String uri,
* @param cnct Connect timeout for http connection
* @param rdd Read timeout for http connection
*/
public BaseRequest(final Wire wre, final String uri,
public BaseRequest(
final Wire wre, final String uri,
final Iterable<Map.Entry<String, String>> headers,
final String method, final byte[] body,
final int cnct, final int rdd) {
final int cnct, final int rdd
) {
this.wire = wre;
this.home = BaseRequest.createUri(uri).toString();
this.hdrs = new Array<>(headers);
Expand Down
Loading

0 comments on commit ab305f7

Please sign in to comment.