Skip to content
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

Fix "module not found" error when using -J--release=11 option #199

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

aserkes
Copy link

@aserkes aserkes commented Mar 12, 2021

Fix "module not found" error when using -J--release=11 option

Copy link
Member

@lukasj lukasj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not the best way to resolve the problem. Consider this:

I have a project and one dependency is a module while the other is not. My module-info defines requires some-module; and javac command I would use in this case would look like javac --module-path some-module.jar --class-path otherlib.jar ... Now, if my project has a @WebService then running wsgen is going to fail because the otherlib.jar is not required by my project.

What I think would be better to:

  • add an option to fallback to existing behaviour (ie just use classpath for everything), option name on the command line could be ie -Xno-modules
  • by default put all required direct wsgen dependencies (except of ha-api for now) on the module path and the rest on the classpath
  • define new -modulepath option for wsgen tool itself (similar to existing -classpath)
  • pass the value of the new -modulepath option + all required direct wsgen dependencies (except of ha-api for now) to javac invocation as --module-path
  • pass the value of current -classpath + remaining dependencies to javac invocation as --class-path

adopt this change in the mvn plugin as needed

(or the first option could be -Xuse-modules to turn on the new behaviour ... which is probably better)

# Conflicts:
#	jaxws-ri/tools/wscompile/src/main/java/com/sun/tools/ws/wscompile/WsgenTool.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants