%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: 1%{?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 Patch0: jolokia-jvm-agent-assembly-excludes.patch BuildArch: noarch BuildRequires: maven-local BuildRequires: mvn(org.apache.maven.plugins:maven-assembly-plugin) BuildRequires: mvn(com.googlecode.json-simple:json-simple) # jolokia core depends on the servlet API BuildRequires: mvn(javax.servlet:servlet-api) # Right now json simple isn't included in its own namespace which # might cause problems for apps also using json simple. # See also: https://github.com/rhuss/jolokia/issues/398 Provides: bundled(com.googlecode.json-simple:json-simple) = 1.1.1 %description Jolokia JVM Agent. %prep %setup -q -n %{base_name}-%{version} %patch0 -p0 # 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 # We skip installation via mvn_build since the default jolokia-jvm.jar is the # non-assembled jar missing manifest entries and dependencies. Use mvn_artifact # instead %mvn_build -f -j -i %mvn_artifact agent/pom.xml %mvn_artifact agent/core/pom.xml agent/core/target/jolokia-core-%{version}.jar %mvn_artifact agent/jvm/pom.xml agent/jvm/target/jolokia-jvm-%{version}-agent.jar %install %mvn_install %files -f .mfiles %license LICENSE %doc NOTICE %changelog * Mon Aug 12 2019 Severin Gehwolf - 1.6.2-1 - Initial package.