# Can't find bean from dependence project in multi-project web application

**URL:** <https://discuss.gradle.org/t/cant-find-bean-from-dependence-project-in-multi-project-web-application/667>\
**Category:** Old Forum Archive\
**Created:** [June 13, 2013, 4:32pm UTC](https://discuss.gradle.org/t/cant-find-bean-from-dependence-project-in-multi-project-web-application/667 "2013-06-13T16:32:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@Simon](https://discuss.gradle.org/u/Simon)\
**Post date:** [June 13, 2013, 4:32pm UTC](https://discuss.gradle.org/t/cant-find-bean-from-dependence-project-in-multi-project-web-application/667/1 "2013-06-13T16:32:00Z")

</div>

Hello,

I have a web application with Gradle build which is working fine. Now I am developing another web application which will need some existing function (service, entity) of current webapp. The natural thinking is to seperate those functions into a shared common library. So I seperate the working code into a mulit-project layout.

myproject

sub-project mycommon

sub-project mywebapp

I am able to build mycommon project into a mycommon-1.0-jar.

In mywebapp gradle.build, I have compile dependence on mycommon-1.0-jar. mywebapp builds fine with mycommon-1.0.jar in the generated war file. But I can’t start the web app in Eclipse (tomcat). It complains some class from mycommon project is missing.

The build.gradle for mywebapp is quite simple as

apply plugin: ‘eclipse-wtp’

apply plugin: ‘war’

dependencies {

compile group : ‘com.mycomapny’, name : ‘tmycommon’, version : ‘1.0’

} Question 1: What could be the possible cause, anything missing?

Question 2:

What’s difference if I use

dependencies {

compile project(’:mycommon’)

}

vs

dependencies {

compile group : ‘com.mycomapny’, name : ‘tmycommon’, version : ‘1.0’

}

Question3: Can I some Hibernate entities and Spring Data DAO in mycommon and has its own context file? If so, how those context file being loaded in mywebapp?

Thanks, Simon
