Skip to content

Conversation

doublemarket
Copy link
Contributor

When starting a Selenium process in a container, the startup script invokes the java command with the -jar option. However, it's not possible to add classpaths when running a Selenium process even if we use the JAVA_OPTS because when the -jar option is used, the -cp option which provides classpaths is ignored. If we want to use a custom proxy or an add-on as a Jar file without changing a container, -cp is needed.

This pull request makes a change to the startup scripts to use -cp instead of -jar and introduce the JAVA_CLASSPATH environment variable to overwrite the default classpaths.

This shouldn't break existing usages without providing the JAVA_CLASSPATH environment variable.

Do you think this is valuable to have? If so, I'll update the README file as well.

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @doublemarket!
I think it makes sense, it simplyfies how people can add their own generated jars.
We can merge this PR when a proper documentation on how to use this env var is added to the PR.

@doublemarket
Copy link
Contributor Author

@diemol Thanks for reviewing and I've updated the README file with an example!

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

Thank you @doublemarket!

@diemol diemol merged commit e99d571 into SeleniumHQ:master Jun 26, 2019
@doublemarket doublemarket deleted the classpath-instead-jar branch June 27, 2019 01:21
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