You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 18, 2022. It is now read-only.
I've created an APT maven project to generate some code. I've succesfully tested this code from Maven and all seems to work fine. However, whenever I use the m2e-apt plugin to run this from Eclipse, I get unexpected runtime-errors in the compilation process. The concrete exceptions differ largely from build-to-build, from execution-to-execution and from pc-to-pc, i.e. there is no real direct cause which I can define.
I've seen various ResourceExceptions where internal JDK code is complaining about the JAR file being correct (the same JAR which is used for the maven compilation, i.e. the JAR is fine), I've seen exceptions of files which cannot be loaded from the classpath (classLoader.getResourceAsStream() like calls which fail) and classcast exceptions (some velocity class does not implement an interface from velocity itself).
All these seem to indicate some classloading issue, however, I've got no idea where to start searching (running an Eclipse debug session right now), or how to fix this without diving headlong into the plugin code, so any advice is apprectiated.
RIght now I can see two possible solutions:
The m2e-apt plugin needs to fixes to handle classloading correctly
A (wild guess) might be if I implement some additional classes so this apt-plugin can also function as an eclipse plugin, so Eclipse knows how to handle the classloading issues correctly.
The text was updated successfully, but these errors were encountered:
m2e-apt does not perform any annotation processing, only project configuration, by default (When JDT APT) is used. Have you tried configuring maven-processor-plugin and delegating AP to maven (see preferences)? No idea if that'll fix your issue.
Yeah, i got that already :(. Have tried various approaches:
maven processor plugin
Setting Velocity to provided (so it's not on the classpath and I rely on Eclipse)
TCCL magic as described in the bug
I finally ended up creating an Eclipse plugin and needed to package Velocity itself with all deps in my plugin to force Eclipse to have all needed classes. Bummer, now I have to manually update all clients with that plugin, as rewriting it to not use Velocity wasn't really an option right now.
I'm aware of issue #18, thanks for the quick reply...
Hi,
I've created an APT maven project to generate some code. I've succesfully tested this code from Maven and all seems to work fine. However, whenever I use the m2e-apt plugin to run this from Eclipse, I get unexpected runtime-errors in the compilation process. The concrete exceptions differ largely from build-to-build, from execution-to-execution and from pc-to-pc, i.e. there is no real direct cause which I can define.
I've seen various ResourceExceptions where internal JDK code is complaining about the JAR file being correct (the same JAR which is used for the maven compilation, i.e. the JAR is fine), I've seen exceptions of files which cannot be loaded from the classpath (classLoader.getResourceAsStream() like calls which fail) and classcast exceptions (some velocity class does not implement an interface from velocity itself).
All these seem to indicate some classloading issue, however, I've got no idea where to start searching (running an Eclipse debug session right now), or how to fix this without diving headlong into the plugin code, so any advice is apprectiated.
RIght now I can see two possible solutions:
The text was updated successfully, but these errors were encountered: