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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:12:36+00:00 2026-05-23T08:12:36+00:00

In my tomcat project I have a configuration folder, in path src/main/tomcatconf . Now

  • 0

In my tomcat project I have a configuration folder, in path src/main/tomcatconf.

Now I want to deploy to 2 different servers. A development server and a production one.

I run my development server with mvn tomcat:run. Running my server on the fly, and all work perfectly.

Now I want to add the production server, with a different configuration folder (ie src/main/production/tomcatconf) and deploy the .war on Tomcat instance in my filesystem (ie /opt/tomcat6)
with mvn tomcat:deploy command.

How can i do this ?

  • 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-23T08:12:37+00:00Added an answer on May 23, 2026 at 8:12 am

    Finally i used maven resource plugin with profile configuration.

    i’ve made two additional folder :

    src/main/production

    src/main/development,

    then i move my Meta-inf/persistence.xml in these folder.

    then i add this part of configuration on my pom.xml :

    <profiles>
        <profile>
            <id>development</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <property>
                    <name>environment.type</name>
                    <value>dev</value>
                </property>
            </activation>
            <build>
                <resources>
                    <resource>
                        <directory>src/main/resources</directory>
                    </resource>
                    <resource>
                        <directory>src/main/development</directory>
                    </resource>
                </resources>
            </build>
        </profile>
        <profile>
            <id>production</id>
            <activation>
                <property>
                    <name>environment.type</name>
                    <value>prod</value>
                </property>
            </activation>
            <build>
                <resources>
                    <resource>
                        <directory>src/main/resources</directory>
                    </resource>
                    <resource>
                        <directory>src/main/production</directory>
                    </resource>
                </resources>
            </build>
        </profile>
    
    </profiles>
    

    in this manner i’ve a common resource folder and an additional folder based by environment type.

    Now when i run
    mvn tomcat:run -Denvironment.type=dev
    i use my development environment and when i run
    mvn tomcat:run -Denvironment.type=prod
    i use my production enviroment.

    The only drawback of this approach is that everytime i want change environment type i must run
    mvn clean to build the right configuration file.

    Please let me know If you Think that i wrong or you want suggest another kind of solution

    Regards
    Antonio Musella

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

Sidebar

Related Questions

I have 2 applications deployed in tomcat, I want to use in one project
I have a project which needs to deploy multiple wars on a tomcat instance.
I have a little project with some jsp deployed on an Tomcat 5.5. Recently
currently I'm developing in eclipse 3.5 in different project web applications for tomcat 6.0.24.
In tomcat 6 i have a servlet running openbluedragon, everything compiles and servers up
I have a maven project where I want to use the Cargo-Maven-Plugin (1.1.1) to
I have the following environment: Tomcat 5.5.30 Java 6 JAX-WS RI 2.1 My main
I have a project that uses EclipseLink 2.1.3 under Tomcat 7. What's bugging me
I have a project which consists of GWT client end and a Tomcat server
I have a project called myproject2 in my Eclipse IDE. I have a Tomcat

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.