From ba62853dac12badbab0fb49dd1a102449779d55a Mon Sep 17 00:00:00 2001 From: James Antill Date: Mon, 27 Feb 2023 13:46:44 -0500 Subject: [PATCH] Import rpm: c8s --- .gitignore | 2 + ...-Shade-json-simple-for-JVM-agent-jar.patch | 148 ++++++++++++++++++ jolokia-jvm-agent.spec | 78 +++++++++ sources | 1 + 4 files changed, 229 insertions(+) create mode 100644 .gitignore create mode 100644 0001-Shade-json-simple-for-JVM-agent-jar.patch create mode 100644 jolokia-jvm-agent.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2b5e04d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +SOURCES/jolokia-1.6.2-source.tar.gz +/jolokia-1.6.2-source.tar.gz diff --git a/0001-Shade-json-simple-for-JVM-agent-jar.patch b/0001-Shade-json-simple-for-JVM-agent-jar.patch new file mode 100644 index 0000000..b251d4c --- /dev/null +++ b/0001-Shade-json-simple-for-JVM-agent-jar.patch @@ -0,0 +1,148 @@ +From e7ab408b8cac0b0881829010c91844bae4bc845d Mon Sep 17 00:00:00 2001 +From: Severin Gehwolf +Date: Tue, 27 Aug 2019 18:33:44 +0200 +Subject: [PATCH] Shade json-simple for JVM agent jar + +The dependency is then included in its own namespace, +namely org.jolokia.shaded.org.json.simple*. + +Closes #398 +--- + agent/jvm/pom.xml | 56 ++++++++++++++++++--------- + agent/jvm/src/main/assembly/agent.xml | 32 --------------- + pom.xml | 6 +++ + 3 files changed, 44 insertions(+), 50 deletions(-) + delete mode 100644 agent/jvm/src/main/assembly/agent.xml + +diff --git a/agent/jvm/pom.xml b/agent/jvm/pom.xml +index f2d5de2d..053fee8b 100644 +--- a/agent/jvm/pom.xml ++++ b/agent/jvm/pom.xml +@@ -101,30 +101,50 @@ + + + ++ + +- maven-assembly-plugin +- +- +- src/main/assembly/agent.xml +- +- +- +- org.jolokia.jvmagent.JvmAgent +- org.jolokia.jvmagent.JvmAgent +- org.jolokia.jvmagent.client.AgentLauncher +- false +- false +- false +- +- +- ++ org.apache.maven.plugins ++ maven-shade-plugin ++ 2.3 + + +- make-assembly + package + +- single ++ shade + ++ ++ ++ ++ org.jolokia.shaded. ++ ++ org.json.simple.** ++ ++ ++ org.jolokia.shaded.** ++ ++ ++ ++ ++ ++ com.sun:tools ++ ++ ** ++ ++ ++ ++ ++ ++ ++ org.jolokia.jvmagent.JvmAgent ++ org.jolokia.jvmagent.JvmAgent ++ org.jolokia.jvmagent.client.AgentLauncher ++ false ++ false ++ false ++ ++ ++ ++ + + + +diff --git a/agent/jvm/src/main/assembly/agent.xml b/agent/jvm/src/main/assembly/agent.xml +deleted file mode 100644 +index cc125050..00000000 +--- a/agent/jvm/src/main/assembly/agent.xml ++++ /dev/null +@@ -1,32 +0,0 @@ +- +- +- +- +- agent +- +- jar +- +- false +- +- +- ${artifact.artifactId}.${artifact.extension} +- true +- runtime +- true +- +- +- +\ No newline at end of file +diff --git a/pom.xml b/pom.xml +index 54608911..9fcf5178 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -218,6 +218,12 @@ + 2.5 + + ++ ++ org.apache.maven.plugins ++ maven-shade-plugin ++ 2.3 ++ ++ + + maven-deploy-plugin + 2.8.2 +-- +2.21.0 + diff --git a/jolokia-jvm-agent.spec b/jolokia-jvm-agent.spec new file mode 100644 index 0000000..ed41867 --- /dev/null +++ b/jolokia-jvm-agent.spec @@ -0,0 +1,78 @@ +%global base_name jolokia + +# Filter requires for the Java Agent as deps are bundled within. +%global tools_or_json_simple com\\.googlecode\\.json-simple:json-simple.*|com\\.sun:tools.* +%global mvn_requires_filter .*mvn\\(%{tools_or_json_simple}\\) +%global __requires_exclude ^%{mvn_requires_filter}$ + +Name: jolokia-jvm-agent +Version: 1.6.2 +Release: 3%{?dist} +Summary: Jolokia JVM Agent + +License: ASL 2.0 +URL: https://jolokia.org + +Source0: https://github.com/rhuss/jolokia/releases/download/v%{version}/%{base_name}-%{version}-source.tar.gz +# See https://github.com/rhuss/jolokia/pull/413, namespace json simple +# so as to reduce problems related to classloading for apps using json_simple +# See also: https://github.com/rhuss/jolokia/issues/398 +Patch1: 0001-Shade-json-simple-for-JVM-agent-jar.patch + +BuildArch: noarch + +BuildRequires: maven-local +BuildRequires: mvn(org.apache.maven.plugins:maven-shade-plugin) +BuildRequires: mvn(com.googlecode.json-simple:json-simple) +# jolokia core depends on the servlet API +BuildRequires: mvn(javax.servlet:servlet-api) + +Provides: bundled(com.googlecode.json-simple:json-simple) = 1.1.1 + +%description +Jolokia JVM Agent. + +%prep +%setup -q -n %{base_name}-%{version} +%patch1 -p1 +# Only build the jolokia-jvm artefact. +%pom_disable_module it +%pom_disable_module client +%pom_disable_module tools/test-util +%pom_disable_module war agent +%pom_disable_module war-unsecured agent +%pom_disable_module jsr160 agent +%pom_disable_module osgi agent +%pom_disable_module osgi-bundle agent +%pom_disable_module jmx agent +%pom_disable_module jvm-spring agent +%pom_disable_module mule agent + +%pom_xpath_remove pom:project/pom:build/pom:extensions pom.xml +%pom_xpath_remove pom:project/pom:reporting pom.xml + +# Remove scope=system for com.sun:tools +%pom_xpath_remove "pom:profiles/pom:profile/pom:dependencies/pom:dependency[pom:artifactId='tools']/pom:scope" agent/jvm +%pom_xpath_remove "pom:profiles/pom:profile/pom:dependencies/pom:dependency[pom:artifactId='tools']/pom:systemPath" agent/jvm + +%build +%mvn_build -f -j + +%install +%mvn_install + +%files -f .mfiles +%license LICENSE +%doc NOTICE + +%changelog +* Wed Oct 09 2019 Severin Gehwolf - 1.6.2-3 +- rebuilt + +* Fri Sep 20 2019 Severin Gehwolf - 1.6.2-2 +- Properly name-space bundled json_simple. + See upstream: https://github.com/rhuss/jolokia/issues/398 + +* Mon Aug 12 2019 Severin Gehwolf - 1.6.2-1 +- Initial package. + diff --git a/sources b/sources new file mode 100644 index 0000000..303bdc0 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (jolokia-1.6.2-source.tar.gz) = 2e1649000cbddf3b2706c535d5ec03702a91ff7ea07748e4b3b07cf8249eaafc35923271be5c91d7bd57f4d772edc0ff69a642f20c59f8cf51826e953719b7b0