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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:48:53+00:00 2026-05-11T11:48:53+00:00

I have config files and various documents that I want to copy from the

  • 0

I have config files and various documents that I want to copy from the dev environment to the dev-server directory using Maven2. Strangely, Maven does not seem strong at this task.

Some of the options:

  • Simple use a copy task in Maven
<copy file='src/main/resources/config.properties' tofile='${project.server.config}/config.properties'/> 
  • Use the Ant plugin to execute copy from Ant.

    • Construct an artifact of type zip, alongside the ‘main’ artifact of the POM which is usually of type jar, then unpack that artifact from the repository into the target directory.

    • maven-resources plugin, as mentioned below.

    • Maven Assembly plugin — but this seems to require a lot of manual definitions, when I want to do things simply and ‘conventionally.’

    • This page even shows how to build a plugin to do copying!

    • maven-upload plugin, as mentioned below.

    • maven-dependency-plugin with copy, as mentioned below.

All these seem needlessly ad hoc: Maven is supposed to excel at doing these standard tasks without fuss and bother.

Any advice?

  • 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. 2026-05-11T11:48:54+00:00Added an answer on May 11, 2026 at 11:48 am

    Don’t shy away from the Antrun plugin. Just because some people tend to think that Ant and Maven are in opposition, they are not. Use the copy task if you need to perform some unavoidable one-off customization:

    <project>   [...]   <build>     <plugins>       [...]       <plugin>         <artifactId>maven-antrun-plugin</artifactId>         <executions>           <execution>             <phase>deploy</phase>             <configuration>               <target>                  <!--                   Place any Ant task here. You can add anything                   you can add between <target> and </target> in a                   build.xml.                 -->                </target>             </configuration>             <goals>               <goal>run</goal>             </goals>           </execution>         </executions>       </plugin>     </plugins>   </build>   [...] </project> 

    In answering this question, I’m focusing on the details of what you asked. How do I copy a file? The question and the variable name lead me to a larger questions like: "Is there a better way to deal with server provisioning?" Use Maven as a build system to generate deployable artifact, then perform these customizations either in separate modules or somewhere else entirely. If you shared a bit more of your build environment, there might be a better way – there are plugins to provision a number of servers. Could you attach an assembly that is unpacked in the server’s root? What server are you using?

    Again, I’m sure there’s a better way.

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

Sidebar

Related Questions

I have seen config files(yes, text files) for various console applications that look like
We have multiple config files (app.DEV.config, app.TEST.config, etc) and a pre-build event that copies
In my home folder in Linux I have several config files that have rc
I have a config file that I read using the RawConfigParser in the standard
I have a Python app. It loads config files (and various other files) by
I have various settings in my ccnet.config file and wish to pass them to
Is it possible to have two app.config files where one app.config serves as a
In the Setup Project I have 2 web.config files: web.config - used during the
I have a windows service where the app.config file and the log4net.config files are
I have two files: domainList and config.cnf. The domainList file simply has a list

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.