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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:23:31+00:00 2026-05-17T01:23:31+00:00

I’m trying to create a distributable zip of my project that contains several configuration

  • 0

I’m trying to create a distributable zip of my project that contains several configuration files and directories, as well as the executable jar of my project. In the Maven assembly plug-in, I’ve found how to make the executable jar with full dependencies. However, I haven’t been able to figure out how to create the zip file around the jar after it has been made. Ideally, I’d like to move the jar to a directory which already has the correct files and sub-directories, then zip the whole thing at once. Is there any way to do this?

edit:

I now have the jar building, and a rudimentary zip as well. My assembly file looks like this:

<assembly>
   <id>financials-import-server</id>
   <formats>
      <format>zip</format>
   </formats>
   <dependencySets>
      <dependencySet>
      </dependencySet>
   </dependencySets>
    <files>
       <file>
          <source>target/import-server-1.0.0-SNAPSHOT.jar</source>
          <destName>service.jar</destName>
          <outputDirectory>/</outputDirectory>
       </file>
    </files>
</assembly>

I feel comfortable including the other files I would need, such as config files or shell scripts. I have a few questions remaining. How would I create empty directories within the zip? Also, how do I change the name of the file that is produced?

Thanks for the help!

  • 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-17T01:23:32+00:00Added an answer on May 17, 2026 at 1:23 am

    First, use the Maven JAR plugin to create an executable JAR.

    Then, configure your assembly to include all the files needed (eventually you can add a run.bat / run.sh file that will launches the application), and also all dependencies.

    Finally, bind the assembly creation to your package goal in the pom.xml:

    <build>
      <plugins>
        <plugin>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>2.2-beta-5</version>
          <configuration>
            <descriptors>
              <descriptor>/path/to/my-assembly.xml</descriptor>
            </descriptors>
          </configuration>
          <executions>
            <execution>
              <phase>package</phase>
              <goals>
                <goal>single</goal>
              </goals>
            </execution>
          </executions>
          ...
    

    This way, you will simply need to run one Maven command mvn clean install for example, to compile your project, and then creates the ZIP package.

    Do not hesitate to update your question if my answer doesn’t fit your needs, and you can also give your current assembly.xml and pom.xml…


    Edit

    Regarding your update:

    I don’t think the assembly will let you create an empty directory. An idea is to put an empty file (or a readme.txt for example) and include the directory in the final ZIP. For example, in my project, I want to have a logs/ directory, so I have a logs/ directory in my project which only contains a readme.txt file:

    <fileSets>
        <fileSet>
            <directory>../my-package/logs</directory>
            <outputDirectory>logs/</outputDirectory>
        </fileSet>
    </fileSets>
    

    For the name of the ZIP created, you can specify it in the pom.xml:

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.2-beta-4</version>
                <configuration>
                    <descriptors>
                        <descriptor>my-assembly.xml</descriptor>
                    </descriptors>
                    <finalName>TheName</finalName>
    

    If I am correct, the assembly will use this name, add the ID defined in the assembly.xml file, and uses the prefix adapted to the format specified.

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

Sidebar

Related Questions

I'm trying to create an if statement in PHP that prevents a single post
Basically, what I'm trying to create is a page of div tags, each has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:

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.