annotation-processing

Forward compatible Java 6 annotation processor and SupportedSourceVersion

。_饼干妹妹 提交于 2020-01-01 03:56:06
问题 I am trying out Java 7 for one project and getting warnings from annotation processors (Bindgen and Hibernate JPA modelgen) of this sort: warning: Supported source version 'RELEASE_6' from annotation processor 'org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor' less than -source '1.7' This is caused by the @SupportedSourceVersion(SourceVersion.RELEASE_6) annotation on the annotation processor classes. Since they are compiled with Java 6, the highest value of SourceVersion available to

Annotation processor output in maven

和自甴很熟 提交于 2019-12-30 08:06:09
问题 I'm using JSR 269 as a way to analyze code during compilation and to fail it if needed. I'm having troubles with displaying output of my annotation processor in maven (Ant does show the output) I'm using javax.annotation.processing.Messager to display warnings and errors, but in maven I don't see it's output. (I do know it runs though, because it generates code like it should). Any ideas? 回答1: I think you are running into a Maven bug or better a bug in the compiler plugin - MCOMPILER-66. When

Difference between a GWT Generator and a Java Annotation Processor?

心已入冬 提交于 2019-12-24 22:30:32
问题 GWT uses Generator to create code before everything is translated into JavaScript. Java on the other hand has an annotation processor which generates code before everything is translated into byte code. What is the difference between a GWT Generator and a Java Annotation Processor? 回答1: GWT generators not only generate code, they also tell GWT to use it; whereas annotation processors only generate code that then needs to be used by some other code (either referenced directly in the code, or

Nested Target in MapStruct (Using Lombok) not working fluently

て烟熏妆下的殇ゞ 提交于 2019-12-24 19:16:19
问题 I am trying to use Mapstruct to do some nested mapping and with Lombok. As according to their latest specification mapstruct 1.2 works out of the box with Lombok. Here is my code: Source Classes @Builder @Getter @Setter public class PojoA { private String stringA; private int integer; private PojoB pojoB; } @Builder @Getter @Setter public class PojoB { private long aLong; private String string; private PojoC pojoC; } @Builder @Getter @Setter public class PojoC { private int value; } Target

Using Aspectj compile time weaving and Java compile time annotation processing in one project

橙三吉。 提交于 2019-12-24 09:52:48
问题 I have searched far and wide and have not found anything that would help me resolve my problem. I am trying to implement a certain functionality and I am creating a PoC solution, here is the issue though: it involves using both compile time weaved AspectJ and compile time annotation processors and I have no idea how to make both of those work at the same time. So far I have been using just AspectJ aspects in *.aj files with the aspectj-maven-plugin, and it was working fine. As soon as I tried

How to Run Annotation Processor without compiling sources using javac (Java 8 can't use Apt)

拟墨画扇 提交于 2019-12-23 11:52:35
问题 How can i Run Annotation Processor without compiling sources using javac (Java 8 can't use Apt)? Is there any parameter for javac that could run only annotation processing without compiling all files? What i want to do by javac: Just find annotated elements and process them using defined annotation processor using -processor flag do not compile any source that doesn't have any annotation Because i want do this on Java 8 it's impossible to use Apt for this task? Or maybe it is? 回答1: The apt

Maven annotation processing processor not found

爱⌒轻易说出口 提交于 2019-12-23 08:54:58
问题 I'm new to annotation processing and I'm trying to automating it with Maven. I've put this in my pom.xml: <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.0</version> <configuration> <annotationProcessors> <annotationProcessor> co.aurasphere.revolver.annotation.processor.InjectAnnotationProcessor</annotationProcessor> <annotationProcessor> co.aurasphere.revolver.annotation.processor.RevolverContextAnnotationProcessor<

How to trigger the minimal task on Gradle to run apt plugin

放肆的年华 提交于 2019-12-23 05:37:11
问题 I'm creating a compile-time annotation processor to generate some code on Android. To trigger the annotation processor I'm using the android-apt plugin from hvisser https://bitbucket.org/hvisser/android-apt/overview At the moment, on every change I do on my Processor extends AbstractProcessor I have to run a full /.gradlew clean build to see the results, and that is kinda of a slow process, even for a tiny sample project. So my question, is there any of the gradlew tasks I could use to

Why does the package-info.java file affect annotation-processing?

那年仲夏 提交于 2019-12-23 05:16:36
问题 Adding a package-info.java file to the project, causes annotation-processors to create different output. I don't understand why this happens. I think adding the package-info.java file should not affect my build at all, because it does not contain any fancy stuff (like Annotations, etc.). It only contains the simplest package declaration: package com.example; I've managed to create a minimal project to reproduce the issue with javac only. The project has too much code to post here on

Immutables-library generates the same immutable class twice

安稳与你 提交于 2019-12-22 11:33:47
问题 When using the immutables.io annotation processor in a multi-module android app, the build fails, when a package-info.java file is used. I've managed to build a minimal test-project on GitHub to reproduce the issue: ImmutablesPackageInfoIssue The project consists of 2 modules: app: android application: @Value.Immutable is used in AndroidIm.java lib: java module: @Value.Immutable is used in JavaIm.java So basically, using immutables.io in both modules works fine. But when we add a package-info