mirror of
https://github.com/opennetworkinglab/onos.git
synced 2026-05-10 22:56:11 +02:00
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:
parent
893988e6be
commit
462547acf8
@ -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>
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user