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
diff --git a/tools/package/dependencies/template.pom b/tools/package/dependencies/template.pom
index 91ce5de..adaeb0d 100644
--- a/tools/package/dependencies/template.pom
+++ b/tools/package/dependencies/template.pom
@@ -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>
diff --git a/tools/package/maven-plugin/pom.xml b/tools/package/maven-plugin/pom.xml
index 4322a0d..90277d2 100644
--- a/tools/package/maven-plugin/pom.xml
+++ b/tools/package/maven-plugin/pom.xml
@@ -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
diff --git a/tools/package/maven-plugin/src/main/java/org/onosproject/maven/OnosCfgMojo.java b/tools/package/maven-plugin/src/main/java/org/onosproject/maven/OnosCfgMojo.java
index b706f28..0077ac9 100644
--- a/tools/package/maven-plugin/src/main/java/org/onosproject/maven/OnosCfgMojo.java
+++ b/tools/package/maven-plugin/src/main/java/org/onosproject/maven/OnosCfgMojo.java
@@ -75,7 +75,7 @@
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 @@
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);