gwtboot / gwt-boot-samples

GWT Boot: Samples to check all the Starters
Apache License 2.0
40 stars 23 forks source link

Compilation of the example DnComponents fails #14

Closed lofidewanto closed 4 years ago

lofidewanto commented 4 years ago

I could run the example with the devmode, everything works fine. But as soon as I try to compile in "pure" Maven I get following error:

[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ gwt-boot-sample-ui-dncomponents ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 16 source files to /Users/lofidewanto/git/gwt-boot-samples/gwt-boot-sample-ui-dncomponents/target/classes
 ************************ processing annotations ************************ 
 ---- com.github.gwtboot.sample.ui.dncomponents.client.greeting.GreetingViewImpl
 ---- com.github.gwtboot.sample.ui.dncomponents.client.cell.TreeAppView
 ---- com.github.gwtboot.sample.ui.dncomponents.client.cell.ListAppView
 ---- com.github.gwtboot.sample.ui.dncomponents.client.cell.TableAppView
 ---- com.github.gwtboot.sample.ui.dncomponents.client.MainApp
 ---- com.github.gwtboot.sample.ui.dncomponents.client.home.HomeViewImpl
 ************************ processing annotations ************************ 
 ************************ processing annotations ************************ 
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /Users/lofidewanto/git/gwt-boot-samples/gwt-boot-sample-ui-dncomponents/src/main/java/com/github/gwtboot/sample/ui/dncomponents/client/DncomponentsEntryPoint.java:[22,47] cannot find symbol
  symbol:   class AppTemplates
  location: package com.dncomponents.client.components.core
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  11.605 s
[INFO] Finished at: 2020-09-08T20:40:17+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project gwt-boot-sample-ui-dncomponents: Compilation failure
[ERROR] /Users/lofidewanto/git/gwt-boot-samples/gwt-boot-sample-ui-dncomponents/src/main/java/com/github/gwtboot/sample/ui/dncomponents/client/DncomponentsEntryPoint.java:[22,47] cannot find symbol
[ERROR]   symbol:   class AppTemplates
[ERROR]   location: package com.dncomponents.client.components.core

With devmode I could run the webapp without any problems.

lofidewanto commented 4 years ago

I'm not sure why I get the error... There is this annotation processor in the compiler (see pom.xml):

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>8</source>
                    <target>8</target>
                    <compilerArgs>
                        <arg>-Aregister=AppTemplates</arg>
                    </compilerArgs>
                    <annotationProcessors>
                        <annotationProcessor>com.dncomponents.TemplateProcessor</annotationProcessor>
                    </annotationProcessors>
                </configuration>
            </plugin>
lofidewanto commented 4 years ago

Got exactly the same error on Travis: https://travis-ci.org/github/gwtboot/gwt-boot-samples

lofidewanto commented 4 years ago

Done with a workaround in Maven compiler plugin:

                            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <executions>
                    <execution>
                        <id>process-annotations</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <excludes>
                                <!-- Here exclude EntryPoint Java file from compilation -->
                                <!-- Either exclude with full path to file that implements EntryPoint -->
                                <!-- Interface or follow name convention that contains EntryPoint word like AppEntryPoint -->
                                <exclude>**/*EntryPoint*.*</exclude>
                            </excludes>
                            <compilerArgs>
                                <arg>-Aregister=AppTemplates</arg>
                                <arg>-proc:only</arg>
                                <arg>-processor</arg>
                                <arg>com.dncomponents.TemplateProcessor</arg>
                            </compilerArgs>
                        </configuration>
                    </execution>
                    <execution>
                        <id>default-compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <compilerArgs>
                                <arg>-proc:none</arg>
                            </compilerArgs>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
lofidewanto commented 4 years ago

Done for now

nikolasav commented 4 years ago

Please revert this: `

org.apache.maven.plugins
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>8</source>
                <target>8</target>
                <compilerArgs>
                    <arg>-Aregister=AppTemplates</arg>
                </compilerArgs>
                <annotationProcessors>
                    <annotationProcessor>com.dncomponents.TemplateProcessor</annotationProcessor>
                </annotationProcessors>
            </configuration>
        </plugin>`

No need for workaround after annotation processor bug fixed in dncomponents version 2.3.2 .

Thanks

lofidewanto commented 4 years ago

Done!