Install multiple packages from one source

I am using Apache Karaf as an OSGi container. Karaf has a url wrapper that can install packages directly from the maven repository.

> install mvn:com.farpost.billing/background-service/2.2-SNAPSHOT
Bundle ID: 139

Everything works perfectly. But I want to run several packages from this source. It makes sense if a new package sometimes interrupts production service and I want a rollback. With OSGi, it is very simple.

 > list 
 [ 139] [Active     ] [            ] [Started] [   60] Billing background service (2.2-20100811-1232)
 [ 140] [Resolved   ] [            ] [       ] [   60] Billing background service (2.2-20100809-1127)
 > update 140
 > list
 [ 139] [Active     ] [            ] [Started] [   60] Billing background service (2.2-20100811-1232)
 [ 140] [Resolved   ] [            ] [       ] [   60] Billing background service (2.2-20100812-1354)
 > start 140
 > stop 139
 > list
 [ 139] [Resolved   ] [            ] [       ] [   60] Billing background service (2.2-20100811-1232)
 [ 140] [Active     ] [            ] [Started] [   60] Billing background service (2.2-20100812-1354)
 #################
 # suppose we need to rollback here
 #################
 > start 139
 > stop 140

The problem is that I cannot create multiple packages from the same source:

> install mvn:com.farpost.billing/background-service/2.2-SNAPSHOT
Bundle ID: 139
> install mvn:com.farpost.billing/background-service/2.2-SNAPSHOT
Bundle ID: 139

The second call installdoes nothing but return an existing package identifier. So my question is, is there a way to create multiple packages from the same source URL?

+3
3

, .

, , , , , . , , , , , .

, , . , . (), Apache ACE, OSGi, ( OSGi).

+2

, . , 6-7 . , , 6-7. "master", Karaf . , Karaf .

:

  • . :

  • - m2.

  • org.apache.karaf.features.cfg Karaf. URL- mvn , , "featuresRepositories". "featureBoot", , .

  • Karaf "features: install name_of_feature". - , , .

, , . , - , .

, .

+2

: , - ! RSS- Stackoverflow !?!

+1 , .

RESOLVED - / (ACTIVE , ), Karaf. karaf-features (. PDF- ), v2.x ( trunk/v3, fixed)

, , :

  • pax maven url handler ,
  • , 2- , , 1-

() 1:

, , maven-bundle, buildnumber-maven-plugin :

<Bundle-SymbolicName>${project.artifactId} ${buildNumber}</Bundle-SymbolicName>

, , (SNAPSHOT ):

install mvn:com.farpost.billing/background-service/2.2-20100812-1354

, , , RESOLVED ACTIVE bundle - .

( ) 2:

( pom.xml):

  • refresh
  • ,

, , , ( ? ?). Karaf versions-maven-plugin

() 3:

  • ; API- - , ( )
  • OSGi, maven (. Peter Kriens ). MAJOR.MINOR.MICO.qualifier, , , .
  • SNAPSHOT , , , , ( , , ( , SNAPSHOT, -maven-plugin lock-snapshots )
  • Karaf, ( )
+1

Source: https://habr.com/ru/post/1759430/


All Articles