搜尋
問答 java - svn maven專案的依賴不起作用
java - svn maven專案的依賴不起作用
大家讲道理 2017-04-18 10:56:18 查看 760

0

當我引用一個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>
请问我改怎么修改?
Your Answer
提交

4 個答案
0

可能是你parent專案沒導入到idea裡面, idea會去.m2/repository裡面找parent的pom, 如果你沒有把parent
in​​stall到本地倉庫的話, 會找不到parent的pom, 所以會找不到你依賴的jar包吧

2017-04-18 10:58:18

提交

0

包怎麼都不寫版本號碼的

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-validator</artifactId>
    <version>6.0.0.Alpha2</version>
</dependency>
2017-04-18 10:58:18

提交

0

version沒寫

2017-04-18 10:58:18

提交

0

先補完版本號,然後點選 “Maven Projects” 下面的左邊第一個按鈕刷新依賴關係。

2017-04-18 10:58:18

提交

Hot Tools

vc9-vc14(32+64位元)運行庫合集(連結在下方)

vc9-vc14(32+64位元)運行庫合集(連結在下方)

phpStudy安裝所需運行函式庫集合下載

VC9 32位

VC9 32位

VC9 32位元 phpstudy整合安裝環境運行庫

php程式設計師工具箱完整版

php程式設計師工具箱完整版

程式設計師工具箱 v1.0 php整合環境

VC11 32位

VC11 32位

VC11 32位元 phpstudy整合安裝環境運行庫

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用