commit 48e0c29c8db6331ecfa2251e47ff86bb14e720bc Author: MSVSphere Packaging Team Date: Fri Oct 25 19:06:11 2024 +0300 import replacer-1.6-31.el10 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8146859 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/1.6.tar.gz diff --git a/.replacer.metadata b/.replacer.metadata new file mode 100644 index 0000000..74c57cb --- /dev/null +++ b/.replacer.metadata @@ -0,0 +1 @@ +9657f1c3a52c1779207fefcf4720b60692b87193 SOURCES/1.6.tar.gz diff --git a/SOURCES/0001-Port-to-maven-plugin-annotations-from-Javadoc-tags.patch b/SOURCES/0001-Port-to-maven-plugin-annotations-from-Javadoc-tags.patch new file mode 100644 index 0000000..ab947a6 --- /dev/null +++ b/SOURCES/0001-Port-to-maven-plugin-annotations-from-Javadoc-tags.patch @@ -0,0 +1,390 @@ +From 6959fc7950013a2e94cb30aa008e78f01a03ed63 Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Fri, 9 Feb 2024 21:52:37 +0100 +Subject: [PATCH] Port to maven-plugin-annotations from Javadoc tags + +--- + pom.xml | 6 + + .../maven_replacer_plugin/ReplacerMojo.java | 111 ++++++------------ + 2 files changed, 43 insertions(+), 74 deletions(-) + +diff --git a/pom.xml b/pom.xml +index 9d2de74..4a2efed 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -156,6 +156,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI + 3.0.3 + compile + ++ ++ org.apache.maven.plugin-tools ++ maven-plugin-annotations ++ 3.11.0 ++ provided ++ + + org.apache.ant + ant +diff --git a/src/main/java/com/google/code/maven_replacer_plugin/ReplacerMojo.java b/src/main/java/com/google/code/maven_replacer_plugin/ReplacerMojo.java +index ac165a9..de4fdc3 100644 +--- a/src/main/java/com/google/code/maven_replacer_plugin/ReplacerMojo.java ++++ b/src/main/java/com/google/code/maven_replacer_plugin/ReplacerMojo.java +@@ -14,18 +14,14 @@ import java.util.regex.PatternSyntaxException; + + import org.apache.maven.plugin.AbstractMojo; + import org.apache.maven.plugin.MojoExecutionException; +- ++import org.apache.maven.plugins.annotations.LifecyclePhase; ++import org.apache.maven.plugins.annotations.Mojo; ++import org.apache.maven.plugins.annotations.Parameter; + + /** + * Goal replaces token with value inside file +- * +- * @goal replace +- * +- * @phase compile +- * +- * @threadSafe +- * + */ ++@Mojo(name="replace", defaultPhase=LifecyclePhase.COMPILE, threadSafe=true) + public class ReplacerMojo extends AbstractMojo { + private static final String INVALID_IGNORE_MISSING_FILE_MESSAGE = " only useable with "; + private static final String REGEX_PATTERN_WITH_DELIMITERS_MESSAGE = "Error: %s. " + +@@ -47,27 +43,24 @@ public class ReplacerMojo extends AbstractMojo { + * Path to single file to replace tokens in. + * The file must be text (ascii). + * Based on current execution path. +- * +- * @parameter + */ ++ @Parameter + private String file; + + /** + * List of files to include for multiple (or single) replacement. + * In Ant format (*\/directory/**.properties) + * Cannot use with outputFile. +- * +- * @parameter + */ ++ @Parameter + private List includes = new ArrayList(); + + /** + * List of files to exclude for multiple (or single) replacement. + * In Ant format (*\/directory/**.properties) + * Cannot use with outputFile. +- * +- * @parameter + */ ++ @Parameter + private List excludes = new ArrayList(); + + /** +@@ -75,9 +68,8 @@ public class ReplacerMojo extends AbstractMojo { + * This is split up and used the same way a array of includes would be. + * In Ant format (*\/directory/**.properties). + * Files not found are ignored by default. +- * +- * @parameter + */ ++ @Parameter + private String filesToInclude; + + /** +@@ -85,27 +77,24 @@ public class ReplacerMojo extends AbstractMojo { + * This is split up and used the same way a array of excludes would be. + * In Ant format (**\/directory/do-not-replace.properties). + * The files replaced will be derived from the list of includes and excludes. +- * +- * @parameter + */ ++ @Parameter + private String filesToExclude; + + /** + * Token to replace. + * The text to replace within the given file. + * This may or may not be a regular expression (see regex notes above). +- * +- * @parameter + */ ++ @Parameter + private String token; + + /** + * Token file containing a token to be replaced in the target file/s. + * May be multiple words or lines. + * This is useful if you do not wish to expose the token within your pom or the token is long. +- * +- * @parameter + */ ++ @Parameter + private String tokenFile; + + /** +@@ -113,9 +102,8 @@ public class ReplacerMojo extends AbstractMojo { + * Use only with file configuration (not includes etc). + * Set to true to not fail build if the file is not found. + * First checks if file exists and exits without attempting to replace anything. +- * +- * @parameter + */ ++ @Parameter + private boolean ignoreMissingFile; + + /** +@@ -123,26 +111,23 @@ public class ReplacerMojo extends AbstractMojo { + * The text to be written over any found tokens. + * If no value is given, the tokens found are replaced with an empty string (effectively removing any tokens found). + * You can also reference grouped regex matches made in the token here by $1, $2, etc. +- * +- * @parameter + */ ++ @Parameter + private String value; + + /** + * A file containing a value to replace the given token with. + * May be multiple words or lines. + * This is useful if you do not wish to expose the value within your pom or the value is long. +- * +- * @parameter + */ ++ @Parameter + private String valueFile; + + /** + * Indicates if the token should be located with regular expressions. + * This should be set to false if the token contains regex characters which may miss the desired tokens or even replace the wrong tokens. +- * +- * @parameter + */ ++ @Parameter + private boolean regex = true; + + /** +@@ -151,18 +136,16 @@ public class ReplacerMojo extends AbstractMojo { + * The path and file are created if it does not exist. + * If it does exist, the contents are overwritten. + * You should not use outputFile when using a list of includes. +- * +- * @parameter + */ ++ @Parameter + private String outputFile; + + /** + * Output to another dir. + * Destination directory relative to the execution directory for all replaced files to be written to. + * Use with outputDir to have files written to a specific base location. +- * +- * @parameter + */ ++ @Parameter + private String outputDir; + + /** +@@ -171,9 +154,8 @@ public class ReplacerMojo extends AbstractMojo { + * This file may contain multiple entries to support a single file containing different tokens to have replaced. + * Each token/value pair should be in the format: "token=value" (without quotations). + * If your token contains ='s you must escape the = character to \=. e.g. tok\=en=value +- * +- * @parameter + */ ++ @Parameter + private String tokenValueMap; + + /** +@@ -181,9 +163,8 @@ public class ReplacerMojo extends AbstractMojo { + * Path to base relative files for replacements from. + * This feature is useful for multi-module projects. + * Default "." which is the default Maven basedir. +- * +- * @parameter default-value="." + */ ++ @Parameter(defaultValue = ".") + private String basedir = "."; + + /** +@@ -197,18 +178,16 @@ public class ReplacerMojo extends AbstractMojo { + * * MULTILINE + * * UNICODE_CASE + * * UNIX_LINES +- * +- * @parameter + */ ++ @Parameter + private List regexFlags; + + /** + * List of replacements with token/value pairs. + * Each replacement element to contain sub-elements as token/value pairs. + * Each token within the given file will be replaced by it's respective value. +- * +- * @parameter + */ ++ @Parameter + private List replacements; + + /** +@@ -216,52 +195,46 @@ public class ReplacerMojo extends AbstractMojo { + * Comment lines start with '#'. + * If your token starts with an '#' then you must supply the commentsEnabled parameter and with a value of false. + * Default is true. +- * +- * @parameter default-value="true" + */ ++ @Parameter(defaultValue = "true") + private boolean commentsEnabled = true; + + /** + * Skip running this plugin. + * Default is false. +- * +- * @parameter default-value="false" + */ ++ @Parameter(defaultValue = "false") + private boolean skip = false; + + /** + * Base directory (appended) to use for outputDir. + * Having this existing but blank will cause the outputDir + * to be based on the execution directory. +- * +- * @parameter + */ ++ @Parameter + private String outputBasedir; + + /** + * Parent directory is preserved when replacing files found from includes and + * being written to an outputDir. + * Default is true. +- * +- * @parameter default-value="true" + */ ++ @Parameter(defaultValue = "true") + private boolean preserveDir = true; + + /** + * Stops printing a summary of files that have had replacements performed upon them when true. + * Default is false. +- * +- * @parameter default-value="false" + */ ++ @Parameter(defaultValue = "false") + private boolean quiet = false; + + /** + * Unescape tokens and values to Java format. + * e.g. token\n is unescaped to token(carriage return). + * Default is false. +- * +- * @parameter default-value="false" + */ ++ @Parameter(defaultValue = "false") + private boolean unescape; + + /** +@@ -269,9 +242,8 @@ public class ReplacerMojo extends AbstractMojo { + * You may also use the '' character to place the token in the desired location for matching. + * e.g. @ would match @token@. + * e.g. ${} would match ${token}. +- * +- * @parameter + */ ++ @Parameter + private List delimiters = new ArrayList(); + + /** +@@ -280,9 +252,8 @@ public class ReplacerMojo extends AbstractMojo { + * This parameter may contain multiple entries to support a single file containing different tokens to have replaced. + * Format is comma separated. e.g. token=value,token2=value2 + * Comments are not supported. +- * +- * @parameter + */ ++ @Parameter + private String variableTokenValueMap; + + /** +@@ -293,34 +264,30 @@ public class ReplacerMojo extends AbstractMojo { + * Only usable with file parameter. + * + * Default is false. +- * +- * @parameter default-value="false" + */ ++ @Parameter(defaultValue = "false") + private boolean ignoreErrors; + + /** + * X-Path expression for locating node's whose content you wish to replace. + * This is useful if you have the same token appearing in many nodes but + * wish to only replace the contents of one or more of them. +- * +- * @parameter + */ ++ @Parameter + private String xpath; + + /** + * File encoding used when reading and writing files. + * Default system encoding used when not specified. +- * +- * @parameter default-value="${project.build.sourceEncoding}" + */ ++ @Parameter(defaultValue = "${project.build.sourceEncoding}") + private String encoding; + + /** + * Regular expression is run on an input file's name to create the output file with. + * Must be used in conjunction with outputFilePattern. +- * +- * @parameter + */ ++ @Parameter + private String inputFilePattern; + + /** +@@ -328,30 +295,26 @@ public class ReplacerMojo extends AbstractMojo { + * Must be used in conjunction with inputFilePattern. + * + * The parameter outputFile is ignored when outputFilePattern is used. +- * +- * @parameter + */ ++ @Parameter + private String outputFilePattern; + + /** + * Set a maximum number of files which can be replaced per execution. +- * +- * @parameter + */ ++ @Parameter + private Integer maxReplacements = Integer.MAX_VALUE; + + /** + * list files +- * +- * @parameter + */ ++ @Parameter + private List files = new ArrayList(); + + /** + * list out put file +- * +- * @parameter + */ ++ @Parameter + private List outputFiles = new ArrayList(); + + public ReplacerMojo() { +-- +2.41.0 + diff --git a/SPECS/replacer.spec b/SPECS/replacer.spec new file mode 100644 index 0000000..f78aa19 --- /dev/null +++ b/SPECS/replacer.spec @@ -0,0 +1,190 @@ +Name: replacer +Version: 1.6 +Release: 31%{?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 +Patch0: 0001-Port-to-maven-plugin-annotations-from-Javadoc-tags.patch + +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.plugin-tools:maven-plugin-annotations) +BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin) +BuildRequires: mvn(xerces:xercesImpl) + +BuildArch: noarch +ExclusiveArch: %{java_arches} 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} +%patch 0 -p1 + +# 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 + +# trivial port to commons-lang3 +%pom_change_dep :commons-lang org.apache.commons:commons-lang3:3.8.1 + +# "No mojo definitions were found for plugin" with maven-plugin-plugin 3.9 +%pom_xpath_inject "pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-plugin-plugin']" \ + 'true' + +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 +* Fri Aug 09 2024 Marián Konček - 1.6-31 +- Rebuild without generated Requires + +* Mon Jun 24 2024 Troy Dawson - 1.6-30 +- Bump release for June 2024 mass rebuild + +* Fri Feb 09 2024 Mikolaj Izdebski - 1.6-29 +- Port to maven-plugin-annotations from Javadoc tags + +* Fri Jan 26 2024 Fedora Release Engineering - 1.6-28 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 22 2024 Fedora Release Engineering - 1.6-27 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jul 21 2023 Fedora Release Engineering - 1.6-26 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Fri Jan 20 2023 Fedora Release Engineering - 1.6-25 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Sat Jul 23 2022 Fedora Release Engineering - 1.6-24 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Fri Jul 08 2022 Jiri Vanek - 1.6-23 +- Rebuilt for Drop i686 JDKs + +* Sat Feb 05 2022 Jiri Vanek - 1.6-22 +- Rebuilt for java-17-openjdk as system jdk + +* Fri Jan 21 2022 Fedora Release Engineering - 1.6-21 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Jul 23 2021 Fedora Release Engineering - 1.6-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Wed May 12 2021 Ondrej Dubaj - 1.6-19 +- Remove maven-javadoc-plugin dependency + +* Wed Jan 27 2021 Fedora Release Engineering - 1.6-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Thu Jul 30 2020 Fabio Valentini - 1.6-17 +- Port to commons-lang3. + +* Wed Jul 29 2020 Fedora Release Engineering - 1.6-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Sat Jul 11 2020 Jiri Vanek - 1.6-15 +- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11 + +* Fri Jun 26 2020 Mat Booth - 1.6-14 +- Allow building against Java 11 + +* Thu Jan 30 2020 Fedora Release Engineering - 1.6-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Nov 22 2019 Fabio Valentini - 1.6-12 +- Remove unnecessary dependency on parent POM. + +* Fri Jul 26 2019 Fedora Release Engineering - 1.6-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Thu Apr 18 2019 Mat Booth - 1.6-10 +- Disable tests to reduce dependency tree + +* Wed Feb 13 2019 Mat Booth - 1.6-9 +- Fix build against mockito 2.x + +* Sat Feb 02 2019 Fedora Release Engineering - 1.6-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sat Jul 14 2018 Fedora Release Engineering - 1.6-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Fri Feb 09 2018 Fedora Release Engineering - 1.6-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 1.6-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 1.6-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Feb 04 2016 Fedora Release Engineering - 1.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Jun 18 2015 Fedora Release Engineering - 1.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Tue Mar 17 2015 gil cattaneo 1.6-1 +- update to 1.6 +- fix Url tag and Source0 tag + +* Wed Feb 11 2015 gil cattaneo 1.5.3-2 +- introduce license macro + +* Thu Jul 03 2014 gil cattaneo 1.5.3-1 +- update to 1.5.3 + +* Sun Jun 08 2014 Fedora Release Engineering - 1.5.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Fri Mar 28 2014 Michael Simacek - 1.5.2-4 +- Use Requires: java-headless rebuild (#1067528) + +* Sun Aug 04 2013 Fedora Release Engineering - 1.5.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Wed Jul 03 2013 gil cattaneo 1.5.2-2 +- switch to XMvn +- minor changes to adapt to current guideline + +* Sun May 26 2013 gil cattaneo 1.5.2-1 +- initial rpm