Update to upstream version 2.5.0

This commit is contained in:
Mikolaj Izdebski 2015-10-28 18:13:40 +01:00
parent 179bf29916
commit 2d9f8a07f2
7 changed files with 10 additions and 198 deletions

1
.gitignore vendored
View File

@ -40,3 +40,4 @@
/xmvn-2.3.1.tar.xz
/xmvn-2.3.2.tar.xz
/xmvn-2.4.0.tar.xz
/xmvn-2.5.0.tar.xz

View File

@ -1,25 +0,0 @@
From 47e01b8dc3b41ef1e56de14d15672aaab43364c9 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Mon, 11 May 2015 15:52:58 +0200
Subject: [PATCH 1/4] Fix NPE in DefaultResolver
---
.../main/java/org/fedoraproject/xmvn/resolver/impl/DefaultResolver.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xmvn-core/src/main/java/org/fedoraproject/xmvn/resolver/impl/DefaultResolver.java b/xmvn-core/src/main/java/org/fedoraproject/xmvn/resolver/impl/DefaultResolver.java
index fdf79cf..6c0caf6 100644
--- a/xmvn-core/src/main/java/org/fedoraproject/xmvn/resolver/impl/DefaultResolver.java
+++ b/xmvn-core/src/main/java/org/fedoraproject/xmvn/resolver/impl/DefaultResolver.java
@@ -144,7 +144,7 @@ public class DefaultResolver
catch ( IOException e )
{
logger.warn( "Failed to generate effective POM", e );
- metadata = null;
+ return new DefaultResolutionResult();
}
}
--
2.1.0

View File

