Hi Benjamin,

could you try to add a name on the features tag:

<?xml version="1.0" encoding="UTF-8"?>
<features name="my-features">
     <feature name="test-app" version="1.0.0">
         <bundle>mvn:joda-time/joda-time/2.1</bundle>
     </feature>
</features>

Anyway, I will try with your features.xml tomorrow morning.

I keep you posted.

Regards
JB

On 11/22/2012 10:39 AM, Benjamin Debeerst wrote:
Thanks JB,

I've tried your pom (copy-paste-execute), but without success - the same error 
occures. Both on my windows (XP) machine and on a debian system I had no luck 
(first I was suspecting some IO trouble on the windows machine, thats why I 
gave the debian system a try).

[ERROR] Failed to execute goal 
org.apache.karaf.tooling:features-maven-plugin:2.3.0:create-kar (default-cli) 
on project test-features: Could not interpret features
XML file: /home/debeerstb/temp/test-kar/target/feature/feature.xml (No such file 
or directory) : file:/home/debeerstb/temp/test-kar/target/feature/feature.xml 
-> [Help 1]

(Of course on the Windows system I didn't try the absolute path 
/tmp/fatures.xml but other absolute or relative paths)

The plugin always looks for the features file in taget/feature/feature.xml. 
When I put the features file there on beforehand, the build works. But that's 
not really what I wanna do.

I'm running on maven 3.0.4 btw.

I put my own pom and features.xml below for completeness, but since I used your 
exact pom this time I don't think that will help.

Regards,
Benjamin


<?xml version="1.0" encoding="UTF-8" ?>
<project     xmlns="http://maven.apache.org/POM/4.0.0";
                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
                        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
   <modelVersion>4.0.0</modelVersion>
   <groupId>com.example</groupId>
   <artifactId>test-features</artifactId>
   <version>1.0.0-SNAPSHOT</version>
   <packaging>pom</packaging>

   <build>
     <plugins>
       <plugin>
         <groupId>org.apache.karaf.tooling</groupId>
         <artifactId>features-maven-plugin</artifactId>
         <version>2.3.0</version>
         <executions>
           <execution>
             <id>create-kar</id>
             <goals>
               <goal>create-kar</goal>
             </goals>
             <configuration>
               
<featuresFile>${project.basedir}\src\main\resources\features.xml</featuresFile>
             </configuration>
           </execution>
         </executions>
       </plugin>
     </plugins>
   </build>
</project>


and the features.xml:

<?xml version="1.0" encoding="UTF-8"?>
<features>
     <feature name="test-app" version="12.11.02-2">
         <bundle start-level="50">mvn:joda-time/joda-time/2.1</bundle>
     </feature>
</features>


-------- Original-Nachricht --------
Datum: Wed, 21 Nov 2012 17:28:42 +0100
Von: "Jean-Baptiste Onofré" <[email protected]>
An: [email protected]
Betreff: Re: features-maven-plugin ignores configuration?

Hi Benjamin,

I checked in the code (on the 2.3.x branch), and the featuresFile
attribute is used, for instance:

[...]
RepositoryImpl featuresRepo = new RepositoryImpl(featuresFile.toURI());
[...]
jarArchiver.addFile(featuresFile, repositoryPath +
layout.pathOf(featureArtifact));

I just made a try with the following pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd";>

    <modelVersion>4.0.0</modelVersion>

    <groupId>net.nanthrax</groupId>
    <artifactId>test-features</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <build>
      <plugins>
        <plugin>
          <groupId>org.apache.karaf.tooling</groupId>
          <artifactId>features-maven-plugin</artifactId>
          <version>2.3.0</version>
          <executions>
            <execution>
              <id>create-kar</id>
              <goals>
                <goal>create-kar</goal>
              </goals>
              <configuration>
                <featuresFile>/tmp/features.xml</featuresFile>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </build>
</project>

and the plugin use my features.xml from the tmp folder.

Could you share you pom.xml ?

Regards
JB

On 11/21/2012 04:36 PM, Benjamin Debeerst wrote:
Hi all,

I've been setting up a pom to create a kar-file for distribution. I
found JB's blog post very helpful:

http://blog.nanthrax.net/2011/12/do-you-know-the-apache-karaf-maven-plugins/

I recognized it's very old and updated the plugin version to 2.3.0
(release). You find my pom at the end of the email.

The maven execution mvn features:create-kar fails with the following
message:

[ERROR] Failed to execute goal
org.apache.karaf.tooling:features-maven-plugin:2.3.0:create-kar (default-cli) 
on project test-features: Could not
interpret features
XML file: D:\temp\test-kar\target\feature\feature.xml (Das System kann
den angegebenen Pfad nicht finden) :
file:/D:/temp/test-kar/target/feature/feature.xml

It does not find the feature xml. But it looks at the wrong place.
D:\temp\test-kar\ is the project folder. The feature xml is thus in
D:\temp\test-kar\src\main\resources, as defined in the pom.

When I run mvn with the -X switch, I see this:
[DEBUG] Configuring mojo
org.apache.karaf.tooling:features-maven-plugin:2.3.0:create-kar from plugin 
realm
ClassRealm[plugin>org.apache.karaf.tooling:features-maven-plugin:2.3.0, parent:
sun.misc.Launcher$AppClassLoader@35ce36]
[DEBUG] Configuring mojo
'org.apache.karaf.tooling:features-maven-plugin:2.3.0:create-kar' with basic 
configurator -->
[DEBUG]   (f) featureArtifactType = xml
[DEBUG]   (f) featuresFile = D:\temp\test-kar\target\feature\feature.xml
[DEBUG]   (f) finalName = test-features-1.0.0-SNAPSHOT

Obviously the configuration is not used. Am I missing something? Or is
this a known issue?

Best,
Benjamin




<?xml version="1.0" encoding="UTF-8" ?>
<project     xmlns="http://maven.apache.org/POM/4.0.0";
                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
                        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.example</groupId>
    <artifactId>test-features</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <build>
      <plugins>
        <plugin>
          <groupId>org.apache.karaf.tooling</groupId>
          <artifactId>features-maven-plugin</artifactId>
          <version>2.3.0</version>
          <executions>
            <execution>
              <id>create-kar</id>
              <goals>
                <goal>create-kar</goal>
              </goals>
              <configuration>

<featuresFile>${project.basedir}\src\main\resources\features.xml</featuresFile>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </build>
</project>


--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to