[richfaces-issues] [JBoss JIRA] (RF-12317) maven-cdk-plugin: two phase source compilation needed for consuming projects to determine types during CDK build

Lukáš Fryč (JIRA) jira-events at lists.jboss.org
Mon Jun 11 10:23:06 EDT 2012


    [ https://issues.jboss.org/browse/RF-12317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12700435#comment-12700435 ] 

Lukáš Fryč commented on RF-12317:
---------------------------------

Following setup fixes the issue:

{code}

        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>precompile-sources-for-cdk</id>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.richfaces.cdk</groupId>
                    <artifactId>maven-cdk-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>cdk-generate-sources</id>
                            <phase>process-sources</phase>
                            <goals>
                                <goal>generate</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>

{code}

There will be 2-phase compilation though tied to following phases:

* 1st compile: {{generate-sources}} 
* CDK generate: {{process-sources}}
* 2nd compile: {{compile}} (process modified/added sources)
                
> maven-cdk-plugin: two phase source compilation needed for consuming projects to determine types during CDK build
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: RF-12317
>                 URL: https://issues.jboss.org/browse/RF-12317
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: cdk, component
>    Affects Versions: 4.2.0.Final
>            Reporter: Lukáš Fryč
>            Assignee: Lukáš Fryč
>             Fix For: 4.3.0.Milestone1
>
>
> 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:
> {code}
> ~/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
> ...
> {code}
> Give attention especially to following part:
> {code}
> [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.
> {code}
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the richfaces-issues mailing list