DataStax Academy FAQ

DataStax Academy migrated to a new learning management system (LMS) in July 2020. We are also moving to a new Cassandra Certification process so there are changes to exam bookings, voucher system and issuing of certificates.

Check out the Academy FAQ pages for answers to your questions:


question

prateek.somaiya avatar image
prateek.somaiya asked ·

DSE Java Driver 2.2 (OSS 4.2) Annotation Processor

Having a tough time getting the annotation processor working in eclipse. I know it might work well in IntelliJ but I need to get it done in Eclipse. I have tried this and it is not working. I have also tried something like this and that too is not working, primarily because it's just hit and trial and I don't have the correct JAR name. The generated-sources directory is always empty after building the project.


Any help is appreciated


Using the latest eclipse for java developers

Eclipse IDE for Java Developers

Version: 2019-06 (4.12.0)

Build id: 20190614-1200

mapperannotation-processordse-java-driver-mapper
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

thanh.tran_37000 avatar image
thanh.tran_37000 answered ·

That problem is specific to Eclipse, or any IDE. As such, the answer is IDE-specific. For Eclipse, I've found that the annotation sources can be generated by installing m2e-apt from https://marketplace.eclipse.org/marketplace-client-intro?mpc_install=1216155

and using the info given here: https://developer.jboss.org/en/tools/blog/2012/05/20/annotation-processing-support-in-m2e-or-m2e-apt-100-is-out?_sscc=t

So, after installing m2e-apt, you have to go to the project's Properties -> Maven -> Annotation Processing and choose "Experimental"

because according to the documentation, "you can change the workspace or project preferences to delegate annotation processing to maven, instead of JDT APT. This will result in slower incremental builds (all classes will be processed) but will provide identical results to maven command line builds."

Keep in mind that the doc warns that this method "will result in slower incremental builds".

If you have still have problems, specific to Eclipse, please inquire with the Eclipse Community.

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.