Running ClassGraph within custom rule in Maven Enforcer plugin doesn't find target/classes ? #752
Unanswered
lejtemxviw
asked this question in
Q&A
Replies: 2 comments 2 replies
-
Honestly I loathe Maven, it has caused me nothing but pain! But if I had to guess, you need to run the enforcer plugin in a later phase of the build. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Correct, |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! I am trying to write a custom rule for the Maven Enforcer plugin that uses ClassGraph to find classes of interest, then runs some validation logic on them to approve/fail the build. However, when I run this rule as part of a Maven build, ClassGraph outputs info listing all the jar files that are dependencies on the project - but doesn't include target/classes, which is where Maven just put all the compiled code. If I modify the ClassGraph construction to use
.overrideClasspath("target/classes")
then it does find all the classes in the current build - which is what I want, but it doesn include anything other than that folder, which I don't think I want to then ignore :-(.I did not find a way to just add
"target/classes"
to the list of classpath locations that ClassGraph will read - am I missing something here?Thank you!
Beta Was this translation helpful? Give feedback.
All reactions