Results 1 to 7 of 7

Thread: Maven cyclic referance on multi modules project

Threaded View

  1. #1
    Join Date
    Mar 2008
    Posts
    257

    Default Maven cyclic referance on multi modules project

    Hello,

    I have a multi modules project and when I run the command:
    Code:
    mvn clean
    I get a cyclic reference:
    [ERROR] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] The projects in the reactor contain a cyclic reference: Edge between 'Vertex{label='com.learnintouch.lms.service:servic e'}' and 'Vertex{label='com.learnintouch.lms.data:data'}' introduces to cycle in the graph com.learnintouch.lms.data:data --> com.learnintouch.lms.service:service --> com.learnintouch.lms.data:data
    I created my project so:
    Code:
    project --topLevelPackage com.learnintouch.lms --java 6 --packaging pom
    module create --moduleName data --topLevelPackage com.learnintouch.lms.data
    module focus --moduleName ~
    module create --moduleName service --topLevelPackage com.learnintouch.lms.service
    module focus --moduleName ~
    module create --moduleName ui --topLevelPackage com.learnintouch.lms.ui
    module create --moduleName vaadin --topLevelPackage com.learnintouch.lms.ui.vaadin
    module focus --moduleName ~
    
    module focus --moduleName data
    jpa setup --provider HIBERNATE --database MYSQL
    database properties list
    database properties set --key database.username --value learnintouch
    database properties set --key database.password --value mignet
    database properties set --key database.url --value jdbc:mysql://localhost:3306/db_integration
    database properties list
    database introspect --schema db_integration
    database reverse engineer --package ~.domain --schema PUBLIC --testAutomatically --includeNonPortableAttributes
    
    module focus --moduleName service
    service --interface ~.utils.PreferenceService --entity ~.domain.Preference
    service --interface ~.user.UserService --entity ~.domain.User
    
    finder add --finderName findPreferencesByNameEquals
    So I looked in the pom-xml files and I can see the data/pom.xml file contains a dependency on the service module:
    Code:
        <dependency>
          <groupId>com.learnintouch.lms.service</groupId>
          <artifactId>service</artifactId>
          <version>0.1.0.BUILD-SNAPSHOT</version>
        </dependency>
    And the service/pom.xml file contains a dependency on the data module:
    Code:
        <dependency>
          <groupId>com.learnintouch.lms.data</groupId>
          <artifactId>data</artifactId>
          <version>0.1.0.BUILD-SNAPSHOT</version>
        </dependency>
    I had also noticed that when I added the annotation:
    Code:
    @RooService(domainTypes = { com.learnintouch.lms.data.domain.Preference.class })
    in the service.utils.PreferenceService class, it had added, in a Roo maintained file sitting in the data (yes, in the data) module, a code fragment with a reference to the service class. But this is now gone and I cannot see it again. High Chaparal..

    What wrong did I do to have the cyclic reference in the pom.xml files ?

    So I edited the data/pom.xml file and removed the service dependency, and the Maven build clean passed fine.

    But when running the Maven build to compile, it gives me the following compile error:

    [INFO] Compiler errors :
    error at public class PreferenceServiceImpl implements PreferenceService {
    ^^^^^^^^^^^^^^^^^^^^
    /home/stephane/dev/java/projects/spring-roo/learnintouch/service/src/main/java/com/learnintouch/lms/service/utils/PreferenceServiceImpl.java:8:0::0 must implement abstract inter-type declaration: long com.learnintouch.lms.service.utils.PreferenceServi ce.countAllPreferences()
    see also: /home/stephane/dev/java/projects/spring-roo/learnintouch/service/src/main/java/com/learnintouch/lms/service/utils/PreferenceService_Roo_Service.aj:12::0
    error at public class PreferenceServiceImpl implements PreferenceService {
    ^^^^^^^^^^^^^^^^^^^^
    /home/stephane/dev/java/projects/spring-roo/learnintouch/service/src/main/java/com/learnintouch/lms/service/utils/PreferenceServiceImpl.java:8:0::0 must implement abstract inter-type declaration: void com.learnintouch.lms.service.utils.PreferenceServi ce.deletePreference(com.learnintouch.lms.data.doma in.Preference)
    see also: /home/stephane/dev/java/projects/spring-roo/learnintouch/service/src/main/java/com/learnintouch/lms/service/utils/PreferenceService_Roo_Service.aj:13::0
    error at public class PreferenceServiceImpl implements PreferenceService {
    Last edited by stephaneeybert; Apr 15th, 2012 at 07:25 AM.
    Stephane

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •