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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:10:11+00:00 2026-05-28T05:10:11+00:00

I need to create multiple tar files in a tar-by-environment package. Every different environment

  • 0

I need to create multiple tar files in a tar-by-environment package.

Every different environment has a folder with an only file “environment.properties”, so I’ve got to merge the project content with the environment.properties file for each of my environments: RC, BC, PROD.

I’m using maven-assembly-plugin to do this, so there are 3 assembly descriptors similar to this assembly with different “id”:

<assembly
    xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
    <id>pack-content-rc</id>
    <includeBaseDirectory>false</includeBaseDirectory>
    <formats>
        <format>tar</format>
    </formats>
    <fileSets>
        <fileSet>
            <outputDirectory>/definitions</outputDirectory>
            <directory>definitions</directory>
            <includes>
                <include>*.*</include>
            </includes>
            <excludes>
                <exclude>.*</exclude>
            </excludes>
        </fileSet>
        <fileSet>
            <outputDirectory>/library</outputDirectory>
            <directory>library</directory>
            <includes>
                <include>*.*</include>
            </includes>
            <excludes>
                <exclude>.*</exclude>
            </excludes>
        </fileSet>
        <fileSet>
            <outputDirectory>/messages</outputDirectory>
            <directory>messages</directory>
            <includes>
                <include>*.*</include>
            </includes>
            <excludes>
                <exclude>.*</exclude>
            </excludes>
        </fileSet>
        <fileSet>
            <outputDirectory>/templates</outputDirectory>
            <directory>templates</directory>
            <includes>
                <include>**/*</include>
            </includes>
            <excludes>
                <exclude>.*</exclude>
            </excludes>
        </fileSet>
        <fileSet>
            <outputDirectory>/variables</outputDirectory>
            <directory>variables</directory>
            <includes>
                <include>*.*</include>
            </includes>
            <excludes>
                <exclude>.*</exclude>
            </excludes>
        </fileSet>
        <fileSet>
            <outputDirectory>/variables</outputDirectory>
            <directory>target/escape/rc</directory>
            <includes>
                <include>*.*</include>
            </includes>
        </fileSet>      
    </fileSets>
</assembly>

And the maven configuration of the plugin is:

...
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.2</version>
<executions>
    <execution>
        <id>make-assembly</id>
        <phase>package</phase>
        <goals>
            <goal>single</goal>
        </goals>
        <configuration>
            <descriptors>
                <descriptor>pack-content-rc.xml</descriptor>
                <descriptor>pack-content-bc.xml</descriptor>
                <descriptor>pack-content-prod.xml</descriptor>
            </descriptors>
        </configuration>
    </execution>
</executions>
...

And the output log is:

[INFO] --- maven-assembly-plugin:2.2.2:single (make-assembly) @ nibbler-content ---
[INFO] Reading assembly descriptor: pack-content-rc.xml
[INFO] Reading assembly descriptor: pack-content-bc.xml
[INFO] Reading assembly descriptor: pack-content-prod.xml
[INFO] nibbler-content-19.0.1-SNAPSHOT-rc/variables/environment.properties already added, skipping
[INFO] Building tar : /Users/ger/Documents/Work/nibbler-content/target/nibbler-content-19.0.1-SNAPSHOT-pack-content-rc.tar
[INFO] nibbler-content-19.0.1-SNAPSHOT-rc/variables/environment.properties already added, skipping
[INFO] nibbler-content-19.0.1-SNAPSHOT-bc/variables/environment.properties already added, skipping
[INFO] Building tar : /Users/ger/Documents/Work/nibbler-content/target/nibbler-content-19.0.1-SNAPSHOT-pack-content-bc.tar
[INFO] nibbler-content-19.0.1-SNAPSHOT-bc/variables/environment.properties already added, skipping
[INFO] nibbler-content-19.0.1-SNAPSHOT-prod/variables/environment.properties already added, skipping
[INFO] Building tar : /Users/ger/Documents/Work/nibbler-content/target/nibbler-content-19.0.1-SNAPSHOT-pack-content-prod.tar
[INFO] nibbler-content-19.0.1-SNAPSHOT-prod/variables/environment.properties already added, skipping
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

The problem is that the 3 resulting files have the same environment.properties file, the first file to be exact, so I end up having 3 files that are exactly the same package.

I assume that the assembly process uses a directory to compose the tar, so it copies the first file, and for the second descriptor the file is already there…

Is there a way to avoid this to happend? Something like a clean before running each descriptor?
Should I use maven-ant-run plugin or something like that?

Thanks!

  • 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-28T05:10:11+00:00Added an answer on May 28, 2026 at 5:10 am

    The already added, skipping thing came first with version 2.2 of the plugin, you may try v2.1.

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

Sidebar

Related Questions

I need to create a batch file which starts multiple console applications in a
I need to create multiple search fields that each search different content in WordPress.
Why do I need to create Multiple SSPs in MOSS? My manager (sharepoint administrator)
I'm new to GUI programming, but need to create a multiple window GUI. Does
I`v come across a need where I want to create multiple list items from
I need to create an XmlDocument with a root element containing multiple namespaces. Am
I need to create multiple divs like below based on how many objects are
I need to create multiple /testcontainer: parameters to feed into a task that exec's
I need to create multiple threads when a button is clicked and i've done
The questions is pretty straightforward and I need to know how to create multiple

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.