Question

We had configured the generation of QueryDSL in our project using the maven plugin:

       <plugin>
            <groupId>com.mysema.maven</groupId>
            <artifactId>apt-maven-plugin</artifactId>
            <version>1.1.0</version>
            <configuration>
                <processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>com.mysema.querydsl</groupId>
                    <artifactId>querydsl-apt</artifactId>
                    <version>${querydsl.version}</version>
                </dependency>
            </dependencies>

            <executions>
                <execution>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>process</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>target/generated-sources/java</outputDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>   

At some point, we made changes in our project, and the generation process begin to fail with this error:

cannot find symbol import xxx.xxxx.xxxx.domain.QContact;
Was it helpful?

Solution

After some investigation, this problem is caused by a class that has been entirely commented.

For example:

//package xxx.xxxx.xxxxx;
////
//public class Test {
////
//}

If you put a class like this in your domain package, the generation process fails.

Well, on the other hand, this kind of classes wouldn't have to exist in your project.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top