1. 程式人生 > >【maven】maven 新建專案報錯

【maven】maven 新建專案報錯

【問題描述】

報錯:

Could not calculate build plan: Pluginorg.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependenciescould not be resolved: Failed to read artifact descriptor fororg.apache.maven.plugins:maven-resources-plugin:jar:2.5 

Pluginorg.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependenciescould not be resolved: Failed to read artifact descriptor fororg.apache.maven.plugins:maven-resources-plugin:jar:2.5

【官網提示】

This erroroccurs when you employ a plugin that Maven could not download. Possible causesfor this error are:

  1. You are referring to a non-existing plugin, e.g. by means of a typo in its group id, artifact id or version.
  2. You are using a third-party Maven plugin that is not deployed to the central Maven repository and your POM/settings is missing the required <pluginRepository> to download the plugin. Note that <repository> declarations are not considered when looking for the plugin and its dependencies, only <pluginRepositories> are searched for plugins.
  3. The plugin repository you have configured requires authentication and Maven failed to provide the correct credentials to the server. In this case, make sure your${user.home}/.m2/settings.xml contains a <server> declaration whose <id> matches the <id> of the plugin repository to use. See the 
    Maven Settings Reference for more details.
  4. There is a general network problem that prevents Maven from accessing any remote repository, e.g. a missing proxy configuration.
  5. Maven failed to save the files to your local repository, see LocalRepositoryNotAccessibleException for more details.
  6. The plugin repository you have configured is disabled for the specific version of the plugin you requested. For instance, if you want to use a SNAPSHOT version of a plugin, make sure you don't have <snapshots><enabled>false</enabled></snapshots> configured. Likewise, in order to resolve a released version of the plugin, the plugin repository should not be configured with <releases><enabled>false</enabled></releases>. See the POM Reference for more information on repository configuration.

【翻譯】 

            主要就是說拉去不了jar包,具體官網給出了6種可能:

             1. 你引用了一個不存在的外掛

             2.你引用了一個第三方maven外掛,中央倉庫裡沒有。

             3.你配置的遠端倉庫需要認證,但是你沒有許可權

             4.網路問題,你連線不到遠端倉庫

             5.maven不能向你配置的本地倉庫中儲存檔案

             6.你配置的外掛倉庫不支援你需要的外掛版本。如果你要使用的是一個映象版本,要確保settings標籤裡 不是 <snapshots><enabled>false</enabled></snapshots> 同樣,<releases><enabled>false</enabled></releases>.這個也不行。

【解決方案】

       我出現這個錯誤的原因是Settings 裡沒有配置中央倉庫,之前做專案時只配置了私服,本地沒有的jar包都是由私服拉取的。 這會自己敲例子用到的jar包私服上沒有,於是就出現了這個錯誤。配置好中央倉庫就沒問題了。

<repositories>  
                    
                <!--包含需要連線到遠端倉庫的資訊  -->  
                <repository>  
                        
                    <!--遠端倉庫唯一標識 -->  
                    <id>central</id>  
                        
                    <!--遠端倉庫名稱  -->  
                    <name>Central</name>  
                        
                    <!--如何處理遠端倉庫裡釋出版本的下載 -->  
                    <releases>  
                            
                        <!--true或者false表示該倉庫是否為下載某種型別構件(釋出版,快照版)開啟。   -->  
                        <enabled>false</enabled>  
                            
                        <!--該元素指定更新發生的頻率。Maven會比較本地POM和遠端POM的時間戳。這裡的選項是:-->  
                        <!--always(一直),daily(預設,每日),interval:X(這裡X是以分鐘為單位的時間間隔),或者never(從不)。  -->  
                        <updatePolicy>always</updatePolicy>  
                            
                        <!--當Maven驗證構件校驗檔案失敗時該怎麼做:-->  
                        <!--ignore(忽略),fail(失敗),或者warn(警告)。 -->  
                        <checksumPolicy>warn</checksumPolicy>  
                               
                    </releases>  
                        
                    <!--如何處理遠端倉庫裡快照版本的下載。有了releases和snapshots這兩組配置,POM就可以在每個單獨的倉庫中,為每種型別的構件採取不同的策略。-->  
                    <!--例如,可能有人會決定只為開發目的開啟對快照版本下載的支援。參見repositories/repository/releases元素 -->  
                    <snapshots>  
                                
                        <enabled />  
                        <updatePolicy />  
                        <checksumPolicy />  
                               
                    </snapshots>  
                        
                    <!--遠端倉庫URL,按protocol://hostname/path形式  -->  
                    <url>http://repo.maven.apache.org/maven2</url>  
                        
                    <!--用於定位和排序構件的倉庫佈局型別-可以是default(預設)或者legacy(遺留)。-->  
                    <!--Maven 2為其倉庫提供了一個預設的佈局;然而,Maven 1.x有一種不同的佈局。我們可以使用該元素指定佈局是default(預設)還是legacy(遺留)。  -->  
                    <layout>default</layout>  
                          
                </repository>  
                     
            </repositories> 

相關推薦

關於maven本地倉庫新建專案的解決

