1

我正在尝试配置我的 spring 项目以使用查询 dsl。maven 版本的插件有问题,我收到以下消息:

[INFO] Internal error in the plugin manager executing goal 'com.mysema.maven:apt-maven-plugin:1.0.4:process': Unable to load the mojo 'com.mysema.maven:apt-maven-plugin:1.0.4:process' in the plugin 'com.mysema.maven:apt-maven-plugin'. A required class is missing: org/codehaus/plexus/util/Scanner
org.codehaus.plexus.util.Scanner

有任何想法吗?

4

2 回答 2

2

似乎缺少依赖项。

尝试将此添加到您的插件依赖项列表中:

<dependency>
    <groupId>org.codehaus.plexus</groupId>
    <artifactId>plexus-utils</artifactId>
    <version>3.0.4</version>
</dependency>

像这样:

<plugin>
    <groupId>com.mysema.maven</groupId>
    <artifactId>apt-maven-plugin</artifactId>
    <version>1.0.4</version>
    <executions>
        <execution>
            <goals>
                <goal>process</goal>
            </goals>
            <configuration>
                <outputDirectory>target/generated-sources/java</outputDirectory>
                <processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
            </configuration>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-utils</artifactId>
            <version>3.0.4</version>
        </dependency>
    </dependencies>
</plugin>
于 2012-11-07T13:03:47.743 回答
0

此依赖问题已在 1.0.6 中修复

https://github.com/mysema/maven-apt-plugin/issues/12

我将更新 Querydsl 文档

于 2012-11-07T16:07:26.993 回答