Actually, a better way is to use our maven plugin to do that.
Here is an exerpt from the pom that you can find at [1]
<plugin>
<groupId>org.apache.servicemix.tooling</groupId>
<artifactId>features-maven-plugin</artifactId>
<executions>
<execution>
<id>add-features-to-repo</id>
<phase>generate-resources</phase>
<goals>
<goal>add-features-to-repo</goal>
</goals>
<configuration>
<descriptors>
<descriptor>file:${basedir}/target/classes/features.xml</descriptor>
</descriptors>
<features>
<feature>nmr</feature>
<feature>nmr-audit</feature>
<feature>jbi</feature>
<feature>jbi-cluster</feature>
</features>
<repository>target/features-repo</repository>
</configuration>
</execution>
</executions>
</plugin>
What it will do is to populate the designated repository with all the
bundles required from the specified features.
In this case, it will create a m2 repository in "target/features-repo"
populated with all the bundles required to install the nmr, nmr-audit,
jbi and jbi-cluster features that are described in the
file:${basedir}/target/classes/features.xml descriptor.
[1] https://svn.apache.org/repos/asf/servicemix/smx4/nmr/trunk/assembly/pom.xml
On Thu, Jun 25, 2009 at 15:35, Eoghan Glynn<[email protected]> wrote:
> 2009/6/25 TheWinch <[email protected]>:
>> One more question: how can I get a local copy of a maven repository (I don't
>> know Maven very well too :-( ) ? From my experiments on another system that
>> has a network access, I've seen that SMX4 stores the downloaded bundles in
>> <smx4_home>/data/cache/bundle<xyz>, which makes it quite difficult to
>> reconstruct the maven repository.
>
> This is the Felix bundle cache, into which installed bundles are
> copied so that they are available on restart (note that Felix is
> simply the default OSGi runtime underpinning ServiceMix).
>
> Unfortunately AFAIK pax-url doesn't first copy the downloaded bundles
> into the local maven repo, or the <smx_home>/system dir, before
> installing these bundles into the OSGi runtime.
>
> One slightly messy approach to reconstruct the required maven repo,
> would be to look at the feature definition in
> <smx_home>/system/org/apache/servicemix/apache-servicemix/<version>/apache-servicemix-<version>-features.xml
> and then for each bundle specified in the feature definition (and in
> any embedded features) take the elements of form:
>
> <bundle>mvn:org.apache.cxf:cxf-bundle/2.2.1<bundle>
>
> and create a corresponding maven style dependency in a skeletal
> pom.xml[1] of form:
>
> <dependency>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-bundle</artifactId>
> <version>2.2.1</version>
> </dependency>
>
> Then run "mvn install" over this pom.xml with an empty local maven
> repo ($HOME/.m2/repository by default).
>
> Then you could simply copy over the populated local maven repo to the
> isolated server via a USB stick or whatever.
>
> Its a bit awkward really, and there may be better suggestions
> forthcoming on this list.
>
> Cheers,
> Eoghan
>
> [1] http://maven.apache.org/guides/introduction/introduction-to-the-pom.html
>
>> It seems that the jars are stored directly
>> into the cache and are not copied into the pre-existing maven repository
>> located in <smx4_home/system (is this really a maven repo ? Because it
>> furiously looks like).
>>
>> I think the best option for me would be to make a mirror of the maven
>> repositories referenced in <smx_home>/etc/org.ops4j.pax.url.mvn.cfg, as I
>> intend to have several nodes running SMX4 on my private network.
>> --
>> View this message in context:
>> http://www.nabble.com/SMX4---installing-features-without-internet-access---tp24200345p24202233.html
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>>
>
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com