@ -1,27 +0,0 @@
From 9d9057fb17aa05bcf7df5717b1594eb14cb201e0 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Mon, 11 May 2015 16:05:16 +0200
Subject: [PATCH 2/4] Prevent slashes from sneaking into artifact filename
---
.../org/fedoraproject/xmvn/resolver/impl/EffectivePomGenerator.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/xmvn-core/src/main/java/org/fedoraproject/xmvn/resolver/impl/EffectivePomGenerator.java b/xmvn-core/src/main/java/org/fedoraproject/xmvn/resolver/impl/EffectivePomGenerator.java
index 4fdab3a..ffc67ed 100644
--- a/xmvn-core/src/main/java/org/fedoraproject/xmvn/resolver/impl/EffectivePomGenerator.java
+++ b/xmvn-core/src/main/java/org/fedoraproject/xmvn/resolver/impl/EffectivePomGenerator.java
@@ -116,7 +116,9 @@ class EffectivePomGenerator
public Path generateEffectivePom( ArtifactMetadata metadata, Artifact artifact )
throws IOException
{
- String artifactFileName = artifact.getArtifactId() + "-" + artifact.getVersion() + ".pom";
+ String artifactIdNormalized = artifact.getArtifactId().replace( '/', '.' );
+ String versionNormalized = artifact.getVersion().replace( '/', '.' );
+ String artifactFileName = artifactIdNormalized + "-" + versionNormalized + ".pom";
Path pomDir = TempManager.createTempDirectory( "xmvn-" + metadata.getUuid() );
Path pomPath = pomDir.resolve( artifactFileName );
--
2.1.0

View File

@ -1,98 +0,0 @@
From 5c535ce7077d063115165e528d1b0a3eb7d12677 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Tue, 30 Jun 2015 20:10:18 +0200
Subject: [PATCH 3/4] Port to Gradle 2.5-rc-1
---
.../xmvn/connector/gradle/GradleResolver.java | 20 +++++++++++---------
xmvn-parent/pom.xml | 2 +-
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/xmvn-connector-gradle/src/main/java/org/fedoraproject/xmvn/connector/gradle/GradleResolver.java b/xmvn-connector-gradle/src/main/java/org/fedoraproject/xmvn/connector/gradle/GradleResolver.java
index 5fa7996..bf4aaff 100644
--- a/xmvn-connector-gradle/src/main/java/org/fedoraproject/xmvn/connector/gradle/GradleResolver.java
+++ b/xmvn-connector-gradle/src/main/java/org/fedoraproject/xmvn/connector/gradle/GradleResolver.java
@@ -37,6 +37,7 @@ import org.gradle.internal.component.external.model.DefaultModuleComponentArtifa
import org.gradle.internal.component.external.model.ModuleComponentResolveMetaData;
import org.gradle.internal.component.external.model.MutableModuleComponentResolveMetaData;
import org.gradle.internal.component.model.ComponentArtifactMetaData;
+import org.gradle.internal.component.model.ComponentOverrideMetadata;
import org.gradle.internal.component.model.ComponentResolveMetaData;
import org.gradle.internal.component.model.ComponentUsage;
import org.gradle.internal.component.model.DefaultIvyArtifactName;
@@ -184,7 +185,7 @@ public class GradleResolver
}
@Override
- public void resolveComponentMetaData( DependencyMetaData dependency, ModuleComponentIdentifier id,
+ public void resolveComponentMetaData( ModuleComponentIdentifier id, ComponentOverrideMetadata request,
BuildableModuleComponentMetaDataResolveResult result )
{
logger.debug( "Trying to resolve model for {}:{}:{}", id.getGroup(), id.getModule(), id.getVersion() );
@@ -206,7 +207,7 @@ public class GradleResolver
else
{
logger.debug( "POM not found, trying non-POM artifacts" );
- for ( IvyArtifactName artifact : getDependencyArtifactNames( dependency ) )
+ for ( IvyArtifactName artifact : getDependencyArtifactNames( id, request ) )
{
String groupId = id.getGroup();
String artifactId = artifact.getName();
@@ -220,7 +221,8 @@ public class GradleResolver
if ( path != null )
{
logger.debug( "Artifact {} found, returning minimal model", artifact3 );
- MutableModuleComponentResolveMetaData metaData = new DefaultMavenModuleResolveMetaData( dependency );
+ MutableModuleComponentResolveMetaData metaData =
+ new DefaultMavenModuleResolveMetaData( id, request.getArtifacts() );
result.resolved( metaData );
return;
}
@@ -231,15 +233,15 @@ public class GradleResolver
result.failed( new ModuleVersionResolveException( id, "XMvn was unable to resolve artifact " + artifact2 ) );
}
- private Set<IvyArtifactName> getDependencyArtifactNames( DependencyMetaData dependency )
+ private Set<IvyArtifactName> getDependencyArtifactNames( ModuleComponentIdentifier id,
+ ComponentOverrideMetadata request )
{
- String moduleName = dependency.getRequested().getName();
Set<IvyArtifactName> artifactSet = new LinkedHashSet<>();
- artifactSet.addAll( dependency.getArtifacts() );
+ artifactSet.addAll( request.getArtifacts() );
if ( artifactSet.isEmpty() )
{
- artifactSet.add( new DefaultIvyArtifactName( moduleName, "jar", "jar",
+ artifactSet.add( new DefaultIvyArtifactName( id.getModule(), "jar", "jar",
Collections.<String, String> emptyMap() ) );
}
@@ -273,9 +275,9 @@ public class GradleResolver
}
@Override
- public LocallyAvailableExternalResource getMetaDataArtifact( ModuleVersionIdentifier id, ArtifactType type )
+ public LocallyAvailableExternalResource getMetaDataArtifact( ModuleComponentIdentifier id, ArtifactType type )
{
- Path pomPath = resolve( new DefaultArtifact( id.getGroup(), id.getName(), "pom", id.getVersion() ) );
+ Path pomPath = resolve( new DefaultArtifact( id.getGroup(), id.getModule(), "pom", id.getVersion() ) );
if ( pomPath == null )
return null;
diff --git a/xmvn-parent/pom.xml b/xmvn-parent/pom.xml
index 251d696..047665e 100644
--- a/xmvn-parent/pom.xml
+++ b/xmvn-parent/pom.xml
@@ -79,7 +79,7 @@
<atinjectVersion>1</atinjectVersion>
<ivyVersion>2.4.0</ivyVersion>
<jcommanderVersion>1.48</jcommanderVersion>
- <gradleVersion>2.4-rc-1</gradleVersion>
+ <gradleVersion>2.5-rc-1</gradleVersion>
<guiceVersion>3.2.5</guiceVersion>
<guavaVersion>18.0</guavaVersion>
<mavenInvokerVersion>2.2</mavenInvokerVersion>
--
2.1.0

View File

@ -1,24 +0,0 @@
From 0fe0c958cc53958f00097a3c8f2994e7e718ab83 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Tue, 14 Jul 2015 17:32:42 +0200
Subject: [PATCH 4/4] Require persistent artifact files in XML resolver API
---
.../org/fedoraproject/xmvn/tools/resolve/xml/ResolutionRequestBean.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/xmvn-tools/xmvn-resolve/src/main/java/org/fedoraproject/xmvn/tools/resolve/xml/ResolutionRequestBean.java b/xmvn-tools/xmvn-resolve/src/main/java/org/fedoraproject/xmvn/tools/resolve/xml/ResolutionRequestBean.java
index 56de47d..0393dcc 100644
--- a/xmvn-tools/xmvn-resolve/src/main/java/org/fedoraproject/xmvn/tools/resolve/xml/ResolutionRequestBean.java
+++ b/xmvn-tools/xmvn-resolve/src/main/java/org/fedoraproject/xmvn/tools/resolve/xml/ResolutionRequestBean.java
@@ -71,6 +71,7 @@ public class ResolutionRequestBean
request.setArtifact( bean.getArtifact() );
request.setProviderNeeded( bean.isProviderNeeded() );
+ request.setPersistentFileNeeded( true );
return request;
}
--
2.1.0

View File

@ -1 +1 @@
1d6019275df79df57ef7e676ebf4fa19 xmvn-2.4.0.tar.xz
00a2b136cded37439222ea8631324fdd xmvn-2.5.0.tar.xz

View File

@ -3,8 +3,8 @@
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^osgi\\($
Name: xmvn
Version: 2.4.0
Release: 5%{?dist}
Version: 2.5.0
Release: 1%{?dist}
Summary: Local Extensions for Apache Maven
License: ASL 2.0
URL: http://mizdebsk.fedorapeople.org/xmvn
@ -12,11 +12,6 @@ BuildArch: noarch
Source0: https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.xz
Patch0: 0001-Fix-NPE-in-DefaultResolver.patch
Patch1: 0002-Prevent-slashes-from-sneaking-into-artifact-filename.patch
Patch2: 0003-Port-to-Gradle-2.5-rc-1.patch
Patch3: 0004-Require-persistent-artifact-files-in-XML-resolver-AP.patch
BuildRequires: maven >= 3.3
BuildRequires: maven-local
BuildRequires: beust-jcommander
@ -24,7 +19,7 @@ BuildRequires: cglib
BuildRequires: maven-dependency-plugin
BuildRequires: maven-plugin-build-helper
BuildRequires: maven-assembly-plugin
BuildRequires: maven-invoker-plugin
BuildRequires: maven-install-plugin
BuildRequires: maven-site-plugin
BuildRequires: objectweb-asm
BuildRequires: modello
@ -155,16 +150,9 @@ This package provides %{summary}.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%mvn_package ":xmvn{,-it}" __noinstall
# In XMvn 2.x xmvn-connector was renamed to xmvn-connector-aether
%mvn_alias :xmvn-connector-aether :xmvn-connector
# remove dependency plugin maven-binaries execution
# we provide apache-maven by symlink
%pom_xpath_remove "pom:executions/pom:execution[pom:id[text()='maven-binaries']]"
@ -175,15 +163,9 @@ mver=$(sed -n '/<mavenVersion>/{s/.*>\(.*\)<.*/\1/;p}' \
mkdir -p target/dependency/
cp -aL %{_datadir}/maven target/dependency/apache-maven-$mver
# skip ITs for now (mix of old & new XMvn config causes issues)
rm -rf src/it
# probably bug in configuration/modello?
sed -i 's|generated-site/resources/xsd/config|generated-site/xsd/config|' xmvn-core/pom.xml
%build
# XXX some tests fail on ARM for unknown reason, see why
%mvn_build -s -f -j
# ITs require artifacts to be insalled in local repo
%mvn_build -s -j -g install
tar --delay-directory-restore -xvf target/*tar.bz2
chmod -R +rwX %{name}-%{version}*
@ -304,6 +286,9 @@ cp -P %{_datadir}/maven/bin/m2.conf %{buildroot}%{_datadir}/%{name}/bin/
%doc LICENSE NOTICE
%changelog
* Wed Oct 28 2015 Mikolaj Izdebski <mizdebsk@redhat.com> - 2.5.0-1
- Update to upstream version 2.5.0
* Tue Jul 14 2015 Mikolaj Izdebski <mizdebsk@redhat.com> - 2.4.0-5
- Require persistent artifact files in XML resolver API