要使用Maven生成QueryDSL的Q类，您可以使用`maven-compiler-plugin`插件。以下是使用该插件生成Q类的步骤：

1. 在您的Maven项目的`pom.xml`文件中，添加以下插件配置：

    ```xml
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.11.0</version>
                <configuration>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>com.querydsl</groupId>
                            <artifactId>querydsl-apt</artifactId>
                            <version>5.0.0</version>
                            <classifier>jpa</classifier>
                        </path>
                        <path>
                            <groupId>javax.persistence</groupId>
                            <artifactId>javax.persistence-api</artifactId>
                            <version>2.2</version>
                        </path>
                        <!-- 如果您的项目使用了Lombok，请在此处添加Lombok依赖 -->
                        <!--
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>1.18.30</version>
                        </path>
                        -->
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
        </plugins>
    </build>
    ```

2. 运行Maven构建命令，例如`mvn clean install`。

3. Maven将使用`querydsl-apt`和`javax.persistence-api`依赖项来生成Q类。生成的Q类将位于`target/generated-sources/java`目录下。

现在，您可以在您的项目中使用生成的Q类来进行QueryDSL查询。

---
Learn more:

1. [spring - QueryDsl - How to create Q classes with maven? - Stack Overflow](https://stackoverflow.com/questions/24889990/querydsl-how-to-create-q-classes-with-maven)
2. [3.3. Code generation](http://querydsl.com/static/querydsl/3.2.0/reference/html/ch03s03.html)
3. [How to configure maven to generate QueryDSL classes when using both my own AspectJ ITDs and Roo?](https://groups.google.com/g/querydsl/c/NEiQzP4m1xA)