今天打算安裝阿里大于到自己的本地倉庫上痪伦,在官網(wǎng)下載了阿里大于的SDK( SDK及DEMO下載_SDK及DEMO下載_開發(fā)指南_短信服務(wù)-阿里云 )奉狈,下載之后,里面提供了兩個核心的Maven項目,將其安裝到本地倉庫便可以使用坐標啄栓。
但是铁追!但是!總是不能輕易讓你成功N鹁觥F固伞!安裝第一SDK的時候低缩,即maven項目的時候嘉冒,出現(xiàn)了如下報錯!咆繁!
用了渾身解數(shù)也沒有安裝成功讳推。
------------------------------------------------------- T E S T S-------------------------------------------------------Running com.aliyuncs.auth.AuthTestTests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.467 secRunning com.aliyuncs.auth.CredentialTestTests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 secRunning com.aliyuncs.auth.ShaHmac256TestTests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 secRunning com.aliyuncs.ClientExceptionTestjava.io.FileNotFoundException: C:\Users\?????\aliyun-sdk.properties (?????????????????)at java.io.FileInputStream.open(Native Method)at java.io.FileInputStream.(FileInputStream.java:146)at java.io.FileInputStream.(FileInputStream.java:101)at com.aliyuncs.BaseTest.getProperties(BaseTest.java:62)at com.aliyuncs.BaseTest.init(BaseTest.java:46)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:606)at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)at?
···
最后想到了一個辦法,既然他已經(jīng)給了jar包玩般,和現(xiàn)有的GAV坐標银觅,不借用idea,那我們可以手動安裝(DOS框安裝)坏为!于是查了如何手動給maven安裝jar文件究驴。這里有一個很好的文章Maven命令安裝jar包到本地倉庫 - CSDN博客。大家可以借鑒匀伏。
打開命令行洒忧,輸入如下命令? mvn install:install-file -Dfile=jar包的位置 -DgroupId=上面的groupId -DartifactId=上面的artifactId -Dversion=上面的version -Dpackaging=jar ?
于是成功將兩個jar安裝。
用阿里給的Demo够颠,填入相應(yīng)的信息熙侍,測試:
成功!B哪ァ核行!