FELIX-3550 : Reimplement the SCR Generator
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1355095 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java b/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java
index d1dc04e..a722bea 100644
--- a/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java
+++ b/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/xml/ComponentDescriptorIO.java
@@ -500,6 +500,7 @@
}
this.currentClass = new ClassDescription(cl, "classpath:" + className);
this.currentClass.add(this.currentComponent);
+ this.components.add(this.currentClass);
} else if (localName.equals(PROPERTY)) {
diff --git a/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/SCRDescriptorMojo.java b/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/SCRDescriptorMojo.java
index d20e101..f3fd5f8 100644
--- a/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/SCRDescriptorMojo.java
+++ b/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/SCRDescriptorMojo.java
@@ -164,7 +164,7 @@
*
* @parameter
*/
- protected List<String> supportedProjectTypes = Arrays.asList( new String[]
+ private List<String> supportedProjectTypes = Arrays.asList( new String[]
{ "jar", "bundle" } );
public void execute() throws MojoExecutionException, MojoFailureException {
@@ -220,7 +220,7 @@
} catch (final SCRDescriptorException sde) {
throw new MojoExecutionException(sde.getSourceLocation() + " : " + sde.getMessage(), sde.getCause());
- } catch (SCRDescriptorFailureException sdfe) {
+ } catch (final SCRDescriptorFailureException sdfe) {
throw (MojoFailureException) new MojoFailureException(
sdfe.getMessage()).initCause(sdfe);
}
@@ -228,8 +228,8 @@
private URL[] getClassPath() throws MojoFailureException {
@SuppressWarnings("unchecked")
- List<Artifact> artifacts = this.project.getCompileArtifacts();
- ArrayList<URL> path = new ArrayList<URL>();
+ final List<Artifact> artifacts = this.project.getCompileArtifacts();
+ final ArrayList<URL> path = new ArrayList<URL>();
try {
path.add(new File(this.project.getBuild().getOutputDirectory())
@@ -239,8 +239,8 @@
"Unable to add target directory to classloader.");
}
- for (Iterator<Artifact> ai = artifacts.iterator(); ai.hasNext();) {
- Artifact a = ai.next();
+ for (final Iterator<Artifact> ai = artifacts.iterator(); ai.hasNext();) {
+ final Artifact a = ai.next();
assertMinScrAnnotationArtifactVersion(a);
try {
path.add(a.getFile().toURI().toURL());