Fixed bug on generating configuration catalogues

When the OSGi @Component annotation is imported via star import (e.g.,
import org.osgi.service.component.annotations.*), the onos-maven-plugin
does not recognize that and fails to generate the cfgdef file.

Change-Id: I0a0d9c04479e4c27783a37ad3e6245bec1d272a6
This commit is contained in:
Daniele Moro 2019-11-22 18:00:29 -08:00 committed by Thomas Vachuska
parent 893988e6be
commit 462547acf8
3 changed files with 4 additions and 4 deletions

View File

@ -273,7 +273,7 @@
<artifactId>onos-maven-plugin</artifactId>
<!-- This version needs to be updated manually when changes
are made to onos-maven-plugin -->
<version>2.2</version>
<version>2.2.1</version>
<executions>
<execution>
<id>cfg</id>

View File

@ -26,7 +26,7 @@
<groupId>org.onosproject</groupId>
<artifactId>onos-maven-plugin</artifactId>
<version>2.3-SNAPSHOT</version>
<version>2.2.1</version>
<packaging>maven-plugin</packaging>
<description>Maven plugin for packaging ONOS applications or generating

View File

@ -75,7 +75,7 @@ public class OnosCfgMojo extends AbstractMojo {
private class CfgDefGenerator {
private static final String COMPONENT = "org.osgi.service.component.annotations.Component";
private static final String COMPONENT = "Component";
private static final String PROPERTY = "property";
private static final String SEP = "|";
private static final String UTF_8 = "UTF-8";
@ -125,7 +125,7 @@ public class OnosCfgMojo extends AbstractMojo {
private void processClass(JavaClass javaClass) throws IOException {
Optional<JavaAnnotation> annotation = javaClass.getAnnotations().stream()
.filter(ja -> ja.getType().getName().equals(COMPONENT))
.filter(ja -> ja.getType().getName().endsWith(COMPONENT))
.findFirst();
if (annotation.isPresent()) {
AnnotationValue property = annotation.get().getProperty(PROPERTY);