6

I am trying to read the compile time classpath inside an AnnotationProcessor, but I cannot find out how.

My annotation processor needs to save the classpath of a build to file, so it can be used when analyzing this build by a third party library later...

How can I find the classpath? System.getProperty("java.class.path") will only find the classpath for the annotation processor, but I need the classpath for the build which is compiling.... suggestions?

I am trying to achieve this using maven...

jactor-rises
  • 2,395
  • 2
  • 22
  • 44
  • I'm wondering whether an annotation processor is the right tool for this kind of task. Maybe you'd be better of by writing a plug-in for your build tool, e.g. a Maven or Gradle plug-in? – Gunnar Nov 03 '16 at 21:03
  • 1. i am using the annotation processor to get all classes/methods with specific annotation 2. i need the classpath when analysing the call hierarchy of these annotations. 3. all i need to is to write the classpath to a file i can use when doing step 2 i would like to accomplish this without having to adding any more configuration to the maven build... – jactor-rises Apr 24 '17 at 18:02
  • 1
    Maybe this answer helps: https://stackoverflow.com/a/18323593/1555615 – Marinos An Aug 05 '19 at 08:42

0 Answers0