即使添加了存储库,任何想法后依赖性错误?

时间:2014-05-11 19:35:03

标签: java spring maven

我在主pom.xml中添加了以下依赖项

         <dependency>    
            <groupId>javax.persistence</groupId>
            <artifactId>com.springsource.javax.persistence</artifactId>
            <version>2.0.0</version>
        </dependency>

并且还添加了以下插件存储库:

<pluginRepositories>

    <pluginRepository>
        <id>com.springsource.repository.bundles.release</id>
        <name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
        <url>http://repository.springsource.com/maven/bundles/release</url>
    </pluginRepository>

    <pluginRepository>
        <id>com.springsource.repository.bundles.external</id>
        <name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
        <url>http://repository.springsource.com/maven/bundles/external</url>
    </pluginRepository>

    <pluginRepository>
        <id>com.springsource.repository.bundles.milestone</id>
        <name>SpringSource Enterprise Bundle Repository - External Bundle Milestones</name>
        <url>http://repository.springsource.com/maven/bundles/milestone</url>
    </pluginRepository>

    <pluginRepository>
        <id>repository.jboss.org</id>
        <url>http://repository.jboss.org/maven2</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </pluginRepository>

    <pluginRepository>
        <id>download.java.net</id>
        <name>download.java.net</name>
        <url>http://download.java.net/maven/2</url>
    </pluginRepository>

    <pluginRepository>
        <id>snapshots.jboss.org</id>
        <url>http://snapshots.jboss.org/maven2</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </pluginRepository>

</pluginRepositories>

当我尝试使用maven构建此项目时,我收到此错误:

    [ERROR] Failed to execute goal on project crm-core: Could not resolve dependenci
es for project com.solveit.crm.core:crm-core:jar:1: Failure to find javax.persis
tence:com.springsource.javax.persistence:jar:2.0.0 in http://repo.maven.apache.o

rg/maven2 was cached in the local repository, resolution will not be reattempted
 until the update interval of central has elapsed or updates are forced -> [Help
 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyReso
lutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command

[ERROR]   mvn <goals> -rf :crm-core

任何想法为什么我会收到此错误?我知道它不在mvn中央存储库中,这就是为什么我添加了额外的存储库。

1 个答案:

答案 0 :(得分:0)

您很可能错过了Spring javax.persistence的正确存储库:

尝试将此添加到您的pom.xml:

<repository>
    <id>com.springsource.repository.bundles.release</id>
    <name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
    <url>http://repository.springsource.com/maven/bundles/release</url>
</repository>
<repository>
    <id>com.springsource.repository.bundles.external</id>
    <name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
    <url>http://repository.springsource.com/maven/bundles/external</url>
</repository>