java - svn maven項目的依賴不起作用
問題描述
當我引用一個svn的maven項目時,我么maven projects下沒有maven依賴,項目中也沒有對應的jar。
pom.xml文件代碼
<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/maven-v4_0_0.xsd'> <parent><artifactId>meetmecarv2</artifactId><groupId>com.meetmecar</groupId><version>1.0</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>meetmecar_test</artifactId> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> <name>meetmecar_test Maven Webapp</name> <url>http://maven.apache.org</url> <dependencies><dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope></dependency><dependency> <groupId>junit</groupId> <artifactId>junit</artifactId></dependency><dependency> <groupId>com.meetmecar</groupId> <artifactId>meetmecar-service</artifactId></dependency><dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <scope>provided</scope></dependency><dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> <scope>provided</scope></dependency><dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId></dependency><dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId></dependency> </dependencies> <build><finalName>meetmecar_test</finalName> </build></project>請問我改怎么修改?
問題解答
回答1:可能是你parent項目沒導入到idea里面, idea會去.m2/repository里面找parent的pom, 如果你沒有把parent install到本地倉庫的話, 會找不到parent的pom, 所以會找不到你依賴的jar包吧
回答2:包怎么都不寫版本號的<dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>6.0.0.Alpha2</version></dependency>回答3:
version沒寫
回答4:首先補完版本號,然后點擊 “Maven Projects” 下面的左邊第一個按鈕刷新依賴關系。
相關文章:
1. html - vue項目中用到了elementUI問題2. 對mysql某個字段監控的功能3. javascript - windows下如何使用babel,遇到了困惑4. javascript - js中向下取整5. JavaScript事件6. showpassword里的this 是什么意思?代表哪個元素7. java - input file類型上傳了一個文件,想計算一下上傳文件的大小?8. java - Spring MVC怎么實現提交表單后跳轉?9. python - 為什么正常輸出中文沒有亂碼,zip函數之后出現中文編程unicode編碼的問題,我是遍歷輸出的啊。10. javascript - table列過多,有什么插件可以提供列排序和選擇顯示列的功能
