Details

      Description

      The current implementation of the maven scr plugin and generator has grown over time and is very complex. It makes a lot of assumptions about hidden datastructures. This is partially due to the use of QDox in the beginning of the plugin
      As we drop the support for javadoc annotations, we can also drop qdox and clean up the implementation
      This also makes developing new features easier

        Issue Links

          Activity

          Hide
          rmuntean added a comment -

          The implementation can also be based on an annotation processor. Besides being a 'standard' technology it has the benefit of improving integration with yet-unsupported build tools like Gradle and IDEs.

          Show
          rmuntean added a comment - The implementation can also be based on an annotation processor. Besides being a 'standard' technology it has the benefit of improving integration with yet-unsupported build tools like Gradle and IDEs.
          Hide
          Chetan Mehrotra added a comment -

          Had the annotations been not compile time one could have used ASM ClassVisitor support similar to what is used by Maven Plugin Plugin to generate plugin xml [1]. It also allows one to use same infrastructure with non java languages like Groovy as bytecode becomes the source of truth.

          [1] http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGenerator.java?view=markup

          Show
          Chetan Mehrotra added a comment - Had the annotations been not compile time one could have used ASM ClassVisitor support similar to what is used by Maven Plugin Plugin to generate plugin xml [1] . It also allows one to use same infrastructure with non java languages like Groovy as bytecode becomes the source of truth. [1] http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGenerator.java?view=markup
          Hide
          Carsten Ziegeler added a comment -

          @Chetan : The annotations have now retention class and we use ASM to extract them from the class files

          @Robert : I'm open for using annotation processors. So far I haven't found a good way of leveraging them in the implementation. If you have some ideas, we could discuss them on the mailing list.

          Show
          Carsten Ziegeler added a comment - @Chetan : The annotations have now retention class and we use ASM to extract them from the class files @Robert : I'm open for using annotation processors. So far I haven't found a good way of leveraging them in the implementation. If you have some ideas, we could discuss them on the mailing list.
          Hide
          Stefan Seifert added a comment -

          i've tested the refactored implementation with some of our more complex projects and found - and fixed - several issues. patch attached 120720_FELIX-3550_fixes.patch.

          issues in detail:

          • custom annotations provided with an AnnotationProvider where not detected if their retention policy was RUNTIME. this may be required if the annotation is not only used for the SCR plugin but for other usecases as well that require RUNTIME.
          • annotated methods with array parameters caused errors during processing
          • annotated overloaded methods with same signature parameter count where not detected properly
          • NPE was thrown if a component hat no configuration policy property set
          • replaced two System.out.println's with debug log outputs
          Show
          Stefan Seifert added a comment - i've tested the refactored implementation with some of our more complex projects and found - and fixed - several issues. patch attached 120720_FELIX-3550_fixes.patch . issues in detail: custom annotations provided with an AnnotationProvider where not detected if their retention policy was RUNTIME. this may be required if the annotation is not only used for the SCR plugin but for other usecases as well that require RUNTIME. annotated methods with array parameters caused errors during processing annotated overloaded methods with same signature parameter count where not detected properly NPE was thrown if a component hat no configuration policy property set replaced two System.out.println's with debug log outputs
          Hide
          Carsten Ziegeler added a comment -

          Great, thanks for the patch! Looks pretty good to me, I've applied it to trunk. Thanks!

          Show
          Carsten Ziegeler added a comment - Great, thanks for the patch! Looks pretty good to me, I've applied it to trunk. Thanks!

            People

            • Assignee:
              Carsten Ziegeler
              Reporter:
              Carsten Ziegeler
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development