maven parent 覆盖,覆盖父pom依赖

I made a simple EAR project with maven and wildfly, but I have some problems with obsolete dependencies.

Project structure is like:

Project

--EarProject

--BaseProject

--WarProject

--EjbProject

In parent Project's pom there is dependency:

org.wildfly.bom

jboss-javaee-7.0-with-tools

${version.jboss.bom}

pom

import

And in BaseProject's pom I use Selenium:

org.seleniumhq.selenium

selenium-java

org.seleniumhq.selenium

selenium-remote-driver

The problem is that in BaseProject Maven libraries I see older versions of Selenium (ie. selenium-firefox-driver 2.40.0 instead of newer 2.44.0) and because of bugs in 2.40.0 my app does not work corectly.

I tried to add:

2.44.0

in BaseProject's pom, but I got warning like

Overriding managed version 2.40.0 for selenium-remote-driver

and it does not work.

How can I override version of dependency from parent's pom or exclude selenium from jboss-javaee-7.0-with-tools dependency?

解决方案How can I override version of dependency from parent's pom

The "Overriding managed version 2.40.0 for selenium-remote-driver" warning is a just a m2e warning not a Maven warning. With your code, you are correctly overriding the version of the dependency of the parent's pom. See this bug at Eclipse site for m2e about this warning. You can assert that by looking at the dependency tree (in Eclipse or with the mvn dependency:tree command)

or exclude selenium from jboss-javaee-7.0-with-tools dependency?

You can do that with the exclusions tag. It is a tag where you specify each groupId and artifactId that you want to exclude from the transitive dependencies resolved by Maven.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值