How do I tell Maven to use the latest version of a dependency?

前端 未结 12 730
慢半拍i
慢半拍i 2020-11-21 11:37

In Maven, dependencies are usually set up like this:


  wonderful-inc         


        
12条回答
  •  鱼传尺愫
    2020-11-21 12:25

    The dependencies syntax is located at the Dependency Version Requirement Specification documentation. Here it is is for completeness:

    Dependencies' version element define version requirements, used to compute effective dependency version. Version requirements have the following syntax:

    • 1.0: "Soft" requirement on 1.0 (just a recommendation, if it matches all other ranges for the dependency)
    • [1.0]: "Hard" requirement on 1.0
    • (,1.0]: x <= 1.0
    • [1.2,1.3]: 1.2 <= x <= 1.3
    • [1.0,2.0): 1.0 <= x < 2.0
    • [1.5,): x >= 1.5
    • (,1.0],[1.2,): x <= 1.0 or x >= 1.2; multiple sets are comma-separated
    • (,1.1),(1.1,): this excludes 1.1 (for example if it is known not to work in combination with this library)

    In your case, you could do something like [1.2.3,)

提交回复
热议问题