Maven use <version> LATEST </ version> Automatic dependency problems caused by the latest version

Today, there have been problems in the process of compiling packaging project, the strange thing is that the project has not changed a long time, being given as follows.

Find symbol 
[ERROR] Symbol: Method Intent (java.lang.String) 
[ERROR] position: a variable of type com.paypal.orders.OrderRequest orderRequest 

find symbol 
[ERROR] Symbol: Method amount (com.paypal .orders.AmountWithBreakdown) 
[ERROR] location: class com.paypal.orders.PurchaseUnitRequest

The reason is that when using the LATEST version of the package set up external dependencies, so that each will try to pull the latest version of the package.

<dependency>
    <groupId>com.paypal.sdk</groupId>
    <artifactId>checkout-sdk</artifactId>
    <version>LATEST</version>
</dependency>

problem causes:

The wrong question very clearly, could not find a sdk method paypal, it is natural to put the question point-dependent version of the above, after some search found this package checkout-sdk time in July 2019 in the Maven repository released 1.0.1 version, this version is not compatible with older versions up on some of the features, resulting in a project depend on the sdk 1.0.0 version you are using, and then rely on a new version emerged after compilation problems.

找到问题原因之后,我们只需要把版本号改成原来的旧版本便可以了。

<dependency>
    <groupId>com.paypal.sdk</groupId>
    <artifactId>checkout-sdk</artifactId>
    <version>1.0.0</version>
</dependency>

建议

在依赖外部包的时候,版本号不要直接写LATEST,要使用固定的版本号,否则有可能出现包升级,导致不兼容的问题。 

Guess you like

Origin www.cnblogs.com/lingyejun/p/11286143.html