-
-
Notifications
You must be signed in to change notification settings - Fork 764
docs: Describe transitive Selenium dependencies management #1827
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
Merged
valfirst
merged 1 commit into
appium:master
from
valfirst:document-transitive-selenium-dependencies-management
Jan 5, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Maven | ||
|
||
Maven downloads dependency of [the latest version](https://cwiki.apache.org/confluence/display/MAVENOLD/Dependency+Mediation+and+Conflict+Resolution#DependencyMediationandConflictResolution-DependencyVersionRanges) | ||
matching the declared range by default, in other words whenever new versions of Selenium 4 libraries are published | ||
they are pulled transitively as Appium Java Client dependencies at the first project (re)build automatically. | ||
|
||
In order to pin Selenium dependencies they should be declared in `pom.xml` in the following way: | ||
|
||
```xml | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.appium</groupId> | ||
<artifactId>java-client</artifactId> | ||
<version>X.Y.Z</version> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>org.seleniumhq.selenium</groupId> | ||
<artifactId>selenium-api</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>org.seleniumhq.selenium</groupId> | ||
<artifactId>selenium-remote-driver</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>org.seleniumhq.selenium</groupId> | ||
<artifactId>selenium-support</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.seleniumhq.selenium</groupId> | ||
<artifactId>selenium-api</artifactId> | ||
<version>A.B.C</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.seleniumhq.selenium</groupId> | ||
<artifactId>selenium-remote-driver</artifactId> | ||
<version>A.B.C</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.seleniumhq.selenium</groupId> | ||
<artifactId>selenium-support</artifactId> | ||
<version>A.B.C</version> | ||
</dependency> | ||
</dependencies> | ||
``` | ||
|
||
# Gradle | ||
|
||
Gradle uses [Module Metadata](https://docs.gradle.org/current/userguide/publishing_gradle_module_metadata.html) | ||
to perform improved dependency resolution whenever it is available. Gradle Module Metadata for Appium Java Client is | ||
published automatically with every release and is available on Maven Central. | ||
|
||
Appium Java Client declares [preferred](https://docs.gradle.org/current/userguide/rich_versions.html#rich-version-constraints) | ||
Selenium dependencies version which is equal to the lowest boundary in the version range, i.e. the lowest compatible | ||
Selenium dependencies are pulled by Gradle by default. It's strictly recommended to do not use versions lower than the | ||
range boundary, because unresolvable compilation and runtime errors may occur. | ||
|
||
In order to use newer Selenium dependencies they should be explicitly added to Gradle build script (`build.gradle`): | ||
|
||
```gradle | ||
dependencies { | ||
implementation('io.appium:java-client:X.Y.Z') | ||
implementation('org.seleniumhq.selenium:selenium-api:A.B.C') | ||
implementation('org.seleniumhq.selenium:selenium-remote-driver:A.B.C') | ||
implementation('org.seleniumhq.selenium:selenium-support:A.B.C') | ||
} | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.