-
Notifications
You must be signed in to change notification settings - Fork 38
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
Plugin classpath used during JSP compilation #42
Comments
@ChristianMurphy My fix specifically resolved my issue with guava but it was not really a general solution for the issue. Clearly some of the plugin dependencies should not be on the JSP compilation path but I'm not sure where to start on that particular issue. |
@ksmith97 I'm not sure off the top of my head, that would require some research. |
The goal is that dependencies required for the plugin to execute should not exist on the classpath of the jsp compiler. To avoid issues like mine where a plugin jar overrode a project jar or a potential issue where the project is missing a dependency declaration but the plugin classpath accidentally supplies it(for example guava!) leaving you to explode at runtime. |
I have some free time so I am looking into what might have caused this issue. At a quick glance it looks like this shouldn't have been a problem in the first place since the classpath looks like it comes from project.compileClasspathElements and the documentation does not imply that this should contain plugin artifacts but its not super clear. I will probably need to write a test to verify that this is what is actually happening and debug it some before trying to fix it. Changing this is potentially breaking behavior although I cannot think of many reasons you would want a compile time dependency from the plugin on your classpath but maybe there is for some sort of compile time generation of code. |
Hey there! 👋 Thanks for opening an issue with jspc-maven-plugin. 👍 🙇♂️ Thanks again for contributing to the jspc-maven-plugin! ✨ |
I ran into this issue compiling JSPs with scriplets, where it was using a version of guava from the plugin dependency chain that was incompatible with the version in my project dependencies. It looks like the plugin dependencies are available at compile time and are in fact given preferential class loading preference.
I made a repo https://github.com/ksmith97/JSPC-issue to showcase the issue and how I fixed it for the guava case. I'm not sure if its possible to create a general solution but at the very least documenting it might help someone with a similar issue in the future.
I know scriplets are not good practice anymore but for some of us that just inherited a codebase with a large existing number of them we have to support them.
The text was updated successfully, but these errors were encountered: