Announcement Announcement Module
Collapse
No announcement yet.
Maven issue with Spring Data Neo4j 2.0.0.RELEASE Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Maven issue with Spring Data Neo4j 2.0.0.RELEASE

    I have a pom file that has dependency set to 2.0.0.RELEASE for Spring Data Neo4j. However, for some reason it is trying to download Spring Data Commons 1.2.0.RC1 instead of data commons 2.0.0.RELEASE. Not sure why? I don't need to use any Milestone or Snapshots and I have removed those repositories from my pom file, mainly because something in my pom (which isn't there) is trying to download all the pom files for Spring 3.1 including all milestones etc. To be honest the pom file was generated by Spring Roo, but I have a really good command of Maven pom files that I could spot something totally out of the ordinary. Here is the maven console


    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 4.320s
    [INFO] Finished at: Wed Jan 11 00:26:59 PST 2012
    [INFO] Final Memory: 4M/81M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal on project eventgate: Could not resolve dependencies for project com.perfectworldprogramming.eventgate:eventgate:wa r:0.1.0: Could not find artifact org.springframework.data:spring-data-commons-core:jar:1.2.0.RC1 in spring-maven-release (http://maven.springframework.org/release) -> [Help 1]


    I would post my pom file, but you know how long those can be, so it will just have to be key parts.

    Code:
    <properties>
            <spring.version>3.0.7.RELEASE</spring.version>
            <aspectj.version>1.6.12</aspectj.version>
            <slf4j.version>1.6.1</slf4j.version>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <spring-data-neo4j.version>2.0.0.RELEASE</spring-data-neo4j.version>
            <neo4j.version>1.5</neo4j.version>
            <spring-security.version>3.0.7.RELEASE</spring-security.version>
        </properties>
        <repositories>
            <repository>
                <id>spring-maven-release</id>
                <name>Spring Maven Release Repository</name>
                <url>http://maven.springframework.org/release</url>
            </repository>
            <repository>
                <id>neo4j-public-repository</id>
                <url>http://m2.neo4j.org/</url>
                <name>Publicly available Maven 2 repository for Neo4j</name>
            </repository>
            <!--repository>
                <id>spring-maven-milestone</id>
                <url>http://maven.springframework.org/milestone</url>
                <name>Spring Framework Maven MILESTONE Repository</name>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </repository>
            <repository>
                <id>spring-maven-snapshot</id>
                <url>http://maven.springframework.org/snapshot</url>
                <name>Springframework Maven SNAPSHOT Repository</name>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </repository-->
        </repositories>
        <pluginRepositories>
            <pluginRepository>
                <id>spring-maven-release</id>
                <name>Spring Maven Release Repository</name>
                <url>http://maven.springframework.org/release</url>
            </pluginRepository>
            <!--pluginRepository>
                <id>spring-maven-milestone</id>
                <name>Spring Maven Milestone Repository</name>
                <url>http://maven.springframework.org/milestone</url>
            </pluginRepository-->
        </pluginRepositories>
    the pertinent dependencies

    Code:
    <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-neo4j</artifactId>
                <version>${spring-data-neo4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.neo4j</groupId>
                <artifactId>neo4j</artifactId>
                <version>${neo4j.version}</version>
            </dependency>
    Only the spring-data-neo4j would show a dependency to spring-data-commons, but based on the pom file, it should try to get 2.0.0.RELEASE of spring data commons.

    Oh, I see commons is Release on 1.2 and 1.2.1 but not at version 2.0.0, but still we shouldn't have a RELEASE reference a Milestone, right?

    Thanks

    Mark
    Last edited by bytor99999; Jan 11th, 2012, 01:44 PM. Reason: add

  • #2
    Ah, here we go, it looks like data Neo4j 2.0.0.RELEASE is still trying to use Spring data 1.2.0.RC1.

    Code:
    org.springframework.data:spring-data-neo4j:jar:2.0.0.RELEASE:compile
    [DEBUG]       org.springframework:spring-orm:jar:3.0.6.RELEASE:compile
    [DEBUG]       org.springframework.data:spring-data-commons-core:jar:1.2.0.RC1:compile
    [DEBUG]       cglib:cglib:jar:2.2:compile
    [DEBUG]          asm:asm:jar:3.1:compile
    [DEBUG]       org.neo4j:neo4j-cypher-dsl:jar:1.6.M02:compile
    [DEBUG]       org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.0.Final:compile
    I think someone forgot to update that and have it reference the RELEASE version.

    Thanks

    Mark

    Comment


    • #3
      For the time being I can have Spring data neo4j exclude the spring data commons and put commons in as a dependency right in my pom file pointing to the release version. Hope that will work for the time being.

      Mark

      Comment


      • #4
        Here is my workaround.

        Code:
        <dependency>
                    <groupId>org.springframework.data</groupId>
                    <artifactId>spring-data-neo4j</artifactId>
                    <version>${spring-data-neo4j.version}</version>
                    <exclusions>
                        <exclusion>
                            <groupId>org.springframework.data</groupId>
                            <artifactId>spring-data-commons-core</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
                <dependency>
                    <groupId>org.springframework.data</groupId>
                    <artifactId>spring-data-commons-core</artifactId>
                    <version>${spring-data-commons.version}</version>
                </dependency>
        ${spring-data-neo4j.version} = 2.0.0.RELEASE
        ${spring-data-commons.version} = 1.2.0.RELEASE

        and that allows me to build my app.

        Also note that I didn't want stuff from the Milestone repo, that is why I had to do this.

        Mark

        Comment


        • #5
          Thanks Mark for pointing this out.

          Obviously something went wrong during the release of SDN 2.0 with the SDC dependency. Thanks for outlining the solution.

          Could you raise a JIRA issue and put the solution there as well, so that it is recorded in the right place?

          Thanks a lot,

          Michael

          Comment


          • #6
            I did post an issue at the project on GitHub, but I will put one in Jira too.

            Here it is

            https://jira.springsource.org/browse/DATAGRAPH-174

            Thanks

            Mark
            Last edited by bytor99999; Jan 12th, 2012, 10:32 AM. Reason: adding Jira link

            Comment


            • #7
              One thing I did notice is that Spring Data Commons Core 1.2.0.RELEASE has a dependency on spring-tx 3.2.0.BUILD-SNAPSHOT, so everyone should be careful to specify that dependency as well.

              Comment


              • #8
                It doesn't. It just pick's the most recent one with a lower boundary of Spring 3.0.7. by default. So you should be fine by explictly configuring your Spring dependencies to a 3.0.7 version.

                Comment


                • #9
                  Thanks for clarifying. I have a fairly normal dependency on Spring 3.1, though, and it still ended up dragging in that SNAPSHOT release for me. I'm happy to blame maven to some extent, but users should be careful what actually gets selected.

                  Comment


                  • #10
                    The easiest way of getting the snapshots pulled is removing the snapshot repository. That way the snapshot dependencies should not be considered during dependency resolution. If this is not possible because you rely on snapshots of other libraries make sure you declare each and every spring dependency that gets pulled in explicitly in your pom fixing the version to your desired one (3.1.0 or 3.0.7)

                    Comment


                    • #11
                      Originally posted by Oliver Gierke View Post
                      The easiest way of getting the snapshots pulled is removing the snapshot repository. That way the snapshot dependencies should not be considered during dependency resolution. If this is not possible because you rely on snapshots of other libraries make sure you declare each and every spring dependency that gets pulled in explicitly in your pom fixing the version to your desired one (3.1.0 or 3.0.7)
                      I had had to do the same. removing the snapshot and milestone repositories from my pom file, which had then led me to the issue I Jira'd about from this thread.

                      If I had the milestone and snapshot repositories in my pom file, it downloaded all pom files for all versions, including all snapshots and all milestones of Spring from 3.0 up to 3.1. Which led to at least 15 of them. Wasn't a pretty site, so I removed the two repos and I don't have that problem anymore.

                      Mark

                      Comment


                      • #12
                        The maven problem downloading all the Milestone and snapshots from 3.0.7 to 3.1.1 happens if you try to build the samples too.

                        Mark

                        Comment

                        Working...
                        X