Announcement Announcement Module
Collapse
No announcement yet.
How to turn my roo project into a maven dependency available for other maven project Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to turn my roo project into a maven dependency available for other maven project

    Hello guys,

    I have a Roo project that contains only the persistence layer (JPA entities and so on). This project is about to be used by 2 or more web applications, so my question is:
    How to turn my Roo project into a maven dependency and make it available for other maven projects?
    I'm using Maven 3, Spring Roo 1.2.1 and STS.

    UPDATE:

    Ok, I figured out how to do the above. Now I'm getting the following error when I try to access my web application:

    java.lang.IllegalStateException: Entity manager has not been injected (is the Spring Aspects JAR configured as an AJC/AJDT aspects library?)
    br.com.infiniloja.domain.Cargo_Roo_Jpa_ActiveRecor d.entityManager_aroundBody0(Cargo_Roo_Jpa_ActiveRe cord.aj:19)
    br.com.infiniloja.domain.Cargo_Roo_Jpa_ActiveRecor d.ajc$interMethod$br_com_infiniloja_domain_Cargo_R oo_Jpa_ActiveRecord$br_com_infiniloja_domain_Cargo $entityManager(Cargo_Roo_Jpa_ActiveRecord.aj:1)
    br.com.infiniloja.domain.Cargo.entityManager(Cargo .java:1)
    br.com.infiniloja.domain.Cargo_Roo_Jpa_ActiveRecor d.ajc$interMethodDispatch1$br_com_infiniloja_domai n_Cargo_Roo_Jpa_ActiveRecord$br_com_infiniloja_dom ain_Cargo$entityManager(Cargo_Roo_Jpa_ActiveRecord .aj)
    br.com.infiniloja.domain.Cargo_Roo_Jpa_ActiveRecor d.ajc$interMethod$br_com_infiniloja_domain_Cargo_R oo_Jpa_ActiveRecord$br_com_infiniloja_domain_Cargo $persist(Cargo_Roo_Jpa_ActiveRecord.aj:42)
    br.com.infiniloja.domain.Cargo.persist(Cargo.java: 1)
    br.com.infiniloja.gui.DemoWindowComposer.doAfterCo mpose(DemoWindowComposer.java:19)
    org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0 (UiEngineImpl.java:740)
    org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild( UiEngineImpl.java:686)
    org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEn gineImpl.java:630)
    org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild( UiEngineImpl.java:662)
    org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEn gineImpl.java:630)
    org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEng ineImpl.java:597)


    Thanks a bunch,

    Gyo
    Last edited by gyowanny; Mar 19th, 2012, 04:17 PM.

  • #2
    Originally posted by gyowanny View Post
    Hello guys,

    I have a Roo project that contains only the persistence layer (JPA entities and so on). This project is about to be used by 2 or more web applications, so my question is:
    How to turn my Roo project into a maven dependency and make it available for other maven projects?
    I'm using Maven 3, Spring Roo 1.2.1 and STS.

    UPDATE:

    Ok, I figured out how to do the above. Now I'm getting the following error when I try to access my web application:

    java.lang.IllegalStateException: Entity manager has not been injected (is the Spring Aspects JAR configured as an AJC/AJDT aspects library?)
    br.com.infiniloja.domain.Cargo_Roo_Jpa_ActiveRecor d.entityManager_aroundBody0(Cargo_Roo_Jpa_ActiveRe cord.aj:19)
    br.com.infiniloja.domain.Cargo_Roo_Jpa_ActiveRecor d.ajc$interMethod$br_com_infiniloja_domain_Cargo_R oo_Jpa_ActiveRecord$br_com_infiniloja_domain_Cargo $entityManager(Cargo_Roo_Jpa_ActiveRecord.aj:1)
    br.com.infiniloja.domain.Cargo.entityManager(Cargo .java:1)
    br.com.infiniloja.domain.Cargo_Roo_Jpa_ActiveRecor d.ajc$interMethodDispatch1$br_com_infiniloja_domai n_Cargo_Roo_Jpa_ActiveRecord$br_com_infiniloja_dom ain_Cargo$entityManager(Cargo_Roo_Jpa_ActiveRecord .aj)
    br.com.infiniloja.domain.Cargo_Roo_Jpa_ActiveRecor d.ajc$interMethod$br_com_infiniloja_domain_Cargo_R oo_Jpa_ActiveRecord$br_com_infiniloja_domain_Cargo $persist(Cargo_Roo_Jpa_ActiveRecord.aj:42)
    br.com.infiniloja.domain.Cargo.persist(Cargo.java: 1)
    br.com.infiniloja.gui.DemoWindowComposer.doAfterCo mpose(DemoWindowComposer.java:19)
    org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0 (UiEngineImpl.java:740)
    org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild( UiEngineImpl.java:686)
    org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEn gineImpl.java:630)
    org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild( UiEngineImpl.java:662)
    org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEn gineImpl.java:630)
    org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEng ineImpl.java:597)


    Thanks a bunch,

    Gyo
    Ok, finally I have figured out.
    I put things working by loading up the spring-bean configurations of my Roo project like this:

    new ClassPathXmlApplicationContext("classpath*:META-INF/spring/applicationContext*.xml");

    Comment

    Working...
    X