Closed bennixview closed 12 years ago
Could you try with Java 7.0.7? All the getElementsAnnotatedWith calls seem to fail.
Same Exception
java -version java version "1.7.0_07" Java(TM) SE Runtime Environment (build 1.7.0_07-b10) Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)
also with plugin version 1.0.4
This is caused by the following entry
<sourceDirectory>${project.basedir}</sourceDirectory>
Remote it, and your build will pass.
THX
It works for my little example here : https://github.com/bennixview/apt-java7. But in my other project i've got the same exception after removeing the
mvn help:effective-pom shows the same plugin configuration on both projects
I don't have any idea
Ok, I will make some further tests. Could you maybe try modifying the example project to be more similar to your real projects?
Ok, I made another example as an multi-maven Module and a src/main/java Folder for Entities and a src-gen/main/java for the Base-Classes of the Entities. I added the
beacause the plugin does not find the Base - Classes in the src-gen Folder.
It is something with the
The sourceDirectory needs to be directory where sources are directly placed in, not an ancestor directory. Do the builds fail without it? I haven't yet had the time to run them, but the parameter is misused, the default is src/main/java under the project.
No, :
--- maven-apt-plugin:1.0.4:process (default) @ apt-java7-entity-impl ---
..........OtherThingImpl.java:8: error: cannot find symbol
public class OtherThingImpl extends OtherThingBase {
....
symbol: class OtherThingBase
Ok, the problem you had was related to having multiple source directories, I fixed that by reading the source directories directly from the injected Maven project.
The version 1.0.5 works, it will be in the central repositories in about 2 hours.
Also the artifactId changed from maven-apt-plugin to apt-maven-plugin, since maven-* artifact ids are now reserved for Maven's own plugins.
Vielen Dank :-),
it works perfect!
Nichts zu danken ;)
Hi,
when compiling my project with java 7.0.6 i had the following NullPointerException in mysema-apt-plugin. As an example project I have checked in the following : https://github.com/bennixview/apt-java7
[INFO] --- maven-apt-plugin:1.0.3:process (default) @ apt-java7 --- [ERROR] execute error java.lang.RuntimeException: java.lang.NullPointerException at com.sun.tools.javac.main.Main.compile(Main.java:469) at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:132) at com.mysema.maven.apt.AbstractProcessorMojo.execute(AbstractProcessorMojo.java:205) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) Caused by: java.lang.NullPointerException at com.mysema.query.codegen.SimpleSerializerConfig.getConfig(SimpleSerializerConfig.java:29) at com.mysema.query.apt.DefaultConfiguration.(DefaultConfiguration.java:129)
at com.mysema.query.apt.jpa.JPAConfiguration.(JPAConfiguration.java:63)
at com.mysema.query.apt.jpa.JPAAnnotationProcessor.createConfiguration(JPAAnnotationProcessor.java:45)
at com.mysema.query.apt.AbstractQuerydslProcessor.process(AbstractQuerydslProcessor.java:94)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:793)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:722)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1700(JavacProcessingEnvironment.java:97)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1029)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1163)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1108)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)
at com.sun.tools.javac.main.Main.compile(Main.java:439)
... 23 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.566s
[INFO] Finished at: Tue Aug 28 20:59:57 CEST 2012
[INFO] Final Memory: 10M/150M