Return-Path: X-Original-To: apmail-karaf-issues-archive@minotaur.apache.org Delivered-To: apmail-karaf-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6602317C18 for ; Wed, 5 Nov 2014 15:49:36 +0000 (UTC) Received: (qmail 20703 invoked by uid 500); 5 Nov 2014 15:49:35 -0000 Delivered-To: apmail-karaf-issues-archive@karaf.apache.org Received: (qmail 20678 invoked by uid 500); 5 Nov 2014 15:49:35 -0000 Mailing-List: contact issues-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list issues@karaf.apache.org Received: (qmail 20567 invoked by uid 99); 5 Nov 2014 15:49:35 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Nov 2014 15:49:35 +0000 Date: Wed, 5 Nov 2014 15:49:35 +0000 (UTC) From: =?utf-8?Q?Jean-Baptiste_Onofr=C3=A9_=28JIRA=29?= To: issues@karaf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (KARAF-3347) 'LATEST' placeholder is not resolved correctly for descriptors and repositories MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/KARAF-3347?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Jean-Baptiste Onofr=C3=A9 updated KARAF-3347: ---------------------------------------- Fix Version/s: 3.0.3 4.0.0 > 'LATEST' placeholder is not resolved correctly for descriptors and reposi= tories > -------------------------------------------------------------------------= ------ > > Key: KARAF-3347 > URL: https://issues.apache.org/jira/browse/KARAF-3347 > Project: Karaf > Issue Type: Bug > Components: karaf-tooling > Affects Versions: 3.0.2 > Reporter: Achim Finke > Assignee: Jean-Baptiste Onofr=C3=A9 > Fix For: 4.0.0, 3.0.3 > > > I slightly modified Karaf's standard feature to give you an idea about th= e configuration leading to faults (see inline comments). > {code:xml} > > > > org.apache.karaf.tooling > karaf-maven-plugin > 3.0.2 > true > > > features-add-to-repo > generate-resources > > features-add-to-repository > > > > <-- LATEST won't work for descriptors.--> > mvn:org.apache.karaf.features/sta= ndard-mod/LATEST/xml/features > > > http > > > > > > > > {code} > {code:xml} > > > mvn:org.ops4j.pax.web/pax-web-features/LATEST/xml/feature= s > > pax-http > > mvn:org.apache.karaf.http/org.apache.k= araf.http.core/LATEST=20 > mvn:org.apache.karaf.http/org.apache.k= araf.http.command/LATEST > > > {code} > I debugged into the Plugin and saw that the version information are alrea= dy available via the previously resolved descriptor but not taken when buil= ding the repoURI.=20 > In a first attempt i adjusted the uri using the descriptor which made 'LA= TEST' work. > {code:title=3DAbstractFeatureMojo.java|borderStyle=3Dsolid} > protected void retrieveDescriptorsRecursively(String uri, Set bun= dles, Map featuresMap) { > Artifact descriptor; > try { > descriptor =3D resourceToArtifact(uri, true); > } catch (MojoExecutionException e) { > throw new RuntimeException(e.getMessage(), e); > } > if (descriptor !=3D null) { > // descriptor is resolved via Maven resolver ('latest'-Placeholde= r is replaced) > resolveArtifact(descriptor, remoteRepos); > descriptorArtifacts.add(descriptor); > // adjust uri with version information from descriptor as URI is = not resolved in the process (see subsequent comment) > uri =3D uri.toLowerCase(); > uri =3D uri.replace("/latest/", "/" + descriptor.getBaseVersion()= + "/"); > } > if (includeMvnBasedDescriptors) { > bundles.add(uri); > } > // translateFromMaven-Method just parses URI into the right format, i= t does not any resolving ('latest'-Placeholder won't be replaced) > URI repoURI =3D URI.create(translateFromMaven(uri.replaceAll(" ", "%2= 0"))); > Repository repo =3D new Repository(repoURI, defaultStartLevel); > for (Feature f : repo.getFeatures()) { > featuresMap.put(f.getName() + "/" + f.getVersion(), f); > } > if (resolveDefinedRepositoriesRecursively) { > for (String r : repo.getDefinedRepositories()) { > retrieveDescriptorsRecursively(r, bundles, featuresMap); > } > } > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)