且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

排除Maven依赖项

更新时间:2022-06-12 22:20:22

您可以使用依赖性管理机制.

如果您在< dependencyManagement>中创建条目,带有所需3.1.0版本集的spring-security-web和spring-web的pom部分中,工件的托管版本将覆盖传递依赖关系树中指定的版本.

If you create entries in the <dependencyManagement> section of your pom for spring-security-web and spring-web with the desired 3.1.0 version set the managed version of the artifact will override those specified in the transitive dependency tree.

我不确定这是否真的可以为您节省任何代码,但这是一种更干净的IMO解决方案.

I'm not sure if that really saves you any code, but it is a cleaner solution IMO.