我設定的是自己的setting.xml建立的本地倉庫 建立專案的時候pom。xml裡面顯示在  <packaging>jar</packaging>一行有個錯誤,而在建立maven專案的時候開始就會報錯顯示啥map什麼的對映有問題。解決方法如下:

mavenmaven 新建專案

【問題描述】 報錯: Could not calculate build plan: Pluginorg.apache.maven.plugins:maven-resources-plugin:2.

windows遠程桌面:由於CredSSP加密Oracle修正

加密 紅色 system win software 打開 mic red ssp 對於windows家庭版用戶,無法打開gepdit.msc需要手動修改註冊表 創建紅色部分目錄 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\C

Ionic新建專案:OpenSSH not found on your computer.

錯誤資訊: D:\project\eyeshot\eyeshot>ionic ssh setup [WARN] OpenSSH not found on your computer. [ERROR] Command not found: ssh 解決辦法: 下載安裝SSH:http

Mysql 解決MySQL8.0:Unknown system variable 'validate_password_policy'

author:咔咔 wechat:fangkangfk   問題所在一個是  _  連線的一個是  .  連線的   一、問題描述 1、在安裝MySQL8.0時,修改臨時密碼,因密碼過於簡單(如:123456),

轉載讀取txt檔案:UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc8 in position 0

python在open讀取txt檔案時,出現UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xc8 in position 0: invalid continuation byte報錯 解決辦法有二: ①把編碼方式utf-8

easyuieasyui datagrid deleteRow修復

報錯資訊 當在easyui中,只在前臺進行資料刪除時,會發生一個bug報錯。 報錯程式碼如下圖: Uncaught TypeError: Cannot read property 'code' of undefined 有個哥們兒通過修改easyui的基礎js修復了該bug

Errordocker中pwndbg Error disabling address space randomization: Operation not permitted

在docker中安裝pwndbg,除錯時遇到了如下報錯: warning: Error disabling address space randomization: Operation not permitted 解決辦法: docker建立container時加入--priv

OpenFire連線Mysql8.0解決方案。

前面步驟就是先裝Mysql8.0. 然後建資料庫Openfire, 然後Mysql匯入Openfire  XX:\Openfire\resources\database  mysql指令碼,執行可能報錯,sql指令碼自己去檢查排除,我的反正發現是 rank跟mysql的

oracle impdp匯入資料ORA-29283: invalid file operation

oracle impdp匯入資料報錯ORA-29283: invalid file operation ORA-39002: invalid operation ORA-39070: Unable t

Android R.layout.main問題

剛剛開始玩Android,學習過程中複製貼上了一部分程式碼,沒想到就出了問題,一直在R.layout.main那兒報錯,在網上找了方法,什麼升級SDK,重新整理工程都沒用。 後來在res這個資料夾下的layout資料夾下面看到只有activity_main這個東西, 於是將

AndroidStudio新建專案

Unable to resolve dependency for ':[email protected]/compileClasspath': Could not resolve com.google.android.gms:play-services-maps:11.8.0 &nbs

AndroidStudio新建專案Conflict with dependency 'com.android.support:support-annotations'in project 解決方案

錯誤提示如下: Error:Execution failed for task ‘:app:preDebugAndroidTestBuild’. Conflict with dependenc

VirtualBox啟動虛擬機器:ALSA lib(音效卡問題)

錯誤資訊 ALSA lib confmisc.c:768:(parse_card) cannot find card '0' ALSA lib conf.c:4259:(_snd_config_eva

新建專案,Failed to execute appt 錯誤,導致R檔案的解決辦法

錯誤的問題: Error:FAILURE: Build failed with an exception. // What went wrong: Execution failed for task

Python“pandas”庫“to_sql”“Invalid MySQL identifier”處理記錄

     最近又要幫客戶寫指令碼拉一份統計日報,就先把一堆一堆的小SQL寫好測好後,準備用Python封裝一下。但是用到第三方“pandas”模組的“to_sql”方法往MySQL資料庫寫資料時,卻報了“Invalid MySQL identifier”無效識別符號的錯。

流水啟動hdfs的ssh: connect to host master port 22: Connection timed out

報錯如下: [[email protected] sbin]$ ./start-dfs.sh 18/01/24 22:46:38 WARN util.NativeCodeLoader: Unable to load native-hadoop library fo

django新建專案python: can't open file 'manage.py': [Errno 2] No such file or directory

今天遇到此問題,一直報錯,不知道怎麼結果,網上我能找到的方式都試過了,還是不可以在pycharm下方的terminal終端中輸入命令:cd mysite 然後回車就可以了接著在pycharm下方的terminal終端中輸入命令:python manage.py startap

ionic3 新建專案Network connectivity error occurred, are you offline?

1.安裝 @ionic/cli-plugin-proxy // npm install -g @ionic/cli-plugin-proxy 2.如果仍未解決,請嘗試更新最新的 npm // npm

新建專案 Failed to execute aapt

很久沒做安卓開發了,以前開發安卓的使用大多用的是eclipse,覺得也挺方便的。不過既然谷歌推薦使用android studio,也有他的道理,於是就嘗試一下。沒想到,裝了android studio 後,新建專案,報錯 Error:FAILURE: Build faile