简体   繁体   中英

com.mysema.querydsl querydsl-apt plugin does not generate QueryDSL classes

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;

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM