Announcement Announcement Module
Collapse
No announcement yet.
Spring data neo4j examples --- cineasts rest, how to user ivy to build the project Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring data neo4j examples --- cineasts rest, how to user ivy to build the project

    As Ivy can manage local repository and server repository pretty well, and I am more familiar with Ivy. I wrote ivy file for the project, but fail to compile successfully. The "relateTo" method is not define.

    Here are my ivy files.


    <ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
    <info organisation="org.springframework.data.neo4j.examp les" module="cineasts-rest"/>

    <configurations defaultconfmapping="runtime->runtime(*);test->default;compile->compile(*)">
    <conf name="compile" description="Build Time dependencies"/>
    <conf name="test" description="Test Time dependencies"/>
    <conf name="runtime" description="Run Time dependencies"/>
    <conf name="provided" description="they are provided by the env." />
    </configurations>

    <dependencies>
    <dependency name="spring-data-neo4j-rest" rev="2.0.0.RC1" conf="test"/>

    <!-- Spring , from local share repository -->
    <dependency name="spring-core" rev="3.0.6.RELEASE">
    <exclude module="commons-logging"/>
    </dependency>

    <dependency name="spring-test" rev="3.0.6.RELEASE" conf="test">
    <exclude module="commons-logging"/>
    </dependency>

    <dependency name="spring-context" rev="3.0.6.RELEASE">
    <exclude module="commons-logging"/>
    </dependency>

    <dependency name="spring-aop" rev="3.0.6.RELEASE">
    <exclude module="commons-logging"/>
    </dependency>

    <dependency name="spring-aspects" rev="3.0.6.RELEASE">
    <exclude module="commons-logging"/>
    </dependency>

    <dependency name="spring-context" rev="3.0.6.RELEASE"/>

    <dependency name="spring-aop" rev="3.0.6.RELEASE"/>

    <dependency name="spring-aspects" rev="3.0.6.RELEASE"/>

    <dependency name="spring-tx" rev="3.0.6.RELEASE"/>

    <dependency name="spring-webmvc" rev="3.0.6.RELEASE">
    <exclude module="commons-logging"/>
    </dependency>

    <dependency name="spring-security-web" rev="3.0.6.RELEASE"/>

    <dependency name="spring-security-web" rev="3.0.6.RELEASE"/>

    <dependency name="spring-security-config" rev="3.0.6.RELEASE"/>


    <!-- sl4j log4j, from maven repository -->
    <dependency org="org.slf4j" name="slf4j-api" rev="1.6.1"/>

    <dependency org="org.slf4j" name="jcl-over-slf4j" rev="1.6.1"/>

    <dependency org="org.slf4j" name="slf4j-log4j12" rev="1.6.1" conf="runtime"/>

    <dependency org="log4j" name="log4j" rev="1.2.16" conf="runtime"/>

    <!-- spring data neo4j, from local share repository -->
    <dependency name="spring-data-neo4j-aspects" rev="2.0.0.RC1">
    <exclude module="hibernate-jpa-2.0-api"/>
    </dependency>

    <dependency name="spring-data-neo4j-rest" rev="2.0.0.RC1"/>

    <!-- symphony, hibernate, codehaus, etc-->
    <dependency org="opensymphony" name="sitemesh" rev="2.4.2"/>
    <dependency org="org.hibernate" name="hibernate-validator" rev="4.0.2.GA"/>



    <dependency org="javax.servlet" name="servlet-api" rev="2.5" conf="provided"/>

    <dependency org="javax.servlet.jsp" name="jsp-api" rev="2.1" conf="provided"/>
    <dependency org="javax.servlet" name="jstl" rev="1.2"/>

    <dependency org="org.codehaus.jackson" name="jackson-mapper-asl" rev="1.7.2"/>


    <!-- aspectj from local share repository-->
    <dependency name="aspectjrt" rev="1.6.12"/>
    <dependency name="cglib" rev="2.2"/>
    <dependency org="org.hibernate.javax.persistence" name="hibernate-jpa-2.0-api" rev="1.0.0.Final"/>


    <!-- Neo4j Libraries -->

    <dependency name="neo4j-kernel" rev="1.5"/>
    <dependency name="neo4j-cypher" rev="1.5"/>



    <dependency name="neo4j-server" rev="1.5" conf="test">
    <exclude org="org.slf4j" name="og4j-over-slf4j"/>
    <exclude org="org.neo4j" name="neo4j"/>
    <exclude org="org.mortbay.jetty" name="jetty"/>
    <exclude org="com.sun.jersey" name="jersey-server"/>
    <exclude org="org.codehaus.jackson" name="jackson-jaxrs"/>
    <exclude org="org.codehaus.jackson" name="jackson-mapper-asl"/>
    <exclude org="de.huxhorn.lilith" name="de.huxhorn.lilith.3rdparty.rrd4j"/>
    <exclude org="com.sun.jersey.contribs" module="jersey-multipart"/>
    <exclude org="org.apache.felix" name="org.apache.felix.main"/>
    <exclude org="org.apache.felix" name="org.apache.felix.fileinstall"/>
    <exclude org="org.neo4j" name="neo4j-shell"/>
    <exclude org="org.slf4j" name="slf4j-jdk14"/>
    </dependency>
    <dependency org="junit" name="junit" rev="4.8.1" conf="test"/>
    <dependency org="org.mortbay.jetty" name="jetty" rev="6.1.25" conf="test"/>

    </dependencies>
    </ivy-module>


    And the aspectj part of my build file is :
    <taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties" classpath="${lib.dir}/aspectjtools.jar"/>


    <target name="compile" description="Compile production classes" depends="lib.retrieve">
    <mkdir dir="${main.target}" />

    <iajc sourceroots="${main.src}" destDir="${main.target}" classpathref="path.libs" source="1.6">
    <aspectpath>
    <pathelement location="${lib.dir}/spring-aspects-3.0.6.RELEASE.jar"/>
    </aspectpath>
    <aspectpath>
    <pathelement location="${lib.dir}/spring-data-neo4j.jar"/>
    </aspectpath>
    </iajc>
    </target>


    The compilation errors are :

    ompile:
    [mkdir] Created dir: /home/louis/experiment/spring-data-neo4j/spring-data-neo4j-examples/cineasts-rest/target/main/classes
    [iajc] warning bad version number found in /home/louis/experiment/spring-data-neo4j/spring-data-neo4j-examples/cineasts-rest/lib/aspectjrt.jar expected 1.6.12.M1 found 1.6.12
    [iajc] error at return relateTo(movie, Rating.class, RATED).rate(stars, comment);
    [iajc]
    [iajc] /home/louis/experiment/spring-data-neo4j/spring-data-neo4j-examples/cineasts-rest/src/main/java/org/neo4j/cineasts/domain/User.java:56:0::0 The method relateTo(Movie, Class<Rating>, String) is undefined for the type User
    [iajc] error at Role role = relateTo(movie, Role.class, "ACTS_IN");
    [iajc]
    [iajc] /home/louis/experiment/spring-data-neo4j/spring-data-neo4j-examples/cineasts-rest/src/main/java/org/neo4j/cineasts/domain/
    BUILD FAILED
    /home/louis/experiment/spring-data-neo4j/spring-data-neo4j-examples/cineasts-rest/build.xml:30: 9 errors
    Last edited by huobao36; Nov 29th, 2011, 03:53 AM. Reason: highlighten

  • #2
    Can anyone help me ? The problem cost me a lot of time

    Comment


    • #3
      You should depend on spring-data-neo4j-aspects in your ivy dependencies.

      I updated the appropriate configuration documentation, thanks for pointing it out. Please report back if that helped you.

      Code:
      <taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties" classpath="${lib.dir}/aspectjtools.jar"/>
      
      <target name="compile" description="Compile production classes" depends="lib.retrieve">
      	<mkdir dir="${main.target}" />
      
      	<iajc sourceroots="${main.src}" destDir="${main.target}" classpathref="path.libs" source="1.6">
      		<aspectpath>
      			<pathelement location="${lib.dir}/spring-aspects.jar"/>
      		</aspectpath>
      		<aspectpath>
      			<pathelement location="${lib.dir}/spring-data-neo4j-aspects.jar"/>
      		</aspectpath>
      	</iajc>
      </target>

      Comment


      • #4
        Thanks , it works well now

        Comment

        Working...
        X