package init

This commit is contained in:
wangxiao65 2020-08-25 14:18:03 +08:00
parent 1f42424190
commit 0dfd75a5de
5 changed files with 118 additions and 0 deletions

View File

@ -0,0 +1,25 @@
From aa0c713f3b8363f4c7781ed5aec52ad0bf607508 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Mon, 30 Mar 2015 15:40:16 +0200
Subject: [PATCH 1/2] Port to current plexus-utils
---
src/main/java/kr/motd/maven/os/DetectExtension.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/kr/motd/maven/os/DetectExtension.java b/src/main/java/kr/motd/maven/os/DetectExtension.java
index 88c5e61..9ebe6dd 100644
--- a/src/main/java/kr/motd/maven/os/DetectExtension.java
+++ b/src/main/java/kr/motd/maven/os/DetectExtension.java
@@ -180,7 +180,7 @@ public class DetectExtension extends AbstractMavenLifecycleParticipant {
break;
}
- InterpolationFilterReader reader = new InterpolationFilterReader(new StringReader(value), dict);
+ InterpolationFilterReader reader = new InterpolationFilterReader(new StringReader(value), (Map)dict);
StringWriter writer = new StringWriter(value.length());
for (;;) {
int ch = 0;
--
2.1.0

View File

@ -0,0 +1,25 @@
From b11d31e037120c3ee761276574f408005a78f632 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Wed, 15 Jul 2015 18:39:46 +0200
Subject: [PATCH 2/2] Don't fail on unknown arch
---
src/main/java/kr/motd/maven/os/Detector.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/kr/motd/maven/os/Detector.java b/src/main/java/kr/motd/maven/os/Detector.java
index 9dd6688..37ced72 100644
--- a/src/main/java/kr/motd/maven/os/Detector.java
+++ b/src/main/java/kr/motd/maven/os/Detector.java
@@ -46,7 +46,7 @@ public abstract class Detector {
setProperty(props, DETECTED_CLASSIFIER, detectedClassifier);
final String failOnUnknownOS = allProps.getProperty("failOnUnknownOS");
- if (failOnUnknownOS == null || !failOnUnknownOS.equalsIgnoreCase("false")) {
+ if (failOnUnknownOS != null && failOnUnknownOS.equalsIgnoreCase("true")) {
if (UNKNOWN.equals(detectedName)) {
throw new DetectionException("unknown os.name: " + osName);
}
--
2.1.0

Binary file not shown.

63
os-maven-plugin.spec Normal file
View File

@ -0,0 +1,63 @@
%global vertag Final
Name: os-maven-plugin
Version: 1.2.3
Release: 1
Summary: Maven plugin for generating platform-dependent properties
License: ASL 2.0
URL: https://github.com/trustin/os-maven-plugin/
BuildArch: noarch
Source0: https://github.com/trustin/%{name}/archive/%{name}-%{version}.Final.tar.gz
Patch0: 0001-Port-to-current-plexus-utils.patch
BuildRequires: maven-local mvn(junit:junit) mvn(org.apache.maven:maven-core)
BuildRequires: mvn(org.apache.maven:maven-plugin-api)
BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin)
BuildRequires: mvn(org.apache.maven.plugin-tools:maven-plugin-annotations)
BuildRequires: mvn(org.codehaus.plexus:plexus-component-metadata)
BuildRequires: mvn(org.codehaus.plexus:plexus-utils) mvn(org.sonatype.oss:oss-parent:pom:)
%description
os-maven-plugin is a Maven extension/plugin that generates various
useful platform-dependent project properties normalized from
${os.name} and ${os.arch}.
${os.name} and ${os.arch} are often subtly different between JVM and
operating system versions or they sometimes contain machine-unfriendly
characters such as whitespaces. This plugin tries to remove such
fragmentation so that you can determine the current operating system
and architecture reliably.
%package javadoc
Summary: API documentation for %{name}
%description javadoc
This package provides %{summary}.
%prep
%autosetup -n %{name}-%{name}-%{version}.%{vertag} -p1
# Remove Eclipse plugin (not needed in Fedora)
%pom_remove_dep org.eclipse:ui
%pom_remove_plugin :maven-jar-plugin
find -name EclipseStartup.java -delete
find -name plugin.xml -delete
%build
%mvn_build
%install
%mvn_install
%files -f .mfiles
%dir %{_javadir}/%{name}
%dir %{_mavenpomdir}/%{name}
%doc LICENSE.txt
%files javadoc -f .mfiles-javadoc
%doc LICENSE.txt
%changelog
* Wed Jul 29 2020 wangxiao <wangxiao65@huawei.com> - 1.2.3-1
- package init

5
os-maven-plugin.yaml Normal file
View File

@ -0,0 +1,5 @@
git_url: https://github.com/trustin/os-maven-plugin
version_control: github
src_repo: trustin/os-maven-plugin
tag_prefix: "os-maven-plugin-"
seperator: "."