2

using Eclipse Helios, and the Spring Source Tool Suite 2.8.1.201111221000-RELEASE, having two Eclipse projects with a Spring nature added, the second depending on the first - is there a way to add Spring bean configuration files from both projects to the "Spring/Bean Support" configuration of the second project?

In detail, say

  • project A builds some a.jar, containing some module.xml file, declaring some Spring beans implemented in A.
  • project B builds some b.jar, containing some application.xml file, declaring the beans implemented in B
  • B's spring configuration references some beans which are declared in A's configuration
  • application.xml does not import module.xml, instead, at runtime an ClassPathXmlApplicationContext is created which loads (all) configurations files from the classpath which match a certain pattern (something like "classpath:application.xml","classpath*:module.xml")
  • B's spring nature is configured to use application.xml as config file (Project properties => Spring => Beans Support => Config Files)

What I want to do is to tell STS that B's spring configuration consists not only of B's application.xml, but also of A's module.xml. If A is not part of the workspace, but a.jar is located in my Maven repo, with B declared to depend on that artifact, I can add the module.xml config file to B's spring configuration. If, however, A is part of the workspace, referencing its module.xml does not seem to be possible.

Do I miss something?

Thanks

Gangnus
  • 24,044
  • 16
  • 90
  • 149

1 Answers1

1

Ah, I did miss something! You can't add module.xml to B's "Spring / Beans Support / Config Files" list - but when you edit a particular Config Set (second tab page), then - surprise! - all of module A's config files are available, too.

works like a charm ...