简体   繁体   中英

How to compile by maven classes exclude Annotation

I have maven module where defined JPA Entities with EntityListeners, these entities will used on other GUI project , this entities will be transferred using RMI or EJB, but I do not want provide to GUI project any information about Annotation of this entities and EventityListeners and include dependents JPA to GUI project.

Is it possible to compile first module without Annotation and add depends clear jar to GUI? and will it be correct restored Entity after transfer from server(annotated) module on GUI part ?

Annotations are not stored in the classes when the retention policy is not RUN TIME. Hence if you could use an alternative jar to redefine these annotations, it would be possible.

A more feasible solution would be setting the target Java version for compilation to the one before run time annotations (< Java 1.5).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM