More clean and lightweight downloading of dependencies for testing.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Thu, 8 Sep 2016 16:50:18 +0000 (18:50 +0200)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Thu, 8 Sep 2016 16:50:18 +0000 (18:50 +0200)
jOCCI-api/jOCCI-api.spec

index 40391f1..a16b141 100644 (file)
@@ -2,6 +2,7 @@
 %global gittag0 jocci-api-0.2.6
 %global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
 
+# requires network access
 %global use_tests 1
 
 Name:           jOCCI-api
@@ -18,14 +19,14 @@ BuildRequires:  maven-local
 BuildRequires:  mvn(cz.cesnet.cloud:jocci-core)
 BuildRequires:  mvn(com.google.code.gson:gson)
 %if 0%{?use_tests}
-# for downloading dependencies
-BuildRequires:  maven
+# to download dependencies
+BuildRequires:  maven maven-clean-plugin maven-dependency-plugin maven-deploy-plugin maven-install-plugin
 BuildRequires:  mvn(junit:junit)
-# not available
+# not available (downloaded)
 #BuildRequires:  mvn(com.github.tomakehurst:wiremock)
 %endif
 BuildRequires:  mvn(org.apache.httpcomponents:httpclient:4.3)
-BuildRequires:  mvn(org.bouncycastle:bcprov-jdk16) = 1.46
+BuildRequires:  mvn(org.bouncycastle:bcprov-jdk16:1.46)
 BuildRequires:  mvn(org.slf4j:slf4j-log4j12)
 
 %description
@@ -46,6 +47,7 @@ This package contains the API documentation for %{name}.
 %prep
 %setup -q -n %{name}-%{commit0}
 
+%pom_remove_plugin com.github.github:site-maven-plugin
 %pom_remove_plugin org.sonatype.plugins:nexus-staging-maven-plugin
 
 
@@ -54,12 +56,7 @@ This package contains the API documentation for %{name}.
 %pom_add_dep org.apache.httpcomponents:httpclient:4.3
 
 %if 0%{?use_tests}
-mvn dependency:copy-dependencies
-find ~/.m2 -type d -name bcprov\* -exec rm -rvf {} \; || :
-find ~/.m2 -type d -name httpcore -exec rm -rvf {} \; || :
-find ~/.m2 -type d -name httpclient -exec rm -rvf {} \; || :
-find ~/.m2 -type d -name jocci\* -exec rm -rvf {} \; || :
-find ~/.m2 -type d -name junit\* -exec rm -rvf {} \; || :
+mvn_bootstrap=1 xmvn -DincludeArtifactIds=com.github.tomakehurst:wiremock dependency:copy-dependencies
 %mvn_build
 %else
 %mvn_build -f