java-web - 使用eclipse創建javaweb 項目 maven報錯
問題描述
使用eclipse創建 dynamic web project
在將項目轉換成maven項目時保如下錯誤
pom文件為eclipse 自動生成沒有改動 如下
<project xmlns='http://maven.apache.org/POM/4.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd'> <modelVersion>4.0.0</modelVersion> <groupId>test</groupId> <artifactId>test</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <build> <sourceDirectory>src</sourceDirectory> <plugins> <plugin><artifactId>maven-compiler-plugin</artifactId><version>3.5.1</version><configuration> <source>1.8</source> <target>1.8</target></configuration> </plugin> <plugin><artifactId>maven-war-plugin</artifactId><version>2.6</version><configuration> <warSourceDirectory>WebContent</warSourceDirectory> <failOnMissingWebXml>false</failOnMissingWebXml></configuration> </plugin> </plugins> </build></project>
目前已經試過以下方法 都不奏效
1.強行update項目,報錯同上
2.刪除.m2/repository下的.lastUpdated文件,clean項目之后 再update
3.將插件版本改為低版本2.0
搜索了好多也沒有找到答案 ,求高人指點===============settings.xml文件
<settings xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd'> <pluginGroups> </pluginGroups> <proxies> </proxies> <servers><server><id>releases</id><username>admin</username><password>admin123</password></server><server><id>snapshots</id><username>admin</username><password>admin123</password></server> </servers> <mirrors><mirror><id>nexus</id><mirrorOf>*</mirrorOf><url>http://192.168.15.1:8080/nexus/content/groups/public/</url></mirror> </mirrors> <profiles><profile><id>nexus</id><repositories><repository> <id>central</id> <url>http://192.168.15.1:8080/nexus/content/repositories/central/</url> <releases><enabled>true</enabled> <!-- <updatePolicy>always</updatePolicy>--> </releases> <snapshots><enabled>true</enabled> <!-- <updatePolicy>always</updatePolicy>--> </snapshots></repository></repositories><pluginRepositories><pluginRepository> <id>central</id> <url>http://192.168.15.1:8080/nexus/content/repositories/central/</url> <releases><enabled>true</enabled> <!-- <updatePolicy>always</updatePolicy>--> </releases> <snapshots><enabled>true</enabled> <!-- <updatePolicy>always</updatePolicy>--> </snapshots></pluginRepository></pluginRepositories></profile> </profiles> <activeProfiles><activeProfile>nexus</activeProfile> </activeProfiles></settings>
nexus頁面可以進入
問題解答
回答1:請檢查一下你們自己的nexus (192.168.15.1:8080/nexus) maven庫代理是否正常工作,確認一下nexus上有你需要的插件
相關文章:
1. python - 獲取到的數據生成新的mysql表2. javascript - js 對中文進行MD5加密和python結果不一樣。3. mysql里的大表用mycat做水平拆分,是不是要先手動分好,再配置mycat4. window下mysql中文亂碼怎么解決??5. sass - gem install compass 使用淘寶 Ruby 安裝失敗,出現 4046. python - (初學者)代碼運行不起來,求指導,謝謝!7. 為啥不用HBuilder?8. python - flask sqlalchemy signals 無法觸發9. python的文件讀寫問題?10. 為什么python中實例檢查推薦使用isinstance而不是type?
