Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6890237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:15:24+00:00 2026-05-27T06:15:24+00:00

We have multiple projects, and there are spring configuration XMLs in all of them.

  • 0

We have multiple projects, and there are spring configuration XMLs in all of them. We’re contemplating 2 options:

A) Loading the spring files from the classpath, by using import "classpath:a.xml". In this option our springjunit4classrunner and our main console application both happily find the files. However, when you need to change or inspect some XML, it’s well hidden in some obscure jar.

B) Creating a “conf” folder, and by using some maven magic gathering all the XML files from all the projects there. This is good for the main application, but the unittests don’t like this setting, as obviously we don’t build the “conf” folder before running unittests, and they fail to find the dependent projects XMLS…

(This is a spring re-take on Is it bad practice to include properties/configuaration files within jars?)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:15:24+00:00Added an answer on May 27, 2026 at 6:15 am

    In the past, I’ve gone with <import resource="classpath*:beans.xml"/> or similar, i.e. import every beans.xml file the classloader can find in the root of the classpath. In turn, those beans.xml files import their own specific config files as required.

    It requires discipline, so that you don’t get big spider webs of Spring configs, but if you keep it simple, then it makes integration very easy, so that you don’t need to maintain complex lists of config file imports, and the build process stays simple also.

    It’s interesting that you mention that prior question, because I don’t consider Spring beans files to be “configuration”. Rather, they’re part of the application – they cannot and should not be separated from the Java code, because they’re intimately coupled with it.

    If those beans files require genuine configuration, e.g. from a properties file, then yes, those probably should be kept separate.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET MVC 3 Solution(C#) Containing multiple projects. There is a services
If I have an existing solution containing multiple c# projects, are there any static
I have an existing application that exists as multiple Spring projects. Project A's Spring
I have a project where there are multiple applications that have some common configuration
We have multiple Python projects that have dependencies on each other. Hierarchically, these are
I have a Visual Studio 2010 solution that contains multiple projects. One of these
I have multiple projects which are to be hosted together in a Tomcat container,
I have multiple Projects(site) in my Solution (visual studio 2010). when i run my
I have multiple projects that are stored on my local computer but are not
I'm working on a build script with Gradle. We have multiple projects at our

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.