It sounds like you're currently using XML to configure your application, but you've posted in the right place - the Spring JavaConfig project is a perfect solution for those that need obfuscation. Essentially, you'll drop using XML and start writing your configurations in pure java.
Before:
Code:
<beans>
<bean id="foo" class="com.myco.Foo"/>
</beans>
and you would access that bean as follows:
Code:
ApplicationContext ctx = new ClassPathXmlApplicationContext("beans.xml");
Foo foo = (Foo) ctx.getBean("foo");
In this situation, you're quite right - obfuscation would render the beans.xml file inaccurate and the configuration would not work.
Here's the same configuration using JavaConfig:
Code:
@Configuration
public class AppConfig {
public @Bean Foo foo() {
return new Foo();
}
}
And bootstrapping goes as follows:
Code:
JavaConfigApplicationContext ctx = new JavaConfigApplicationContext(Foo.class);
Foo foo = ctx.getBean(Foo.class);
As you can see, with JavaConfig it's 100% Java - no XML, no string identifiers, so everything will obfuscate together and work perfectly.
Hope this gives you what you're looking for!