m2eclipse - apt maven plugin fail to generate Q classes -


i fixing legacy project uses querydsl apt. reason apt-maven-plugin started fail. workaround found use alter ego maven-processor-plugin.

i have reinstalled maven, eclipse , m2e not success. maven-apt-plugin unable create q classes under /target/generated-sources/metamodel.

edit: adding debug maven

[debug] configuring mojo com.mysema.maven:apt-maven-plugin:1.0.8:process pl ugin realm classrealm[plugin>com.mysema.maven:apt-maven-plugin:1.0.8, parent: su n.misc.launcher$appclassloader@6d9bf996] [debug] configuring mojo 'com.mysema.maven:apt-maven-plugin:1.0.8:process' basic configurator --> [debug]   (s) logonlyonerror = true [debug]   (s) outputdirectory = c:\dev\myproject\mainstuff\mainstuff-jpa\target\generate d-sources\metamodel [debug]   (s) pluginartifacts = [com.mysema.maven:apt-maven-plugin:maven-plugin: 1.0.8:, org.sonatype.plexus:plexus-build-api:jar:0.0.7:compile, org.codehaus.ple xus:plexus-utils:jar:1.5.8:compile, backport-util-concurrent:backport-util-concu rrent:jar:3.1:compile, org.codehaus.plexus:plexus-interpolation:jar:1.11:compile , junit:junit:jar:3.8.1:compile] [debug]   (s) processor = com.mysema.query.apt.jpa.jpaannotationprocessor [debug]   (s) project = mavenproject: com.yreham.mainstuff:mainstuff-jpa:1.0  @ c:\dev\myproject\mainstuff\mainstuff-jpa\pom.xml [debug]   (s) sourceencoding = iso-8859-1 [debug] -- end configuration -- [debug] using build context: org.sonatype.plexus.build.incremental.defaultbuildc ontext@27bb2f11 [error] c:\dev\myproject\mainstuff\mainstuff-jpa\src\main\java\com\yreham\mainstuff\j pa\queries\instancesquery.java:40: error: cannot find symbol import com.yreham.mainstuff.jpa.entity.qcientity; 

some details of config m2e - maven integration eclipse 1.2.0.20120903-1050 org.eclipse.m2e.feature.feature.group eclipse.org - m2e

java version "1.7.0_15" java(tm) se runtime environment (build 1.7.0_15-b03) java hotspot(tm) 64-bit server vm (build 23.7-b01, mixed mode)

(the target build java 1.6)

here's old pom xml

<plugin> <groupid>com.mysema.maven</groupid> <artifactid>apt-maven-plugin</artifactid> <version>1.0.8</version> <executions>  <execution>    <goals>       <goal>process</goal>    </goals>   <configuration>    <outputdirectory>${apt.target.dir}</outputdirectory>    processor>com.mysema.query.apt.jpa.jpaannotationprocessor</processor>    <logonlyonerror>true</logonlyonerror>    </configuration>   </execution>  </executions> </plugin> 

the new pom bsc plugin

<plugin> <groupid>org.bsc.maven</groupid>  <artifactid>maven-processor-plugin</artifactid>   <version>2.0.5</version>    <executions>     <execution>      <id>process</id>      <goals>        <goal>process</goal>      </goals>   <phase>generate-sources</phase>    <configuration>   <outputdirectory>${apt.target.dir}</outputdirectory>     <processors>       <processor>com.mysema.query.apt.jpa.jpaannotationprocessor</processor>     </processors>                     </configuration>   </execution>  </executions>   <dependencies>    <dependency>      <groupid>org.hibernate</groupid>        <artifactid>hibernate-jpamodelgen</artifactid>         <version>1.2.0.final</version>         </dependency>     </dependencies>  </plugin> 

does project build in command line?

if doesn't, it'll fail build in eclipse too.

now if cli works, have tried install m2e-apt? it'll make annotation processing part of eclipse's incremental build process. see https://github.com/jbosstools/m2e-apt/ more details.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -