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 8410897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:17:57+00:00 2026-06-10T00:17:57+00:00

We are 4 developers working on a maven-based java web project . We each

  • 0

We are 4 developers working on a maven-based java web project. We each have a specific database.properties file that points to a per-developer database schema.

The problem we currently have is that we sometimes inadvertently commit our per-developper database.properties or log4j.properties files with the obvious issue that this causes.

On the other hand, if we drop those files into the /lib directory of Tomcat, we might forget to include them to the production application that gets shipped.

Can anyone please provide advice or suggest best practices in order to sort this problem?

  • 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-10T00:17:59+00:00Added an answer on June 10, 2026 at 12:17 am

    You should start using Maven Profiles and Maven Resource Filtering together.

    If you combine these two techniques then each user could have his profile defined in the %USER_HOME%/.m2/settings.xml file while the database.properties and log4j.properties files use resource filtering to get the user specific properties from the user profile properties.

    I’ve been using this technique to support different databases by setting up a structure like this:

    src
      |-main
           |-filters
           |       |-derby.properties
           |       |-h2.properties
           |       |-mssql.properties
           |       |-mysql.properties
           |-templates
                     |-db.properties
    

    And in my pom.xml

    <profiles>
        <profile>
            <id>derby</id>
            <build>
                <filters>
                    <filter>src/main/filters/derby.properties</filter>
                </filters>
                <resources>
                    <resource>
                        <directory>src/main/templates</directory>
                        <filtering>true</filtering>
                    </resource>
                </resources>
            </build>
        </profile>
        <profile>
            <id>mysql</id>
            <build>
                <filters>
                    <filter>src/main/filters/mysql.properties</filter>
                </filters>
                <resources>
                    <resource>
                        <directory>src/main/templates</directory>
                        <filtering>true</filtering>
                    </resource>
                </resources>
            </build>
        </profile>
        <profile>
            <id>mssql</id>
            <build>
                <filters>
                    <filter>src/main/filters/mssql.properties</filter>
                </filters>
                <resources>
                    <resource>
                        <directory>src/main/templates</directory>
                        <filtering>true</filtering>
                    </resource>
                </resources>
            </build>
        </profile>
        <profile>
            <id>h2</id>
            <build>
                <filters>
                    <filter>src/main/filters/h2.properties</filter>
                </filters>
                <resources>
                    <resource>
                        <directory>src/main/templates</directory>
                        <filtering>true</filtering>
                    </resource>
                </resources>
            </build>
        </profile>
    </profiles>
    

    You should be able to do the same thing with your files.

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

Sidebar

Related Questions

We have multiple developers working on a single Web Application/Project. For that purposes we
I'm working on an existing Java EE project with various maven modules that are
I'm currently working with a Maven based project (lets call it Core) in Java
I'm working on a PHP project with several developers, each who has their own
We have three developers and one tester all working against the same database. We
I am working on a web site with several other developers and we have
I am currently working on a Java EE project. I have successfully developed a
Say there are 100 developers working on the same project. When each developer pushes
If we have 3 developers working on the same Biztalk project what is the
We have multiple developers working on a project. We're employing a feature-branch method of

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.