Hi Massimiliano,

In your POM, did you define the dependency corresponding to the bundles used in features descriptor ? The features maven plugin is not able to go on a remote repository for now. So before running the features maven plugin, the bundles should be present in your local maven repo.

For example, if you have a features descriptor like this:

<feature name="my" version="my.version">
  <bundle>mvn:my.groupId/my.artifactId/my.version</bundle>
</feature>

you need the corresponding dependency in the POM:

<dependency>
  <groupId>my.groupId</groupId>
  <artifactId>my.artifactId</artifactId>
  <version>my.version</version>
</dependency>

Is it the case ?

Regards
JB

On 11/29/2010 12:22 PM, Massimiliano Guillaro wrote:

Hello,
i'm a newbie in apache karaf. I would use apache servicemix in local but i
need a local copy of features in a local maven repository.
I try to use  org.apache.karaf.tooling:features-maven-plugin but when i run
it, i have all the time the same error: Error populating repository !!
I've tried to use both maven 3.0 and maven 2.2.1 and i have also tried to
use both an xml feature's file local and remote.
I'm working on knoppix 2.6.
Please help me  and if necessary please can you post an example of pom?.

Thank you
Massimiliano Guillaro

Output:

r...@microknoppix:/home/knoppix/my-app# mvn
org.apache.karaf.tooling:features-maven-plugin:add-features-to-repo -e
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[INFO] Building Unnamed - it.vitrociset.app:my-app:jar:1.0-SNAPSHOT
[INFO]    task-segment:
[org.apache.karaf.tooling:features-maven-plugin:add-features-to-repo]
[INFO]
------------------------------------------------------------------------
[INFO] Preparing features:add-features-to-repo
[WARNING] Removing: add-features-to-repo from forked lifecycle, to prevent
recursive invocation.
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (ISO-8859-15 actually) to copy filtered
resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory
/home/knoppix/my-app/src/main/resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [features:add-features-to-repo {execution: default-cli}]
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error populating repository

[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error populating
repository
         at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
         at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
         at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
         at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
         at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
         at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
         at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
         at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
         at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error populating
repository
         at
org.apache.karaf.tooling.features.AddFeaturesToRepoMojo.execute(AddFeaturesToRepoMojo.java:171)
         at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
         at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
         ... 17 more
Caused by: java.lang.NullPointerException
         at
org.apache.karaf.tooling.features.AddFeaturesToRepoMojo.execute(AddFeaturesToRepoMojo.java:85)
         ... 19 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 8 seconds
[INFO] Finished at: Mon Nov 29 11:40:12 CET 2010
[INFO] Final Memory: 14M/26M
[INFO]
------------------------------------------------------------------------

POM:

<project>
<modelVersion>4.0.0</modelVersion>
   <groupId>com.mycompany.app</groupId>
   <artifactId>my-app</artifactId>
   <version>1.0-SNAPSHOT</version>

   <pluginRepositories>
           <pluginRepository>
                 <id>releases</id>
                 <name>Releases</name>

<url>http://repo.fusesource.com/nexus/content/repositories/releases</url>
         </pluginRepository>
  </pluginRepositories>

   <build>
         <plugins>
             <plugin>
                 <groupId>org.apache.karaf.tooling</groupId>
                 <artifactId>features-maven-plugin</artifactId>
                 <version>2.0.0-fuse-02-00</version>
                 <executions>
                     <execution>
                         <id>add-features-to-repo</id>
                         <phase>generate-resources</phase>
                         <goals>
                             <goal>add-features-to-repo</goal>
                         </goals>
                         <configuration>
                             <descriptors>

<descriptor>mvn:org.apache.servicemix/apache-servicemix/4.3.0-fuse-02-00/xml/features</descriptor>
                             </descriptors>
                             <features>
                                 <feature></feature>
                             </features>

<repository>${project.build.directory}/features-repo</repository>
                         </configuration>
                     </execution>
                 </executions>
             </plugin>
         </plugins>
     </build>

Reply via email to