Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring Can';t获取QueryDsl/APT以生成Q类_Spring_Maven_Querydsl - Fatal编程技术网

Spring Can';t获取QueryDsl/APT以生成Q类

Spring Can';t获取QueryDsl/APT以生成Q类,spring,maven,querydsl,Spring,Maven,Querydsl,我正试图在一个新的Spring项目中使用QueryDsl。我是QueryDsl新手,对maven和Spring也很陌生,所以我可能缺少一些基本的东西,但我无法让QueryDsl/maven apt插件生成我的Q类。Querydsl参考使声音变得如此简单;我想我完全照上面说的做了: 我将pom.xml配置为: <plugin> <groupId>com.mysema.maven</groupId> <artifactId>maven-apt-

我正试图在一个新的Spring项目中使用QueryDsl。我是QueryDsl新手,对maven和Spring也很陌生,所以我可能缺少一些基本的东西,但我无法让QueryDsl/maven apt插件生成我的Q类。Querydsl参考使声音变得如此简单;我想我完全照上面说的做了:

我将pom.xml配置为:

<plugin>
  <groupId>com.mysema.maven</groupId>
  <artifactId>maven-apt-plugin</artifactId>
  <version>1.0.3</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>
</plugin>
有什么建议吗


谢谢

您直接调用目标,但配置是特定于执行的。因此,要么通过标准maven生命周期使用apt,要么使配置通用。

您直接调用目标,但配置是特定于执行的。因此,要么通过标准maven生命周期使用apt,要么使配置通用。

好的,我明白了。 我不明白(我是一个专业人士),但以下是有效的方法: 在父pom.xml中,我有

<build>
  <pluginManagement>
    <plugins> 
      the maven-apt-plugin definition shown above 
    </plugin>
  <pluginManagement>
</build>

上面显示的maven apt插件定义
在项目的POM中,我有:

<build>
    <plugins> 
      the **exact same** maven-apt-plugin definition shown above 
    </plugin>
</build>

上面显示的**完全相同**maven apt插件定义
没有介于和之间的级别,按照

的说明,我得到了它。 我不明白(我是一个专业人士),但以下是有效的方法: 在父pom.xml中,我有

<build>
  <pluginManagement>
    <plugins> 
      the maven-apt-plugin definition shown above 
    </plugin>
  <pluginManagement>
</build>

上面显示的maven apt插件定义
在项目的POM中,我有:

<build>
    <plugins> 
      the **exact same** maven-apt-plugin definition shown above 
    </plugin>
</build>

上面显示的**完全相同**maven apt插件定义

如果没有和之间的级别,按照Timo上的说明,“mvn清洁安装”难道不应该工作吗?是否需要进行其他配置?谢谢mvn清洁安装应该可以工作,构建/插件/插件部分是必需的Timo,“mvn清洁安装”不应该工作吗?是否需要进行其他配置?谢谢mvn清洁安装应该可以工作,构建/插件/插件部分是必需的好,现在我明白了。顺便说一句,没有必要在项目POM中重复整个插件定义,只需groupId和artifactId就足够了。顺便说一句,没有必要在项目POM中重复整个插件定义,只需groupId和artifactId就足够了。
<build>
    <plugins> 
      the **exact same** maven-apt-plugin definition shown above 
    </plugin>
</build>