%bcond_with bootstrap
Name: httpcomponents-core4
Summary: Set of low level Java HTTP transport components for HTTP services
Version: 4.4.16
Release: 1%{?dist}
License: Apache-2.0
URL: https://hc.apache.org/
Source0: https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcomponents-core/%{version}/httpcomponents-core-%{version}-source-release.zip
BuildArch: noarch
ExclusiveArch: %{java_arches} noarch
Patch1: 0001-Port-to-mockito-2.patch
Patch2: 0002-Port-to-Mockito-5.patch
%if %{with bootstrap}
BuildRequires: javapackages-bootstrap
%else
BuildRequires: maven-local
BuildRequires: mvn(commons-logging:commons-logging)
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.apache.httpcomponents:httpcomponents-parent:pom:)
BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin)
BuildRequires: mvn(org.mockito:mockito-core)
%endif
%description
HttpCore is a set of low level HTTP transport components that can be
used to build custom client and server side HTTP services with a
minimal footprint. HttpCore supports two I/O models: blocking I/O
model based on the classic Java I/O and non-blocking, event driven I/O
model based on Java NIO.
The blocking I/O model may be more appropriate for data intensive, low
latency scenarios, whereas the non-blocking model may be more
appropriate for high latency scenarios where raw data throughput is
less important than the ability to handle thousands of simultaneous
HTTP connections in a resource efficient manner.
%{?javadoc_package}
%prep
%setup -q -n httpcomponents-core-%{version}
%patch 1 -p1
%patch 2 -p1
# Tests failing with Java 17
sed -i '/testAwaitInputInBuffer\|testAwaitInputInSocket\|testNotStaleWhenHasData\|testWriteSmallFragmentBuffering\|testWriteSmallFragmentNoBuffering/i@org.junit.Ignore' httpcore/src/test/java/org/apache/http/impl/{TestBHttpConnectionBase,io/TestSessionInOutBuffers}.java
%pom_remove_plugin :maven-checkstyle-plugin
%pom_remove_plugin :apache-rat-plugin
%pom_remove_plugin :maven-source-plugin
%pom_remove_plugin :maven-javadoc-plugin
# We don't have conscrypt for testing
%pom_remove_dep :conscrypt-openjdk-uber httpcore-nio
rm httpcore-nio/src/test/java/org/apache/http/nio/integration/TestJSSEProviderIntegration.java
# we don't need these artifacts right now
%pom_disable_module httpcore-osgi
%pom_disable_module httpcore-ab
# OSGify modules
for module in httpcore httpcore-nio; do
%pom_xpath_remove "pom:project/pom:packaging" $module
%pom_xpath_inject "pom:project" "bundle" $module
%pom_remove_plugin :maven-jar-plugin $module
%pom_xpath_inject "pom:build/pom:plugins" "
org.apache.felix
maven-bundle-plugin
true
*
org.apache.httpcomponents.$module
<_nouses>true
" $module
done
# install JARs to httpcomponents/ for compatibility reasons
# several other packages expect to find the JARs there
%mvn_file ":{*}" httpcomponents/@1
%build
%mvn_build -- -Dmaven.compiler.release=8
%install
%mvn_install
%files -f .mfiles
%license LICENSE.txt NOTICE.txt
%doc README.txt RELEASE_NOTES.txt
%changelog
* Wed Dec 13 2023 Marian Koncek - 4.4.16-1
- Initial build