From 305e31f9df9422d17a75ccb1dc9f8edc0cc50769 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen dchen@redhat.com Date: Oct 31 2017 14:42:36 +0000 Subject: fix the build
---
diff --git a/zanata-platform-4.2.1-mvn-extensions.patch b/zanata-platform-4.2.1-mvn-extensions.patch deleted file mode 100644 index aaabd2a..0000000 --- a/zanata-platform-4.2.1-mvn-extensions.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -up ./.mvn/extensions.xml.mvn-extensions ./.mvn/extensions.xml ---- ./.mvn/extensions.xml.mvn-extensions 2017-02-24 15:13:24.000000000 +1000 -+++ ./.mvn/extensions.xml 2017-03-03 00:30:41.150070899 +1000 -@@ -34,9 +34,11 @@ - NB: may give odd timings when running multi-threaded - builds with mvn's -T option, eg smart builder. - --> -+ <!-- - <extension> - <groupId>co.leantechniques</groupId> - <artifactId>maven-buildtime-extension</artifactId> - <version>3.0.1</version> - </extension> -+ --> - </extensions> diff --git a/zanata-platform-4.3.0-mvn-extensions.patch b/zanata-platform-4.3.0-mvn-extensions.patch new file mode 100644 index 0000000..b1bfa78 --- /dev/null +++ b/zanata-platform-4.3.0-mvn-extensions.patch @@ -0,0 +1,12 @@ +diff -up ./zanata-platform-platform-4.3.0/.mvn/extensions.xml.mvn-extensions ./zanata-platform-platform-4.3.0/.mvn/extensions.xml +--- ./zanata-platform-platform-4.3.0/.mvn/extensions.xml.mvn-extensions 2017-10-08 23:18:05.000000000 +1000 ++++ ./zanata-platform-platform-4.3.0/.mvn/extensions.xml 2017-10-30 18:02:56.181060090 +1000 +@@ -21,7 +21,7 @@ + <extension> + <groupId>io.takari.maven</groupId> + <artifactId>takari-smart-builder</artifactId> +- <version>0.5.0</version> ++ <version>0.6.1</version> + </extension> + <!-- Enable faster downloads --> + <extension> diff --git a/zanata-platform.spec b/zanata-platform.spec index da0ae2c..5341272 100644 --- a/zanata-platform.spec +++ b/zanata-platform.spec @@ -3,9 +3,11 @@ %global javac_source_ver 1.8 %global java_ver_min %{javac_source_ver}.0 %global jsr305_maven_name mvn(com.google.code.findbugs:jsr305) -%global jsr305_maven_version %(rpm -q --whatprovides "%{jsr305_maven_name}" --provides | sed -n -e 's/%{jsr305_maven_name} = //p') +%global jsr305_maven_version %(rpm -q --qf "%%{version}" --whatprovides "%{jsr305_maven_name}") %global resteasy_ver_min 3.0.6 %global resteasy_version %(rpm -q --qf "%%{version}" resteasy-core) +%global takari_smart_builder_version %(rpm -q --qf "%%{version}" takari-smart-builder) +%global takari_lifecycle_version %(rpm -q --qf "%%{version}" takari-lifecycle) %global simpleframework_version %(rpm -q --qf "%%{version}" simple) %global client_sub_modules zanata-rest-client zanata-client-commands zanata-cli %global client_command_name zanata-cli @@ -20,7 +22,7 @@ Group: Development/Tools License: LGPLv2+ URL: https://github.com/zanata/%%7Bname%7D Source0: https://github.com/zanata/%%7Bname%7D/archive/platform-%%7Bversion%7D.zip -Patch0: %{name}-4.2.1-mvn-extensions.patch +Patch0: %{name}-4.3.0-mvn-extensions.patch
BuildArch: noarch
@@ -37,6 +39,7 @@ BuildRequires: jgettext BuildRequires: jsr-305 BuildRequires: maven-dependency-plugin BuildRequires: mvn(com.sun:tools) +BuildRequires: mvn(commons-beanutils:commons-beanutils) BuildRequires: mvn(com.google.guava:guava) BuildRequires: mvn(io.takari.aether:aether-connector-okhttp) BuildRequires: mvn(javax.validation:validation-api) @@ -57,6 +60,7 @@ BuildRequires: mvn(org.hibernate:hibernate-validator) BuildRequires: mvn(org.jboss:jboss-parent:pom:) BuildRequires: mvn(org.jboss.resteasy:jaxrs-api) BuildRequires: mvn(org.mockito:mockito-core) +BuildRequires: mvn(org.scannotation:scannotation) BuildRequires: mvn(org.slf4j:jcl-over-slf4j) BuildRequires: openprops BuildRequires: powermock-api-mockito @@ -67,8 +71,8 @@ BuildRequires: simple BuildRequires: slf4j BuildRequires: slf4j-log4j12 BuildRequires: spock-core -BuildRequires: takari-lifecycle -BuildRequires: takari-smart-builder +#BuildRequires: takari-lifecycle +#BuildRequires: takari-smart-builder BuildRequires: xom Requires: java-headless >= 1:%{java_ver_min} Requires: apache-commons-csv @@ -122,7 +126,7 @@ It also contains REST stub for interacting with a Zanata server.
%prep %setup -q -n %{name}-platform-%{version} -%patch0 -b .mvn-extensions -p0 +%patch0 -b .mvn-extensions -p2
## Remove .jar files in source rm -f .mvn/wrapper/maven-wrapper.jar @@ -130,6 +134,8 @@ rm -f parent/intellij-code-style-settings.jar
## Single Thread compile sed -i -e 's/--T 1.0C/--T 1/' .mvn/maven.config +sed -i -e 's/--builder .*/--builder singlethreaded/' .mvn/maven.config +#sed -i -e 's/--builder .*/--builder multithreaded/' .mvn/maven.config
## remove SupressFBWarnings, because Fedora does not have edu.umd.cs.findbugs.annotations.SuppressFBWarnings for jSrc in $( grep -R -l edu.umd.cs --include '*.java' * ); do @@ -137,11 +143,20 @@ for jSrc in $( grep -R -l edu.umd.cs --include '*.java' * ); do sed -i -e 's/@SuppressFBWarnings.*$//' $jSrc done
+## Global +%pom_remove_dep -r com.google.code.findbugs:findbugs-annotations +%pom_remove_plugin -r :findbugs-maven-plugin parent +%pom_remove_plugin -r :maven-enforcer-plugin parent +%pom_remove_plugin -r :takari-lifecycle-plugin + +## root %pom_xpath_set "pom:parent/pom:relativePath" "parent/pom.xml" %mvn_artifact pom.xml
## build-tools %mvn_artifact build-tools/pom.xml +%pom_xpath_set "pom:packaging" "jar" build-tools + %pom_xpath_remove "pom:profiles/pom:profile[pom:id='release']/pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-gpg-plugin']" build-tools %pom_remove_plugin :maven-surefire-plugin build-tools %pom_remove_dep com.lesfurets:jenkins-pipeline-unit build-tools @@ -149,17 +164,15 @@ done rm -fr build-tools/src/test/java/TestJenkinsfile.java
## parent -%pom_remove_dep com.google.code.findbugs:findbugs-annotations parent -%pom_remove_dep org.jboss.resteasy:resteasy-bom parent +%mvn_artifact parent/pom.xml %pom_remove_plugin :animal-sniffer-maven-plugin parent %pom_remove_plugin :restrict-maven-plugin parent %pom_remove_plugin :duplicate-finder-maven-plugin parent -%pom_remove_plugin :findbugs-maven-plugin parent %pom_remove_plugin :gitdescribe-maven-plugin parent %pom_remove_plugin :jacoco-maven-plugin parent +%pom_remove_plugin :maven-antrun-plugin parent %pom_remove_plugin :maven-checkstyle-plugin parent %pom_remove_plugin :maven-eclipse-plugin parent -%pom_remove_plugin :maven-enforcer-plugin parent %pom_remove_plugin :maven-release-plugin parent %pom_remove_plugin :maven-sortpom-plugin parent %pom_remove_plugin :maven-source-plugin parent @@ -167,104 +180,104 @@ rm -fr build-tools/src/test/java/TestJenkinsfile.java %pom_remove_plugin :versions-maven-plugin parent %pom_xpath_remove "pom:profiles/pom:profile[pom:id='release']/pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-gpg-plugin']" parent %pom_xpath_inject "pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-javadoc-plugin']/pom:executions" "<execution><id>aggregate</id><goals><goal>aggregate</goal></goals><phase>prepare-package</phase></execution>" parent - - -# Takari plugin -%pom_xpath_remove "pom:build/pom:plugins/pom:plugin[pom:artifactId='takari-lifecycle-plugin']/pom:dependencies" parent +%pom_xpath_set "pom:properties/pom:resteasy.version" %{resteasy_version} parent
%pom_xpath_remove "pom:build/pom:extensions" parent -%pom_xpath_set "pom:properties/pom:resteasy.version" %{resteasy_version} parent -%pom_xpath_inject "pom:properties" "<gitDescribe>%{version}</gitDescribe>" parent +%pom_xpath_remove "pom:properties/pom:maven.compiler.compilerId" parent
+%pom_xpath_inject "pom:properties" "<gitDescribe>%{version}</gitDescribe>" parent
-%mvn_artifact parent/pom.xml
## api -#%pom_remove_plugin :findbugs-maven-plugin api %pom_xpath_set "pom:parent/pom:relativePath" "../parent/pom.xml" api %mvn_artifact api/pom.xml
## zanata-common-api -%pom_remove_dep com.google.code.findbugs:findbugs-annotations api/zanata-common-api +%mvn_artifact api/zanata-common-api/pom.xml api/zanata-common-api/target/zanata-common-api-%{version}.jar +%pom_xpath_set "pom:packaging" "jar" api/zanata-common-api + %pom_remove_plugin :enunciate-slim-maven-plugin api/zanata-common-api %pom_remove_plugin :gmaven-plugin api/zanata-common-api -%pom_remove_plugin :maven-enforcer-plugin api/zanata-common-api %pom_remove_plugin :maven-shade-plugin api/zanata-common-api %pom_remove_dep org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_2.0_spec api/zanata-common-api
-# We use the existing findbugs in fedora -%pom_add_dep com.google.code.findbugs:jsr305:2.0.1:provided api/zanata-common-api %pom_xpath_inject "pom:dependencies/pom:dependency[pom:artifactId='resteasy-multipart-provider']" "<version>%{resteasy_version}</version>" api/zanata-common-api
# delete enunciate stuff rm -rf zanata-common-api/src/test/java/org/zanata/rest/enunciate -rm -rf zanata-common-api/src/test/java/org/zanata/rest/dto/ rm -rf zanata-common-api/src/test/java/org/zanata/rest/service
# remove groovy-all and spock %pom_remove_dep org.codehaus.groovy:groovy-all api/zanata-common-api %pom_remove_dep org.spockframework:spock-core api/zanata-common-api
-%mvn_artifact api/zanata-common-api/pom.xml api/zanata-common-api/target/zanata-common-api-%{version}.jar
## common -#%pom_remove_dep '${project.groupId}:zanata-common-api' common -#%pom_remove_plugin :findbugs-maven-plugin common -%pom_remove_dep com.google.code.findbugs:findbugs-annotations common/zanata-adapter-glossary -%pom_remove_dep com.google.code.findbugs:findbugs-annotations common/zanata-adapter-xliff -%pom_remove_dep com.google.code.findbugs:findbugs-annotations common/zanata-common-util -%pom_add_dep com.google.code.findbugs:jsr305:2.0.1:provided common %pom_xpath_set "pom:parent/pom:relativePath" "../parent/pom.xml" common %mvn_artifact common/pom.xml + +%pom_add_dep com.google.code.findbugs:jsr305:2.0.1:provided common + +## common/zanata-common-util +%mvn_artifact common/zanata-common-util/pom.xml common/zanata-common-util/target/zanata-common-util-%{version}.jar +%pom_xpath_set "pom:packaging" "jar" common/zanata-common-util + +%pom_xpath_inject "pom:parent" "<relativePath>../pom.xml</relativePath>" common/zanata-common-util + +## common/zanata-adapters %mvn_artifact common/zanata-adapter-po/pom.xml common/zanata-adapter-po/target/zanata-adapter-po-%{version}.jar %mvn_artifact common/zanata-adapter-properties/pom.xml common/zanata-adapter-properties/target/zanata-adapter-properties-%{version}.jar -%mvn_artifact common/zanata-common-util/pom.xml common/zanata-common-util/target/zanata-common-util-%{version}.jar %mvn_artifact common/zanata-adapter-glossary/pom.xml common/zanata-adapter-glossary/target/zanata-adapter-glossary-%{version}.jar %mvn_artifact common/zanata-adapter-xliff/pom.xml common/zanata-adapter-xliff/target/zanata-adapter-xliff-%{version}.jar +%pom_xpath_set "pom:packaging" "jar" common/zanata-adapter-po +%pom_xpath_set "pom:packaging" "jar" common/zanata-adapter-properties +%pom_xpath_set "pom:packaging" "jar" common/zanata-adapter-glossary +%pom_xpath_set "pom:packaging" "jar" common/zanata-adapter-xliff
-## common/zanata-common-util - ## client +%pom_xpath_set "pom:parent/pom:relativePath" "../parent/pom.xml" client +%mvn_artifact client/pom.xml %mvn_package ":zanata-{rest-client,client-commands,cli}" zanata-client %mvn_package ":client,stub-server" zanata-client -#%pom_remove_plugin :findbugs-maven-plugin client + + %pom_xpath_set "pom:properties/pom:resteasy.version" %{resteasy_version} client #%pom_xpath_inject "pom:dependencies" "<dependency><groupId>com.google.code.findbugs</groupId><artifactId>jsr305</artifactId><version>2.0.1</version><scope>provided</scope></dependency>" client
# Ensure it compile with supported java version %pom_add_plugin org.apache.maven.plugins:maven-compiler-plugin client "<configuration><source>%{javac_source_ver}</source><target>%{javac_source_ver}</target><fork>true</fork><verbose>true</verbose></configuration>" -#%pom_xpath_inject "pom:plugins" "<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><configuration><source>%{javac_source_ver}</source><target>%{javac_source_ver}</target><fork>true</fork><verbose>true</verbose></configuration></plugin>" client
%pom_xpath_set "pom:dependencies/pom:dependency[pom:groupId='org.simpleframework']/pom:artifactId" "simple-http" client %pom_xpath_set "pom:dependencies/pom:dependency[pom:groupId='org.simpleframework']/pom:version" %{simpleframework_version} client -%pom_xpath_set "pom:parent/pom:relativePath" "../parent/pom.xml" client -%mvn_artifact client/pom.xml
## stub-server -%pom_remove_dep com.google.code.findbugs:findbugs-annotations client/stub-server -#%pom_remove_dep com.google.code.findbugs:jsr305 client/stub-server +%mvn_artifact client/stub-server/pom.xml client/stub-server/target/stub-server-%{version}.jar +%pom_xpath_set "pom:packaging" "jar" client/stub-server + %pom_remove_dep org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_2.0_spec client/stub-server %pom_remove_dep org.scannotation:scannotation client/stub-server %pom_remove_plugin :duplicate-finder-maven-plugin client/stub-server %pom_remove_plugin :maven-surefire-plugin client/stub-server
## rest +%mvn_artifact client/zanata-rest-client/pom.xml client/zanata-rest-client/target/zanata-rest-client-%{version}.jar +%pom_xpath_set "pom:packaging" "jar" client/zanata-rest-client + rm -fr client/zanata-rest-client/src/test ## remove the test dependency -%pom_remove_dep org.zanata:stub-server client/zanata-rest-client -%pom_remove_dep com.google.code.findbugs:findbugs-annotations client/zanata-rest-client -%pom_remove_dep com.google.code.findbugs:jsr305 client/zanata-rest-client -%pom_xpath_inject "pom:dependencies" "<dependency><groupId>com.google.code.findbugs</groupId><artifactId>jsr305</artifactId><version>2.0.1</version><scope>provided</scope></dependency>" client/zanata-rest-client %pom_remove_plugin :duplicate-finder-maven-plugin client/zanata-rest-client
-%mvn_artifact client/zanata-rest-client/pom.xml client/zanata-rest-client/target/zanata-rest-client-%{version}.jar
## command -%pom_remove_dep com.google.code.findbugs:findbugs-annotations client/zanata-client-commands -#%pom_remove_dep com.google.code.findbugs:jsr305 client/zanata-client-commands +#%pom_remove_dep :zanata-common-api client/zanata-client-commands +#%pom_remove_dep :zanata-common-util client/zanata-client-commands +#%pom_remove_dep :zanata-adapter-glossary client/zanata-client-commands +#%pom_remove_dep :zanata-adapter-po client/zanata-client-commands +#%pom_remove_dep :zanata-adapter-properties client/zanata-client-commands +#%pom_remove_dep :zanata-adapter-xliff client/zanata-client-commands +#%pom_remove_dep :zanata-rest-client client/zanata-client-commands %pom_remove_dep org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_2.0_spec client/zanata-client-commands -#%pom_add_dep com.google.code.findbugs:jsr305:2.0.1:provided client/zanata-common-commands %pom_xpath_set "pom:dependencies/pom:dependency[pom:groupId='org.simpleframework']/pom:artifactId" "simple-http" client/zanata-client-commands
rm client/zanata-client-commands/src/test/java/org/zanata/client/commands/*.java @@ -272,15 +285,15 @@ rm client/zanata-client-commands/src/test/java/org/zanata/client/commands/init/* rm client/zanata-client-commands/src/test/java/org/zanata/client/commands/push/*.java rm client/zanata-client-commands/src/test/java/org/zanata/client/commands/pull/*.java
-%mvn_artifact client/zanata-client-commands/pom.xml client/zanata-client-commands/target/zanata-client-commands-%{version}.jar ## remove SupressFBWarnings, because Fedora does not have edu.umd.cs.findbugs.annotations.SuppressFBWarnings sed -i -e 's/import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;.*$//' client/zanata-client-commands/src/main/java/org/zanata/client/commands/*.java sed -i -e 's/@SuppressFBWarnings.*$//' client/zanata-client-commands/src/main/java/org/zanata/client/commands/*.java
+%mvn_artifact client/zanata-client-commands/pom.xml client/zanata-client-commands/target/zanata-client-commands-%{version}.jar +%pom_xpath_set "pom:packaging" "jar" client/zanata-client-commands
## cli ## No need to generate tarball, thus remove assembly-plugin -%pom_remove_dep com.google.code.findbugs:findbugs-annotations client/zanata-cli #%pom_remove_dep com.google.code.findbugs:jsr305 client/zanata-cli %pom_remove_plugin :appassembler-maven-plugin client/zanata-cli %pom_remove_plugin :maven-assembly-plugin client/zanata-cli @@ -292,6 +305,7 @@ rm client/zanata-cli/src/test/java/org/zanata/client/ClientToServerTest.java rm client/zanata-cli/src/test/java/org/zanata/client/HTTPMockContainer.java
%mvn_artifact client/zanata-cli/pom.xml client/zanata-cli/target/zanata-cli-%{version}.jar +%pom_xpath_set "pom:packaging" "jar" client/zanata-cli
## zanata-maven-plugin # zanata-maven-plugin depends on com.pyx4j:maven-plugin-log4j, @@ -303,13 +317,7 @@ rm client/zanata-cli/src/test/java/org/zanata/client/HTTPMockContainer.java %pom_disable_module server
%build -# Don't install here, it seems takari produces many duplicates in xmvn-reactor -# Skip the test compile for build tools to avoid Jenkinsfile unit tests -#%mvn_build -i -G -- %{mvn_build_opts} -Dmaven.test.skip -pl build-tools,parent,api,api/zanata-common-api -# Build the rest with unit tests, for it is used to build command lines -#%mvn_build -i -G -- %{mvn_build_opts} -pl '!build-tools,!parent,!api,!api/zanata-common-api' -%mvn_build -i -G -- %{mvn_build_opts} - +%mvn_build -i -X -- %{mvn_build_opts}
%install %mvn_install -X @@ -325,8 +333,8 @@ for mod in . %{client_sub_modules};do sed -i.bak -e "s|/usr/lib/java/||" $mod/cp.txt sed -i.bak -e "s|-%{version}||" $mod/cp.txt if [ ! $mod = . ];then - echo -e "\n" >> cp.txt - cat $mod/cp.txt >> cp.txt + echo -e "\n" >> cp.txt + cat $mod/cp.txt >> cp.txt fi done sort -u cp.txt > cp-sorted.txt @@ -364,7 +372,7 @@ chmod 755 %{buildroot}%{_bindir}/zanata-cli %doc client/README.md docs/client/index.md docs/client/configuration.md docs/client/command-hook.md
%changelog -* Wed Oct 18 2017 Ding-Yi Chen dchen@redhat.com 4.3.0-1 +* Tue Oct 31 2017 Ding-Yi Chen dchen@redhat.com 4.3.0-1 - Upstream update to 4.3.0
* Mon Sep 04 2017 Ding-Yi Chen dchen@redhat.com 4.2.4-1
https://src.fedoraproject.org/rpms/zanata-platform/c/305e31f9df9422d17a75ccb...
scm-commits@lists.fedoraproject.org