Compare commits

...

No commits in common. "c8" and "c9s" have entirely different histories.
c8 ... c9s

6 changed files with 236 additions and 106 deletions

7
.gitignore vendored
View File

@ -1 +1,6 @@
SOURCES/1.6.tar.gz
/results_*
/*.src.rpm
/replacer-1.5.2-src-svn.tar.gz
/replacer-1.5.3.tar.xz
/1.6.tar.gz

View File

@ -1 +1 @@
9657f1c3a52c1779207fefcf4720b60692b87193 SOURCES/1.6.tar.gz
9657f1c3a52c1779207fefcf4720b60692b87193 1.6.tar.gz

View File

@ -0,0 +1,73 @@
From 60b89b4047b55aca0592243efd63fc9ac5f2c0f0 Mon Sep 17 00:00:00 2001
From: Mat Booth <mat.booth@redhat.com>
Date: Wed, 13 Feb 2019 16:09:35 +0000
Subject: [PATCH] Fix build with Mockito 2.x
---
.../maven_replacer_plugin/ReplacementProcessorTest.java | 1 -
.../maven_replacer_plugin/ReplacerMojoIntegrationTest.java | 2 +-
.../code/maven_replacer_plugin/ReplacerMojoTest.java | 7 ++++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/test/java/com/google/code/maven_replacer_plugin/ReplacementProcessorTest.java b/src/test/java/com/google/code/maven_replacer_plugin/ReplacementProcessorTest.java
index 30632e7..83d088c 100644
--- a/src/test/java/com/google/code/maven_replacer_plugin/ReplacementProcessorTest.java
+++ b/src/test/java/com/google/code/maven_replacer_plugin/ReplacementProcessorTest.java
@@ -43,7 +43,6 @@ public class ReplacementProcessorTest {
public void setUp() throws Exception {
when(fileUtils.readFile(FILE, ENCODING)).thenReturn(CONTENT);
when(replacement.getToken()).thenReturn(TOKEN);
- when(replacement.getValue()).thenReturn(VALUE);
when(replacerFactory.create(replacement)).thenReturn(replacer);
processor = new ReplacementProcessor(fileUtils, replacerFactory);
diff --git a/src/test/java/com/google/code/maven_replacer_plugin/ReplacerMojoIntegrationTest.java b/src/test/java/com/google/code/maven_replacer_plugin/ReplacerMojoIntegrationTest.java
index 0e7aa64..6d99455 100644
--- a/src/test/java/com/google/code/maven_replacer_plugin/ReplacerMojoIntegrationTest.java
+++ b/src/test/java/com/google/code/maven_replacer_plugin/ReplacerMojoIntegrationTest.java
@@ -7,7 +7,7 @@ import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.argThat;
+import static org.mockito.hamcrest.MockitoHamcrest.argThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
diff --git a/src/test/java/com/google/code/maven_replacer_plugin/ReplacerMojoTest.java b/src/test/java/com/google/code/maven_replacer_plugin/ReplacerMojoTest.java
index 060f916..b53845c 100644
--- a/src/test/java/com/google/code/maven_replacer_plugin/ReplacerMojoTest.java
+++ b/src/test/java/com/google/code/maven_replacer_plugin/ReplacerMojoTest.java
@@ -7,9 +7,10 @@ import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.argThat;
+import static org.mockito.hamcrest.MockitoHamcrest.argThat;
import static org.mockito.Matchers.eq;
import static org.mockito.Matchers.isA;
import static org.mockito.Mockito.mock;
@@ -428,7 +429,7 @@ public class ReplacerMojoTest {
@Test (expected = MojoExecutionException.class)
public void shouldRethrowIOExceptionsAsMojoExceptions() throws Exception {
- when(fileUtils.readFile(anyString(), anyString())).thenThrow(new IOException());
+ when(fileUtils.readFile((String)any(), (String)any())).thenThrow(new IOException());
mojo.setRegexFlags(regexFlags);
mojo.setRegex(REGEX);
@@ -442,7 +443,7 @@ public class ReplacerMojoTest {
@Test
public void shouldNotThrowExceptionWhenIgnoringErrors() throws Exception {
- when(fileUtils.readFile(anyString(), anyString())).thenThrow(new IOException());
+ when(fileUtils.readFile((String)any(), (String)any())).thenThrow(new IOException());
mojo.setIgnoreErrors(true);
mojo.setFile(FILE);
--
2.20.1

View File

@ -1,104 +0,0 @@
Name: replacer
Version: 1.6
Release: 6%{?dist}
Summary: Replacer Maven Mojo
License: MIT
URL: https://github.com/beiliubei/maven-replacer-plugin
# http://code.google.com/p/maven-replacer-plugin/
Source0: https://github.com/beiliubei/maven-replacer-plugin/archive/%{version}.tar.gz
BuildRequires: maven-local
BuildRequires: mvn(commons-io:commons-io)
BuildRequires: mvn(commons-lang:commons-lang)
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(org.apache.ant:ant)
BuildRequires: mvn(org.apache.maven:maven-plugin-api)
BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin)
BuildRequires: mvn(org.hamcrest:hamcrest-all)
BuildRequires: mvn(org.mockito:mockito-all)
BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:)
BuildRequires: mvn(xerces:xercesImpl)
BuildRequires: mvn(xml-apis:xml-apis)
BuildArch: noarch
%description
Maven plugin to replace tokens in a given file with a value.
This plugin is also used to automatically generating PackageVersion.java
in the FasterXML.com project.
%package javadoc
Summary: Javadoc for %{name}
%description javadoc
This package contains javadoc for %{name}.
%prep
%setup -q -n maven-replacer-plugin-%{version}
%pom_remove_plugin :dashboard-maven-plugin
%pom_remove_plugin :maven-assembly-plugin
# NoClassDefFoundError: org/w3c/dom/ElementTraversal
%pom_add_dep xml-apis:xml-apis::test
sed -i.hamcrest '/startsWith/d' src/test/java/com/google/code/maven_replacer_plugin/file/FileUtilsTest.java
%mvn_file :%{name} %{name}
%mvn_alias :%{name} com.google.code.maven-replacer-plugin:maven-replacer-plugin
%build
%mvn_build
%install
%mvn_install
%files -f .mfiles
%doc README.md
%license LICENSE
%files javadoc -f .mfiles-javadoc
%license LICENSE
%changelog
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.6-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.6-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Tue Mar 17 2015 gil cattaneo <puntogil@libero.it> 1.6-1
- update to 1.6
- fix Url tag and Source0 tag
* Wed Feb 11 2015 gil cattaneo <puntogil@libero.it> 1.5.3-2
- introduce license macro
* Thu Jul 03 2014 gil cattaneo <puntogil@libero.it> 1.5.3-1
- update to 1.5.3
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Fri Mar 28 2014 Michael Simacek <msimacek@redhat.com> - 1.5.2-4
- Use Requires: java-headless rebuild (#1067528)
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Wed Jul 03 2013 gil cattaneo <puntogil@libero.it> 1.5.2-2
- switch to XMvn
- minor changes to adapt to current guideline
* Sun May 26 2013 gil cattaneo <puntogil@libero.it> 1.5.2-1
- initial rpm

155
replacer.spec Normal file
View File

@ -0,0 +1,155 @@
Name: replacer
Version: 1.6
Release: 20%{?dist}
Summary: Replacer Maven Mojo
License: MIT
URL: https://github.com/beiliubei/maven-replacer-plugin
# http://code.google.com/p/maven-replacer-plugin/
Source0: https://github.com/beiliubei/maven-replacer-plugin/archive/%{version}.tar.gz
BuildRequires: maven-local
BuildRequires: mvn(commons-io:commons-io)
BuildRequires: mvn(org.apache.ant:ant)
BuildRequires: mvn(org.apache.commons:commons-lang3)
BuildRequires: mvn(org.apache.maven:maven-plugin-api)
BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin)
BuildRequires: mvn(xerces:xercesImpl)
BuildArch: noarch
%description
Maven plugin to replace tokens in a given file with a value.
This plugin is also used to automatically generating PackageVersion.java
in the FasterXML.com project.
%package javadoc
Summary: Javadoc for %{name}
%description javadoc
This package contains javadoc for %{name}.
%prep
%setup -q -n maven-replacer-plugin-%{version}
# remove unnecessary dependency on parent POM
%pom_remove_parent
%pom_remove_plugin :dashboard-maven-plugin
%pom_remove_plugin :maven-assembly-plugin
# remove hard-coded compiler settings
%pom_remove_plugin :maven-compiler-plugin
%pom_xpath_inject pom:build/pom:plugins "<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration><source>\${maven.compiler.source}</source><detectJavaApiLink>false</detectJavaApiLink></configuration>
</plugin>"
# trivial port to commons-lang3
%pom_change_dep :commons-lang org.apache.commons:commons-lang3:3.8.1
for i in $(find -name "*.java"); do
sed -i "s/org.apache.commons.lang./org.apache.commons.lang3./g" $i;
done
%mvn_file :%{name} %{name}
%mvn_alias :%{name} com.google.code.maven-replacer-plugin:maven-replacer-plugin
%build
%mvn_build -f -- -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8
%install
%mvn_install
%files -f .mfiles
%doc README.md
%license LICENSE
%files javadoc -f .mfiles-javadoc
%license LICENSE
%changelog
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1.6-20
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.6-19
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.6-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Thu Jul 30 2020 Fabio Valentini <decathorpe@gmail.com> - 1.6-17
- Port to commons-lang3.
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.6-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Sat Jul 11 2020 Jiri Vanek <jvanek@redhat.com> - 1.6-15
- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11
* Fri Jun 26 2020 Mat Booth <mat.booth@redhat.com> - 1.6-14
- Allow building against Java 11
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.6-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Nov 22 2019 Fabio Valentini <decathorpe@gmail.com> - 1.6-12
- Remove unnecessary dependency on parent POM.
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.6-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Thu Apr 18 2019 Mat Booth <mat.booth@redhat.com> - 1.6-10
- Disable tests to reduce dependency tree
* Wed Feb 13 2019 Mat Booth <mat.booth@redhat.com> - 1.6-9
- Fix build against mockito 2.x
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.6-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.6-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.6-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.6-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Tue Mar 17 2015 gil cattaneo <puntogil@libero.it> 1.6-1
- update to 1.6
- fix Url tag and Source0 tag
* Wed Feb 11 2015 gil cattaneo <puntogil@libero.it> 1.5.3-2
- introduce license macro
* Thu Jul 03 2014 gil cattaneo <puntogil@libero.it> 1.5.3-1
- update to 1.5.3
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Fri Mar 28 2014 Michael Simacek <msimacek@redhat.com> - 1.5.2-4
- Use Requires: java-headless rebuild (#1067528)
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Wed Jul 03 2013 gil cattaneo <puntogil@libero.it> 1.5.2-2
- switch to XMvn
- minor changes to adapt to current guideline
* Sun May 26 2013 gil cattaneo <puntogil@libero.it> 1.5.2-1
- initial rpm

1
sources Normal file
View File

@ -0,0 +1 @@
fd3504b890f62e583db4182b09dad5be 1.6.tar.gz