Hi,

I know that I can set the name of the xml-file. I was just too lazy :)

The problem could be that there is no a directory like /target/scr-plugin-generated/OSGI-INF.
Does it mean that no descriptor.xml is generated?

I'm a bit confuesed. Where do I use the annotations? Aren't they the same annotations that you use when you define a Declarative Service Component?
Where do the scr-plugin know what it has to generate?

I know I'm annoying but you have to bear it, please ^^

I think I hate maven more every day... :P


Regards
Mustafa



Guido Spadotto wrote:
Mustafa Caylak wrote:
Hello Guido,

I've used your suggestion, but the only output I got is:
[ERROR] Error building bundle de.offis.utils.configSC:configSC:bundle:1.0-SNAPSHOT : Service-Component entry can not be located in JAR: OSGI-INF/Locator.xml

Of course I renamed my xml-file to Locator.xml.
What do your Locator.xml look like?

Hi Mustafa,
first, you can name the *automatically* generated component descriptor as you like.

I've named it Locator.xml because that made sense for the component I developed, but you can set the value of the *component.descriptor.name *property to anything
you like.

That said, could you take a look inside the \target\scr-plugin-generated\OSGI-INF directory of your project? It should contain the generated component descriptor file, whose name will be the value of the *component.descriptor.name *property, if specified.

If it's there, then the scr plugin worked, and that's all it's supposed to do (according to [1]).

In order for the maven-bundle-plugin to insert that descriptor file in the bundle, you will have to add this directive within its configuration instructions: <Service-Component>OSGI-INF/${component.descriptor.name}</Service-Component>


Sorry to ask this, but have you added the relevant annotations inside
the component implementation?

It might also be that you've experienced [2], but I can't say for sure with the amount
of information you provided so far.

Cheers,
Guido

[1]: http://felix.apache.org/site/apache-felix-maven-scr-plugin.html
[2]: http://old.nabble.com/-jira--Created:-%28FELIX-1847%29-Error-with-duplicates-when-using-maven-bundle-plugin-2.0.1-and-maven-scr-plugin-1.4-td26216540.html



Guido Spadotto wrote:
Why don't you just use the maven-scr-plugin and its annotations?
I've found it very handy to generate the component descriptor.

This is a snippet of a pom of mine (notice there's no bnd file "tampering"):

<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/maven-v4_0_0.xsd";>
   <modelVersion>4.0.0</modelVersion>
   <properties>
<*component.descriptor.name*>_WhateverYouLike.xml_</component.descriptor.name> </properties>

     </dependencies>
   <build>
       <plugins>
           <plugin>
               <groupId>org.apache.felix</groupId>
               <artifactId>maven-bundle-plugin</artifactId>
               <extensions>true</extensions>
               <configuration>
                   <instructions>
                       <Bundle-Name>${project.name}</Bundle-Name>
<Export-Package>org.something.api</Export-Package> <Service-Component>OSGI-INF/${*component.descriptor.name*}</Service-Component> </instructions>
               </configuration>
           </plugin>
           <plugin>
               <groupId>org.apache.felix</groupId>
               <artifactId>maven-scr-plugin</artifactId>
               <version>1.0.8</version>
               <configuration>
<finalName>${*component.descriptor.name*}</finalName>
               </configuration>
               <executions>
                   <execution>
                       <id>generate-scr-scrdescriptor</id>
                       <goals>
                           <goal>scr</goal>
                       </goals>
                   </execution>
               </executions>
           </plugin>
       </plugins>
   </build>

</project>


Cheers,
Guido

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]





---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to