Add fully qualified osgi version to install plan when tycho detected

- Resolves: rhbz#1172225
This commit is contained in:
Michal Srb 2014-12-10 15:27:21 +01:00
parent 27e6857c01
commit e4f3810306
2 changed files with 69 additions and 1 deletions

View File

@ -0,0 +1,62 @@
From de6669c12a7e9bf8a9a813b2423e9c39179d64e5 Mon Sep 17 00:00:00 2001
From: Mat Booth <mat.booth@redhat.com>
Date: Tue, 9 Dec 2014 16:24:57 +0000
Subject: [PATCH] Add fully qualified osgi version to install plan when tycho
detected.
---
.../main/java/org/fedoraproject/xmvn/mojo/InstallMojo.java | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/xmvn-mojo/src/main/java/org/fedoraproject/xmvn/mojo/InstallMojo.java b/xmvn-mojo/src/main/java/org/fedoraproject/xmvn/mojo/InstallMojo.java
index b59ae8b..ee2dafd 100644
--- a/xmvn-mojo/src/main/java/org/fedoraproject/xmvn/mojo/InstallMojo.java
+++ b/xmvn-mojo/src/main/java/org/fedoraproject/xmvn/mojo/InstallMojo.java
@@ -140,13 +140,16 @@ public class InstallMojo
}
}
- private void deployArtifact( Artifact artifact, String type, Model model )
+ private void deployArtifact( Artifact artifact, String type, MavenProject project )
throws MojoExecutionException
{
+ Model model = project.getModel();
DeploymentRequest request = new DeploymentRequest();
request.setArtifact( artifact );
if ( type != null )
request.addProperty( "type", type );
+ if ( isTychoProject(project) )
+ request.addProperty( "qualifiedVersion", model.getProperties().getProperty( "qualifiedVersion" ) );
for ( Dependency dependency : model.getDependencies() )
{
@@ -192,7 +195,7 @@ public class InstallMojo
String type = project.getPackaging();
if ( mainArtifactPath != null )
- deployArtifact( mainArtifact, type, project.getModel() );
+ deployArtifact( mainArtifact, type, project );
Artifact rawPomArtifact =
new DefaultArtifact( mainArtifact.getGroupId(), mainArtifact.getArtifactId(), "pom",
@@ -201,7 +204,7 @@ public class InstallMojo
Path rawPomPath = rawPomFile != null ? rawPomFile.toPath() : null;
logger.debug( "Raw POM path: {}", rawPomPath );
rawPomArtifact = rawPomArtifact.setPath( rawPomPath );
- deployArtifact( rawPomArtifact, type, project.getModel() );
+ deployArtifact( rawPomArtifact, type, project );
Set<Artifact> attachedArtifacts = new LinkedHashSet<>();
for ( org.apache.maven.artifact.Artifact mavenArtifact : project.getAttachedArtifacts() )
@@ -220,7 +223,7 @@ public class InstallMojo
continue;
}
- deployArtifact( attachedArtifact, type, project.getModel() );
+ deployArtifact( attachedArtifact, type, project );
}
}
}
--
1.9.3

View File

@ -4,7 +4,7 @@
Name: xmvn
Version: 2.1.0
Release: 7%{?dist}
Release: 8%{?dist}
Summary: Local Extensions for Apache Maven
License: ASL 2.0
URL: http://mizdebsk.fedorapeople.org/xmvn
@ -17,6 +17,7 @@ Patch1: 0002-Fix-installation-of-attached-Eclipse-artifacts.patch
Patch2: 0003-Fix-conversion-of-Ivy-to-XMvn-artifacts.patch
Patch3: 0004-Use-topmost-repository-namespace-during-installation.patch
Patch4: 0005-Ignore-any-system-dependencies-in-Tycho-projects.patch
Patch5: 0006-Add-fully-qualified-osgi-version-to-install-plan-whe.patch
BuildRequires: maven >= 3.2.1-10
BuildRequires: maven-local
@ -151,6 +152,7 @@ This package provides %{summary}.
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%mvn_package :xmvn __noinstall
@ -300,6 +302,10 @@ end
%doc LICENSE NOTICE
%changelog
* Wed Dec 10 2014 Michal Srb <msrb@redhat.com> - 2.1.0-8
- Add fully qualified osgi version to install plan when tycho detected
- Resolves: rhbz#1172225
* Thu Dec 4 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 2.1.0-7
- Ignore any system dependencies in Tycho projects