From 5f0f939bf30eb11973a152dc3adb3a51b6fdb08509808f1d096eb1af74bc07e7 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Tue, 8 Oct 2019 05:36:45 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-jar-plugin?expand=0&rev=12 --- 01-allow-replacing-artifacts.patch | 16 ++++++++++++++++ maven-jar-plugin.changes | 7 +++++++ maven-jar-plugin.spec | 2 ++ 3 files changed, 25 insertions(+) create mode 100644 01-allow-replacing-artifacts.patch diff --git a/01-allow-replacing-artifacts.patch b/01-allow-replacing-artifacts.patch new file mode 100644 index 0000000..ab47475 --- /dev/null +++ b/01-allow-replacing-artifacts.patch @@ -0,0 +1,16 @@ +Description: Display a warning instead of failing the build if the plugin + is misconfigured and attempts to attach twice the same artifact. +Author: Emmanuel Bourg +Forwarded: no +Bug: https://issues.apache.org/jira/browse/MJAR-198 +--- a/src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java ++++ b/src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java +@@ -300,7 +300,7 @@ + { + if ( projectHasAlreadySetAnArtifact() ) + { +- throw new MojoExecutionException( "You have to use a classifier " ++ getLog().warn( "You have to use a classifier " + + "to attach supplemental artifacts to the project instead of replacing them." ); + } + getProject().getArtifact().setFile( jarFile ); diff --git a/maven-jar-plugin.changes b/maven-jar-plugin.changes index db4f015..295a47c 100644 --- a/maven-jar-plugin.changes +++ b/maven-jar-plugin.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Oct 8 05:35:17 UTC 2019 - Fridrich Strba + +- Added patch: + * 01-allow-replacing-artifacts.patch + + Warn but do not fail with misconfigured plugin + ------------------------------------------------------------------- Mon Apr 1 05:41:53 UTC 2019 - Fridrich Strba diff --git a/maven-jar-plugin.spec b/maven-jar-plugin.spec index aef7604..fd6395a 100644 --- a/maven-jar-plugin.spec +++ b/maven-jar-plugin.spec @@ -32,6 +32,7 @@ URL: http://maven.apache.org/plugins/maven-jar-plugin/ Source0: http://repo2.maven.org/maven2/org/apache/maven/plugins/%{base_name}/%{version}/%{base_name}-%{version}-source-release.zip Source1: %{base_name}-build.xml Patch0: %{base_name}-bootstrap-resources.patch +Patch1: 01-allow-replacing-artifacts.patch BuildRequires: fdupes BuildRequires: javapackages-local BuildRequires: maven-archiver @@ -86,6 +87,7 @@ API documentation for %{name}. cp %{SOURCE1} build.xml %patch0 -p1 %endif +%patch1 -p1 %build # Test class MockArtifact doesn't override method getMetadata