Update to upstream release 1.3.0

This commit is contained in:
Stanislav Ochotnicky 2013-11-06 13:33:34 +01:00
parent ff02b67831
commit 7d68817c44
5 changed files with 7 additions and 167 deletions

1
.gitignore vendored
View File

@ -27,3 +27,4 @@
/xmvn-1.0.2.tar.xz
/xmvn-1.1.0.tar.xz
/xmvn-1.2.0.tar.xz
/xmvn-1.3.0.tar.xz

View File

@ -1,28 +0,0 @@
From 30a4d3786f2b9ac9b0669db51fbf138a3ee3a674 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Tue, 22 Oct 2013 15:56:45 +0200
Subject: [PATCH] Don't inject manifest if it does not already exist
---
.../org/fedoraproject/maven/installer/impl/DefaultInstaller.java | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/DefaultInstaller.java b/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/DefaultInstaller.java
index f1cf72d..51c2d4e 100644
--- a/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/DefaultInstaller.java
+++ b/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/DefaultInstaller.java
@@ -144,10 +144,7 @@ public class DefaultInstaller
{
Manifest mf = jis.getManifest();
if ( mf == null )
- {
- mf = new Manifest();
- mf.getMainAttributes().putValue( "Manifest-Version", "1.0" );
- }
+ return artifact;
putAttribute( mf, ArtifactUtils.MF_KEY_GROUPID, artifact.getGroupId(), null );
putAttribute( mf, ArtifactUtils.MF_KEY_ARTIFACTID, artifact.getArtifactId(), null );
--
1.8.1.4

View File

@ -1,132 +0,0 @@
From 552733c90772f5e1a698aa6c2bef3cff41dc11a5 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Mon, 7 Oct 2013 16:31:54 +0200
Subject: [PATCH] Take stereotypes into account during dependency extraction
---
.../dependency/impl/BuildDependencyVisitor.java | 16 ++++++----
.../dependency/impl/RuntimeDependencyVisitor.java | 10 +++---
.../fedoraproject/maven/utils/ArtifactUtils.java | 37 ++++++++++++++++++++++
3 files changed, 53 insertions(+), 10 deletions(-)
diff --git a/xmvn-core/src/main/java/org/fedoraproject/maven/dependency/impl/BuildDependencyVisitor.java b/xmvn-core/src/main/java/org/fedoraproject/maven/dependency/impl/BuildDependencyVisitor.java
index 04dff90..0d47850 100644
--- a/xmvn-core/src/main/java/org/fedoraproject/maven/dependency/impl/BuildDependencyVisitor.java
+++ b/xmvn-core/src/main/java/org/fedoraproject/maven/dependency/impl/BuildDependencyVisitor.java
@@ -75,9 +75,11 @@ class BuildDependencyVisitor
if ( !buildScopes.contains( dependency.getScope() ) )
return;
- result.addDependencyArtifact( new DefaultArtifact( dependency.getGroupId(), dependency.getArtifactId(),
- dependency.getClassifier(), dependency.getType(),
- dependency.getVersion() ) );
+ result.addDependencyArtifact( ArtifactUtils.createTypedArtifact( dependency.getGroupId(),
+ dependency.getArtifactId(),
+ dependency.getType(),
+ dependency.getClassifier(),
+ dependency.getVersion() ) );
}
@Override
@@ -111,8 +113,10 @@ class BuildDependencyVisitor
if ( !runtimeScopes.contains( dependency.getScope() ) )
return;
- result.addDependencyArtifact( new DefaultArtifact( dependency.getGroupId(), dependency.getArtifactId(),
- dependency.getClassifier(), dependency.getType(),
- dependency.getVersion() ) );
+ result.addDependencyArtifact( ArtifactUtils.createTypedArtifact( dependency.getGroupId(),
+ dependency.getArtifactId(),
+ dependency.getType(),
+ dependency.getClassifier(),
+ dependency.getVersion() ) );
}
}
diff --git a/xmvn-core/src/main/java/org/fedoraproject/maven/dependency/impl/RuntimeDependencyVisitor.java b/xmvn-core/src/main/java/org/fedoraproject/maven/dependency/impl/RuntimeDependencyVisitor.java
index 6ef22b9..4bcc8ad 100644
--- a/xmvn-core/src/main/java/org/fedoraproject/maven/dependency/impl/RuntimeDependencyVisitor.java
+++ b/xmvn-core/src/main/java/org/fedoraproject/maven/dependency/impl/RuntimeDependencyVisitor.java
@@ -19,8 +19,8 @@ import java.util.Arrays;
import java.util.List;
import org.apache.maven.model.Dependency;
-import org.eclipse.aether.artifact.DefaultArtifact;
import org.fedoraproject.maven.model.AbstractModelVisitor;
+import org.fedoraproject.maven.utils.ArtifactUtils;
/**
* @author Mikolaj Izdebski
@@ -43,8 +43,10 @@ class RuntimeDependencyVisitor
if ( !scopes.contains( dependency.getScope() ) )
return;
- result.addDependencyArtifact( new DefaultArtifact( dependency.getGroupId(), dependency.getArtifactId(),
- dependency.getClassifier(), dependency.getType(),
- dependency.getVersion() ) );
+ result.addDependencyArtifact( ArtifactUtils.createTypedArtifact( dependency.getGroupId(),
+ dependency.getArtifactId(),
+ dependency.getType(),
+ dependency.getClassifier(),
+ dependency.getVersion() ) );
}
}
diff --git a/xmvn-core/src/main/java/org/fedoraproject/maven/utils/ArtifactUtils.java b/xmvn-core/src/main/java/org/fedoraproject/maven/utils/ArtifactUtils.java
index b6ef806..b4a4062 100644
--- a/xmvn-core/src/main/java/org/fedoraproject/maven/utils/ArtifactUtils.java
+++ b/xmvn-core/src/main/java/org/fedoraproject/maven/utils/ArtifactUtils.java
@@ -23,10 +23,13 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.codehaus.plexus.util.xml.pull.XmlSerializer;
import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.ArtifactType;
import org.eclipse.aether.artifact.DefaultArtifact;
+import org.eclipse.aether.artifact.DefaultArtifactType;
/**
* @author Mikolaj Izdebski
@@ -179,4 +182,38 @@ public class ArtifactUtils
Xpp3Dom dom = toXpp3Dom( artifact, tag );
dom.writeToSerializer( namespace, serializer );
}
+
+ private static final Map<String, ArtifactType> stereotypes = new HashMap<>();
+
+ private static void addStereotype( String type, String extension, String classifier )
+ {
+ stereotypes.put( type, new DefaultArtifactType( type, extension, classifier, "java" ) );
+ }
+
+ // The list was taken from MavenRepositorySystemUtils in maven-aether-provider.
+ static
+ {
+ addStereotype( "maven-plugin", "jar", "" );
+ addStereotype( "ejb", "jar", "" );
+ addStereotype( "ejb-client", "jar", "client" );
+ addStereotype( "test-jar", "jar", "tests" );
+ addStereotype( "javadoc", "jar", "javadoc" );
+ addStereotype( "java-source", "jar", "sources" );
+ }
+
+ public static Artifact createTypedArtifact( String groupId, String artifactId, String type, String classifier,
+ String version )
+ {
+ String extension = type;
+
+ ArtifactType artifactType = stereotypes.get( type );
+ if ( artifactType != null )
+ {
+ extension = artifactType.getExtension();
+ if ( StringUtils.isEmpty( classifier ) )
+ classifier = artifactType.getClassifier();
+ }
+
+ return new DefaultArtifact( groupId, artifactId, classifier, extension, version );
+ }
}
--
1.8.3.1

View File

@ -1 +1 @@
7511a7b9a38171e6ebbb04e28be48820 xmvn-1.2.0.tar.xz
deeb6e8256622279f56061755b0bc404 xmvn-1.3.0.tar.xz

View File

@ -1,15 +1,12 @@
Name: xmvn
Version: 1.2.0
Release: 5%{?dist}
Version: 1.3.0
Release: 1%{?dist}
Summary: Local Extensions for Apache Maven
License: ASL 2.0
URL: http://mizdebsk.fedorapeople.org/xmvn
BuildArch: noarch
Source0: https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.xz
# Backported from upstream commit 30a4d37
Patch0001: 0001-Don-t-inject-manifest-if-it-does-not-already-exist.patch
BuildRequires: maven >= 3.1.1-5
BuildRequires: maven-local
BuildRequires: beust-jcommander
@ -36,7 +33,6 @@ This package provides %{summary}.
%prep
%setup -q
%patch0001 -p1
# remove dependency plugin maven-binaries execution
# we provide apache-maven by symlink
@ -147,6 +143,9 @@ end
%doc LICENSE NOTICE
%changelog
* Wed Nov 06 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1.3.0-1
- Update to upstream release 1.3.0
* Tue Nov 5 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.2.0-5
- Require Maven >= 3.1.1-5
- Resolves: rhbz#1014355