[
https://issues.apache.org/jira/browse/FELIX-4413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13888648#comment-13888648
]
Alex Blewitt commented on FELIX-4413:
-------------------------------------
Hmm... it seems that this does work if I put this on the dependency list
instead:
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.ds-annotations</artifactId>
<version>1.2.0</version>
</dependency>
However I discovered this by accident rather than from the documentation:
http://felix.apache.org/documentation/subprojects/apache-felix-maven-scr-plugin/apache-felix-maven-scr-plugin-use.html
It would be good to update the documentation to reflect on how to generate
standard data, or why it's necessary if the osgi.enterprise (or other JAR with
the annotations) is on the build dependencies.
> Update maven-scr-plugin to use standard OSGi annotations
> --------------------------------------------------------
>
> Key: FELIX-4413
> URL: https://issues.apache.org/jira/browse/FELIX-4413
> Project: Felix
> Issue Type: Bug
> Components: Maven SCR Plugin
> Affects Versions: maven-scr-plugin 1.15.0
> Reporter: Alex Blewitt
> Priority: Minor
>
> The maven-scr-1.15.0 plugin complains when org.apache.felix.scr.annotations
> is missing, and even when present appears to ignore components registered
> with the standard OSGi annotations in the OSGi Enterprise 5.0 specification.
> This class generates the maven scr data:
> import org.apache.felix.scr.annotations.Component;
> //import org.osgi.service.component.annotations.Component;
> @Component(name = "Test")
> public class Test implements Runnable {
> public void run() {
> }
> }
> This one does not:
> //import org.apache.felix.scr.annotations.Component;
> import org.osgi.service.component.annotations.Component;
> @Component(name = "Test")
> public class Test implements Runnable {
> public void run() {
> }
> }
> This was compiled with the following dependencies set:
> <dependencies>
> <dependency>
> <groupId>org.apache.felix</groupId>
>
> <artifactId>org.apache.felix.scr.annotations</artifactId>
> <version>1.9.6</version>
> </dependency>
> <dependency>
> <groupId>org.osgi</groupId>
> <artifactId>org.osgi.enterprise</artifactId>
> <version>5.0.0</version>
> </dependency>
> </dependencies>
> <build>
> <plugins>
> <plugin>
> <groupId>org.apache.felix</groupId>
> <artifactId>maven-scr-plugin</artifactId>
> <version>1.15.0</version>
> <executions>
> <execution>
>
> <id>generate-scr-scrdescriptor</id>
> <goals>
> <goal>scr</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> </plugins>
> </build>
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)