title: Register groovy bean in spring java config
body: <p>I have this xml config</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:lang="http://www.springframework.org/schema/lang"
     xsi:schemaLocation="
      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
      http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd"&gt;
  
      &lt;lang:groovy id="foo" script-source="${groovyBeanLocation}"/&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>I imported this config in my ApplicationConfig, but do not want to mix several types of configurations (java and xml).</p>
  
  <p>How can I make a given configuration using java?</p>