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

  • Home
  • SEARCH
  • 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 7711561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:24:25+00:00 2026-06-01T01:24:25+00:00

I know the question I’m asking must be answered somewhere but I cant find

  • 0

I know the question I’m asking must be answered somewhere but I cant find an example on the net with some guidelines.

I wish to swap out the Spring 3.0 bean definition at build and runtime for a common codebase. I’m also using Maven profiles to build different versions of the same code.

Currently my bean def is

<bean id="somebean" class="com.x.SomeImpl" > 

I will need to replace and deploy it at some times as

<bean id="somebean" class="com.x.SomeOtherImpl" > 

Now the approaches I’m thinking of are

1) Use Maven profiles to switch out the complete applicationContext.xml to some other applicationContextB.xml based on the Maven profile.

2) Use Maven profiles to somehow? replace only the bean id definition for “somebean”

My questions are:

a) How can Option 2 be achieved?

b) These approaches still compile and package both SomeImpl and SomeOtherImpl during build. How can I pick only one and not the other for compliation and packaging into EAR?

I know Spring 3.1 has env profiles for the beans, but presently that’s not an option.

  • 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-06-01T01:24:27+00:00Added an answer on June 1, 2026 at 1:24 am

    You could consider using the maven resources and filtering feature available. You could have placeholders in your context file and a property file per profile holding values. In each profile, you could use a different property file and appropriately have your context file filtered.

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

Sidebar

Related Questions

I know this question was answered before, but I cant still handle it with
I know this question might be little silly but I can't seem to find
I know this question is already answered here . But this doesnt work for
I know this question was probably already answered but I just don't know what
I know this question has been answered before in this thread , but I
I know this question comes up often, but today I can't find the answer
I know question seems little scamy but I couldn't find a better way to
I know this question has been asked a lot, but I want to find
I know this question has been asked before but for some reason I am
I know this question has been asked before but I really couldn't find anything

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.