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 2FBEF109F9 for ; Tue, 25 Feb 2014 06:19:38 +0000 (UTC) Received: (qmail 14092 invoked by uid 500); 25 Feb 2014 06:19:23 -0000 Delivered-To: apmail-karaf-issues-archive@karaf.apache.org Received: (qmail 13876 invoked by uid 500); 25 Feb 2014 06:19:21 -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 13851 invoked by uid 99); 25 Feb 2014 06:19:19 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Feb 2014 06:19:19 +0000 Date: Tue, 25 Feb 2014 06:19:19 +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] [Commented] (KARAF-334) At startup, Karaf does not support urls like mvn:, obr:. 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-334?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D13911= 291#comment-13911291 ]=20 Jean-Baptiste Onofr=C3=A9 commented on KARAF-334: -------------------------------------------- In K3, etc/startup.properties file now contains mvn URL: mvn\:org.ops4j.base/ops4j-base-lang/1.4.0 =3D 5 mvn\:org.apache.servicemix.bundles/org.apache.servicemix.bundles.junit/3.8.= 2_4 =3D 5 mvn\:biz.aQute.bnd/bndlib/2.1.0 =3D 5 ... What do we do about this Jira ? > At startup, Karaf does not support urls like mvn:, obr:. > -------------------------------------------------------- > > Key: KARAF-334 > URL: https://issues.apache.org/jira/browse/KARAF-334 > Project: Karaf > Issue Type: Improvement > Components: karaf-core > Affects Versions: 2.1.2 > Reporter: Stephane Chomat > Assignee: Guillaume Nodet > Fix For: 3.1.0 > > Attachments: patch-KARAF-334, patch-KARAF-334-karaf-2.1.x, test-k= araf-home.zip > > Original Estimate: 24h > Remaining Estimate: 24h > > At startup, Karafi does not support urls like mvn:, obr:. > Imagine that at level 5 you install the bundle pax-url-mvn with karaf.aut= o.start.5 =3D "file: pax-url-mvn.jar | pax-url-mvn"=20 > and then at level 10 you install mvn:. ... With karaf.auto.start.10 =3D "= mvn :....| ...." > At the level 6 the url handler 'mvn' is available and you can use it. > This feature does not work with Karaf > I propose this path : > diff -r f0bb11c3d77c src/main/java/org/apache/karaf/main/Main.java > --- a/src/main/java/org/apache/karaf/main/Main.java=09Mon Dec 20 11:05:11= 2010 +0100 > +++ b/src/main/java/org/apache/karaf/main/Main.java=09Mon Dec 20 11:46:29= 2010 +0100 > @@ -485,28 +485,20 @@ > // the start level to which the bundles are assigned is specifie= d by > // appending a ".n" to the auto-install property name, where "n"= is > // the desired start level for the list of bundles. > - autoInstall(PROPERTY_AUTO_INSTALL, context, sl, convertToMavenUr= ls); > + autoInstall(PROPERTY_AUTO_INSTALL, context, sl, convertToMavenUr= ls, false); > =20 > // The auto-start property specifies a space-delimited list of > // bundle URLs to be automatically installed and started into ea= ch > // new profile; the start level to which the bundles are assigne= d > // is specified by appending a ".n" to the auto-start property n= ame, > // where "n" is the desired start level for the list of bundles. > - // The following code starts bundles in two passes, first it ins= talls > - // them, then it starts them. > - List bundlesToStart =3D autoInstall(PROPERTY_AUTO_ST= ART, context, sl, convertToMavenUrls); > - // Now loop through and start the installed bundles. > - for (Bundle b : bundlesToStart) { > - try { > - b.start(); > - } > - catch (Exception ex) { > - System.err.println("Auto-properties start: " + ex); > - } > - } > + // The following code starts bundles in one passes, it installs > + // and it starts them by level. > + autoInstall(PROPERTY_AUTO_START, context, sl, convertToMavenUrls= , true); > + =20 > } > =20 > - private List autoInstall(String propertyPrefix, BundleContex= t context, StartLevel sl, boolean convertToMavenUrls) { > + private List autoInstall(String propertyPrefix, BundleContex= t context, StartLevel sl, boolean convertToMavenUrls, boolean start) { > Map autoStart =3D new TreeMap(= ); > List bundles =3D new ArrayList(); > for (Iterator i =3D configProps.keySet().iterator(); i.hasNext()= ;) { > @@ -531,6 +523,7 @@ > } > for (Integer startLevel : autoStart.keySet()) { > StringTokenizer st =3D new StringTokenizer(autoStart.get(sta= rtLevel), "\" ", true); > + List bundlesLevel =3D new ArrayList(); > if (st.countTokens() > 0) { > String location =3D null; > do { > @@ -541,6 +534,7 @@ > Bundle b =3D context.installBundle(parts[0],= new URL(parts[1]).openStream()); > sl.setBundleStartLevel(b, startLevel); > bundles.add(b); > + bundlesLevel.add(b); > } > catch (Exception ex) { > System.err.println("Auto-properties install:= " + ex); > @@ -549,6 +543,15 @@ > } > while (location !=3D null); > } > + // Now loop through and start the installed bundles. > + for (Bundle b : bundlesLevel) { > + try { > + b.start(); > + } > + catch (Exception ex) { > + System.err.println("Auto-properties start: " + ex); > + } > + } > } > return bundles; > } -- This message was sent by Atlassian JIRA (v6.1.5#6160)