-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Axxerion #5
base: master
Are you sure you want to change the base?
Axxerion #5
Conversation
This can occur when a project is built that does not compile code but where the plugin is used through a parent pom.
Previously the plugin instrumented only class files in the dependencies. Now it loads all the classes in the compile class path but instruments only the class files that are compiled in local maven project.
final List<String> classpathElements = getCompileClasspathElements(); | ||
loadClassPath(originalContextClassLoader, | ||
generateClassPathUrls(classpathElements)); | ||
transform(Arrays.asList(project.getBuild().getOutputDirectory())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume you have a "inline setup" in which you define maven-javassist-plugin in the project directly in order to replace the compiled classes with the altered version.
Your change does not take into account that the maven-javassist-plugin can also be used in a separate project so the altered classes are bundled in a separate jar. (See README.md)
private List<String> getCompileClasspathElements() | ||
throws DependencyResolutionRequiredException { | ||
List<?> ret = project.getCompileClasspathElements(); | ||
ret.remove(project.getBuild().getOutputDirectory()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for both type of setups
I have modified the plugin.
Previously the dependencies were instrumented but not the java classes compiled by the local java project.