[jira] [Comment Edited] (NETBEANS-22) Sources generated by Annotation Processor through Maven are not on classpath of Java Editor
[ https://issues.apache.org/jira/browse/NETBEANS-22?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16789553#comment-16789553 ] René Kraneis edited comment on NETBEANS-22 at 3/11/19 1:37 PM: --- At least for auto-value there is a work-around: having had auto-value defined as a project dependency (compile or provided scope) only once seems to fix the problem for this project. After that it can be reconfigured as a dependency in annotationProcessorPaths in maven-compiler-plugin configuration. If I find the time I will also test with the projects attached to the issue using immutables and not auto-value. Edit: This was tested on NetBeans 10 and 11vc3 Edit2: The work-around works as long as no file containing the annotations is opened in the editor again. was (Author: rkraneis): At least for auto-value there is a work-around: having had auto-value defined as a project dependency (compile or provided scope) only once seems to fix the problem for this project. After that it can be reconfigured as a dependency in annotationProcessorPaths in maven-compiler-plugin configuration. If I find the time I will also test with the projects attached to the issue using immutables and not auto-value. Edit: This was tested on NetBeans 10 and 11vc3 > Sources generated by Annotation Processor through Maven are not on classpath > of Java Editor > --- > > Key: NETBEANS-22 > URL: https://issues.apache.org/jira/browse/NETBEANS-22 > Project: NetBeans > Issue Type: Bug > Components: apisupport - Maven >Affects Versions: 8.2, 9.0, 10.0, 11.0 >Reporter: Dave Schoorl >Priority: Major > Labels: annotation-processor, java-editor, maven > Attachments: mvn_immut.zip, mvn_meta.zip > > > I have attached two simple maven projects that use an Annotation Processor. > The project mvn_immut uses the Immutables framework to generate immutable > implementations from an interface. The project mvn_meta uses the JPA > Metamodel AP. Both projects have a simple class or interface, Book.java, with > annotations and a class with a main-method, that interacts with the sources > generated by the AP (E.g. print something to System.out). > 'Clean and Build' and 'Run' work without a problem. I see a Generated Sources > node appearing, containing the expected sources and when inspecting the > target/classes directory, I see the class files of my handwritten code and of > the generated code. However, the source file that uses the generated source, > does not compile, as the java editor does not recognize the AP generated > sources. > I file this report under Maven component, because if I have the exact same > source files in an Ant based project, there are no compilation problems. > It appears to me that issue > https://netbeans.org/bugzilla/show_bug.cgi?id=217556 is related to this one. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Comment Edited] (NETBEANS-22) Sources generated by Annotation Processor through Maven are not on classpath of Java Editor
[ https://issues.apache.org/jira/browse/NETBEANS-22?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16789553#comment-16789553 ] René Kraneis edited comment on NETBEANS-22 at 3/11/19 1:27 PM: --- At least for auto-value there is a work-around: having had auto-value defined as a project dependency (compile or provided scope) only once seems to fix the problem for this project. After that it can be reconfigured as a dependency in annotationProcessorPaths in maven-compiler-plugin configuration. If I find the time I will also test with the projects attached to the issue using immutables and not auto-value. Edit: This was tested on NetBeans 10 and 11vc3 was (Author: rkraneis): At least for auto-value there is a work-around: having had auto-value defined as a project dependency (compile or provided scope) only once seems to fix the problem for this project. After that it can be reconfigured as a dependency in annotationProcessorPaths in maven-compiler-plugin configuration. If I find the time I will also test with the projects attached to the issue using immutables and not auto-value. > Sources generated by Annotation Processor through Maven are not on classpath > of Java Editor > --- > > Key: NETBEANS-22 > URL: https://issues.apache.org/jira/browse/NETBEANS-22 > Project: NetBeans > Issue Type: Bug > Components: apisupport - Maven >Affects Versions: 8.2, 9.0, 10.0, 11.0 >Reporter: Dave Schoorl >Priority: Major > Labels: annotation-processor, java-editor, maven > Attachments: mvn_immut.zip, mvn_meta.zip > > > I have attached two simple maven projects that use an Annotation Processor. > The project mvn_immut uses the Immutables framework to generate immutable > implementations from an interface. The project mvn_meta uses the JPA > Metamodel AP. Both projects have a simple class or interface, Book.java, with > annotations and a class with a main-method, that interacts with the sources > generated by the AP (E.g. print something to System.out). > 'Clean and Build' and 'Run' work without a problem. I see a Generated Sources > node appearing, containing the expected sources and when inspecting the > target/classes directory, I see the class files of my handwritten code and of > the generated code. However, the source file that uses the generated source, > does not compile, as the java editor does not recognize the AP generated > sources. > I file this report under Maven component, because if I have the exact same > source files in an Ant based project, there are no compilation problems. > It appears to me that issue > https://netbeans.org/bugzilla/show_bug.cgi?id=217556 is related to this one. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Comment Edited] (NETBEANS-22) Sources generated by Annotation Processor through Maven are not on classpath of Java Editor
[ https://issues.apache.org/jira/browse/NETBEANS-22?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16602169#comment-16602169 ] René Kraneis edited comment on NETBEANS-22 at 9/3/18 1:28 PM: -- I have created two minimal projects, that show which configuration of annotation processors works with NetBeans and which doesn't: [https://github.com/rkraneis/annotation-processing] * if just added as a “provided” dependencies, annotation processors like auto-value, dagger or checkerframework are picked up correctly by NetBeans * if configured via annotationProcessorPaths, they are not picked up was (Author: rkraneis): I have created two minimal projects, that show which configurations of annotation processors work with NetBeans: [https://github.com/rkraneis/annotation-processing] > Sources generated by Annotation Processor through Maven are not on classpath > of Java Editor > --- > > Key: NETBEANS-22 > URL: https://issues.apache.org/jira/browse/NETBEANS-22 > Project: NetBeans > Issue Type: Bug > Components: apisupport - Maven >Affects Versions: 8.2, 9.0 >Reporter: Dave Schoorl >Priority: Major > Labels: annotation-processor, java-editor, maven > Attachments: mvn_immut.zip, mvn_meta.zip > > > I have attached two simple maven projects that use an Annotation Processor. > The project mvn_immut uses the Immutables framework to generate immutable > implementations from an interface. The project mvn_meta uses the JPA > Metamodel AP. Both projects have a simple class or interface, Book.java, with > annotations and a class with a main-method, that interacts with the sources > generated by the AP (E.g. print something to System.out). > 'Clean and Build' and 'Run' work without a problem. I see a Generated Sources > node appearing, containing the expected sources and when inspecting the > target/classes directory, I see the class files of my handwritten code and of > the generated code. However, the source file that uses the generated source, > does not compile, as the java editor does not recognize the AP generated > sources. > I file this report under Maven component, because if I have the exact same > source files in an Ant based project, there are no compilation problems. > It appears to me that issue > https://netbeans.org/bugzilla/show_bug.cgi?id=217556 is related to this one. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists