Maven classpath order issues

后端 未结 2 1539
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-28 09:25

Does anyone know of a way to set a specific classpath order in Maven2, rather than the random ordering I appear to experience at the moment?

There are a number of le

2条回答
  •  眼角桃花
    2020-11-28 09:53

    As of version 2.0.9 maven uses pom order for classpath, so you can actually manipulate it now. We mostly supress transitive dependencies to external libraries that we also include directly.

    From the release notes of maven 2.0.9:

    MNG-1412 / MNG-3111 introduced deterministic ordering of dependencies on the classpath. In the past, natural set ordering was used and this lead to odd results. The ordering is now preserved from your pom, with dependencies added by inheritence added last. In builds that had conflicting or duplicate dependencies, this may introduce a change to the output. In short, if you have weird issues with 2.0.9, take a look at the dependencies to see if you have conflicts somewhere.

提交回复
热议问题