Question

I have added the following dependency inside my main pom.xml

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

and the following plugin repositories have been added too:

<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>

When I am trying to build this project with maven, I get this error:

    [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

Any ideas why do I get this error? I know it is not in mvn central repository, that's why I have added additional repositories.

Was it helpful?

Solution

Most likely you're missing the right repository for Spring javax.persistence:

Try adding this to your 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>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top