Accepting request 735978 from Java:packages

warn but don't fail with misconfigured plugin

OBS-URL: https://build.opensuse.org/request/show/735978
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/maven-jar-plugin?expand=0&rev=2
This commit is contained in:
Dominique Leuenberger 2019-10-08 17:58:48 +00:00 committed by Git OBS Bridge
commit 761139be34
3 changed files with 25 additions and 0 deletions

View File

@ -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 <ebourg@apache.org>
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 );

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Oct 8 05:35:17 UTC 2019 - Fridrich Strba <fstrba@suse.com>
- 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 <fstrba@suse.com>

View File

@ -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