title: Can one module read another module's bean?
body: <p>I have two SpringBoot modules. <code>commons</code> and <code>web</code>.</p>
  
  <p>In <code>commons</code> module, I define a bean:
  <a href="https://i.stack.imgur.com/XPvSX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XPvSX.png" alt="enter image description here"></a></p>
  
  <p>And I can get this bean In the <code>commons</code> test
  <a href="https://i.stack.imgur.com/HwZzj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HwZzj.png" alt="enter image description here"></a></p>
  
  <p>But unfortunately, I can not get the bean from anther module.
  <a href="https://i.stack.imgur.com/OBmDp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OBmDp.png" alt="enter image description here"></a></p>
  
  <p>Am I mistake something? I want to get the bean which defined in the <code>commons</code> module from my <code>web</code> module.</p>
  
  <p>this is my ModulesApplication.java</p>
  
  <pre class="lang-java prettyprint-override"><code>package com.github.fish56.modules;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  
  @SpringBootApplication
  public class ModulesApplication {
      public static void main(String[] args) {
          SpringApplication.run(ModulesApplication.class, args);
      }
  }
  </code></pre>
  
  <p>ModulesApplicatonTest.java</p>
  
  <pre class="lang-java prettyprint-override"><code>package com.github.fish56.modules;
  
  import org.junit.Test;
  import org.junit.runner.RunWith;
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.test.context.junit4.SpringRunner;
  
  import static org.junit.Assert.*;
  
  @RunWith(SpringRunner.class)
  @SpringBootApplication
  public class ModulesApplicationTest {
      @Test
      public void isEnvOk(){}
  }
  </code></pre>
  
  <h1>Update： it works</h1>