eclipse - Autowired dependencies in a Maven multi-module project -
i have single maven project has "core" , "web" pieces in it. i'm attempting convert multiple modules.
i've taken "web" packages , put them new project. i've added core project dependency , can reference classes within eclipse. "core" project correctly shows in web-inf\lib
in "web" project when build it.
the problem comes when classes "core" project @autowired
in "web" project.
in particular case, i'm autowiring service class "core" 1 of web service classes in "web" project. if add package core service in context:component-scan
in "web" application config, finds service, service references repository, references entity, looking entity manager factory i've got configured in application-context in "core" project.
so seems maybe context:component-scan
in "core" project isn't happening maybe? or maybe classes picked not being made available "web" project?
i'm entirely new multi-module projects, if can me started in right direction resolve this, i'd appreciate it.
i'm using m2e in eclipse run jetty run plugin if matters; however, seem have same issues when mvn jetty:run
command line.
you need load core module application-context web module application context. otherwise not aware of beans defined in core application context. take answers application context other maven module cannot loaded , spring import application context project proper solutions.
can have @ post nicely describing how create multi-module spring project using maven.
Comments
Post a Comment