2016-11-07 3 views
2

Imはしかし、イムは次のようにいくつかのコンパイルエラーを取得し、プロジェクトのためのスプリング・データ-JPAを使用してquerydslを有効にしようとしている:spring boot 1.4.1でquerydslを設定するには?

Caused by: java.lang.ClassNotFoundException: com.querydsl.core.annotations.QueryEntities 
:私はMVNクリーン実行したときに、また

The type com.querydsl.core.types.Predicate cannot be resolved. It is indirectly referenced from required .class files 

私はこれを取得インストール

私はクラスパスでjarファイルを見直しました。私はquerydsl-core 4.1.4、querydsl-apt 4.1.4、querydsl-jpa 4.1.4を見ることができます。しかし、まだ私のためにコンパイルしていないプロジェクトは、springboot 1.4.1とquerydslに問題はありますか?

私は私のpom.xmlファイル

<dependency> 
    <groupId>com.querydsl</groupId> 
    <artifactId>querydsl-jpa</artifactId> 
</dependency> 
<dependency> 
    <groupId>com.querydsl</groupId> 
    <artifactId>querydsl-apt</artifactId> 
    <scope>provided</scope> 
</dependency> 

<plugin> 
    <groupId>com.mysema.maven</groupId> 
    <artifactId>apt-maven-plugin</artifactId> 
    <version>1.1.3</version> 
    <executions> 
     <execution> 
      <goals> 
       <goal>process</goal> 
      </goals> 
      <configuration> 
       <outputDirectory>target/generated-sources/java</outputDirectory> 
       <processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor> 
      </configuration> 
     </execution> 
    </executions> 
</plugin> 

は、私が何か間違ったことをやっているプラ​​グインでこれを持っていますか?

--- --- UPDATE

私はquerydsl 4.1.4から4.1.3にダウングレードし、少なくともプロジェクトをコンパイルしています。さて、私はいくつかのテストを開始することができます、私は私の発見を投稿します。

デフォルトでは、スプリングブート1.4.1にquerydsl 4.1.4バージョンが付属しているので、まだ開いていると思います。

+0

上記のプラグインをビルド>プラグインまたはビルド>プラグイン管理>プラグインに追加しましたか?プラグインをビルド>プラグインに置く必要があります –

答えて

1

プラグインに依存関係を入れます。

<plugin> 
    <groupId>com.mysema.maven</groupId> 
    <artifactId>apt-maven-plugin</artifactId> 
    <version>1.1.3</version> 
    <executions> 
     <execution> 
      <goals> 
       <goal>process</goal> 
      </goals> 
      <configuration> 
       <outputDirectory>target/generated-sources/java</outputDirectory> 
       <processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor> 
      </configuration> 
     </execution> 
    </executions> 
    <dependencies> 
     <dependency> 
      <groupId>com.querydsl</groupId> 
      <artifactId>querydsl-jpa</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>com.querydsl</groupId> 
      <artifactId>querydsl-apt</artifactId> 
      <scope>provided</scope> 
     </dependency> 
    </dependencies> 
</plugin> 
+0

コアにはEclipseが探しているクラスがありますが、なんらかの理由でクラスを選択していないので、同じエラーです。 –

+0

eclipseを実行するプロジェクトクラスパス –

+0

まだ動作しません。私は日食を実行する:日食私は "によって引き起こさ:java.lang.ClassNotFoundException:com.querydsl.core.annotations.QueryEntities"。 –

関連する問題