Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-12317

maven-cdk-plugin: two phase source compilation needed for consuming projects to determine types during CDK build

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.2.0.Final
    • Fix Version/s: 4.3.0.M1
    • Component/s: cdk, component
    • Labels:
      None

      Description

      With current setup of UI builds, CDK features

      • component-base-class
      • <cdk:object /> or <c:forEach />

      can't properly determine the type of component (if not explicitly defined),
      since the type is not known in the time of the CDK generation step.

      See following log:

      ~/cdk/test-component$ mvn clean install
      [INFO] Scanning for projects...
      [INFO]                                                                         
      [INFO] ------------------------------------------------------------------------
      [INFO] Building RichFaces CDK: Test Component 4.3.0-SNAPSHOT
      [INFO] ------------------------------------------------------------------------
      
      ...
      
      [INFO] --- maven-cdk-plugin:4.3.0-SNAPSHOT:generate (cdk-generate-sources) @ cdk-test-component ---
      [WARNING] Could not determine if the renderer-base-class extends org.richfaces.renderkit.RendererBase: org.richfaces.renderkit.TestComponentRendererBase
      [INFO] Cannot determine the type of org.richfaces.cdk.templatecompiler.el.types.ReferencedType: org.richfaces.renderkit.TestComponentRendererBase, it will be treated as generic Object.
      [INFO] The <foreach> expression #{msgs} is not array, Iterable nor Iterator. It will be treated as single object.
      
      ...
      
      [INFO] 
      [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ cdk-test-component ---
      [INFO] Compiling 5 source files to /home/lfryc/workspaces/richfaces/cdk/test-component/target/classes
      
      ...
      

      Give attention especially to following part:

      [WARNING] Could not determine if the renderer-base-class extends org.richfaces.renderkit.RendererBase: org.richfaces.renderkit.TestComponentRendererBase
      [INFO] Cannot determine the type of org.richfaces.cdk.templatecompiler.el.types.ReferencedType: org.richfaces.renderkit.TestComponentRendererBase, it will be treated as generic Object.
      

      It says TestComponentRendererBase type cannot be determined, which basically means Class.forName(...) fails even though the project's target/classes directory is on classpath.

      Then note the compilation of sources (maven-compiler-plugin) is done after the CDK generation, which is the root cause of this problem.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                lfryc Lukáš Fryč
                Reporter:
                lfryc Lukáš Fryč
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: