Hello.
Krishnan Mahadevan
Thank you for your answer.
I tried a few things after writing this issue.
I found something interesting.
I was denied my programming knowledge by this issue. :(
So I decided to give up the dependency resolution and add an explicit version.
Still, I did not want to specify the version directly in all dependent libraries, so I decided to add "selenium.version" as a temporary name to the property.
And I added it all to the dependent library.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.4</version>
<relativePath/>
</parent>
<groupId>com.example</groupId>
<artifactId>demo2</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Selenium Test</name>
<properties>
<selenium.version>4.1.2</selenium.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>${selenium.version}</version>
</dependency>
<!-- This spinet was not required.
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-api</artifactId>
<version>${selenium.version}</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>${selenium.version}</version>
</dependency>
...
-->
</dependencies>
</project>
And I compared the dependent:tree result without adding the dependent libraries added to confirm the behavior.
Both results were 4.1.2, and the dependent version was normally applied.
I was denied my knowledge again. :(
As a result of several tests, it worked normally only by adding the "selenium.version" property.
I didn't know why it works like this.
And I saw your answer.
And I looked at the parent node and you can find selenium.version property there. :)
spring-boot-dependencies had selenium.version properties and selenium's dependent libraries were declared.
It was overwritten by defining selenium.version in my pom.
Thanks to you I was able to erase my own misunderstanding too.
And it is not something to suggest here, but it would be better to add version property in selenium-java.
spring is Java's very famous framework and is also considering its dependency on selenium. Selenium is also a very famous framework, so it would be nice to consider the dependency on spring. Selenium can be defined as a selenium-version with the same property name and the dependent libraries version can be added as a property.
it will be very intuitive and beginners like me who try to upgrade to the Selenium4 will be able to relieve their worries.
Anyway, your answer was very helpful to me.
Thank you very much.
2022년 3월 15일 화요일 오후 6시 10분 2초 UTC+9에 Krishnan Mahadevan님이 작성: