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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:26:25+00:00 2026-06-08T15:26:25+00:00

Im trying to use Maven to build a standalone application Using the assembly plugin

  • 0

Im trying to use Maven to build a standalone application

Using the assembly plugin described at
How do you create a standalone application with dependencies intact using Maven?

This creates widget distribution zip containing

widget-1.0
widget-1.0/lib/widget.jar
widget-1.0/lib/3rdpartyjar1.jar
widget-1.0/lib/3rdpartyjar2.jar

…

but in my src tree I have:

src/main/bin/widget.sh 

and this doesnt make into the final distribution zip, I would like it to go here

widget-1.0/widget.sh

Also in my src tree i have a properties file in

src/main/properties/widget.properties

that currently make its way into

widget-1.0/lib/widget.jar

but because I want it to be editable I want it to be in

widget-1.0/widget.properties

Is it possible to do this within maven ?

EDIT
Using information in blog got working as follows:

  1. Renamed bin folder to scripts folder because this is standard Maven name
  2. Moved widget.properties into script folder
  3. Modifed my assembly.xml to contain a fileset

Here is the new xml

<?xml version="1.0" encoding="UTF-8"?>
<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>distribution</id>
    <formats>
        <format>zip</format>
    </formats>
    <dependencySets>
        <dependencySet>
            <scope>runtime</scope>
            <outputDirectory>lib</outputDirectory>
            <unpack>false</unpack>
        </dependencySet>
    </dependencySets>
    <fileSets>
        <fileSet>
            <directory>${project.build.scriptSourceDirectory}</directory>
            <outputDirectory></outputDirectory>
            <includes>
                <include>widget.sh</include>
                <include>widget.properties</include>
            </includes>
        </fileSet>
    </fileSets>
</assembly>

However minor point but unable to find a list of maven standard folder variables anywhere , i.e is there an equivalent to ${project.build.scriptSourceDirectory} for the properties folder

  • 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-08T15:26:26+00:00Added an answer on June 8, 2026 at 3:26 pm

    I found this blog post to be a good tutorial on how to do this.

    Also, I think the name of the folder in which you place your files is relevant. Maven obviously does different things with files in src/main/java than with files in src/main/resources. I’m not 100% sure, but the name of this folder might mean the difference between a file ending up inside the jar or not.

    Here is a list of Maven directory name properties.

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

Sidebar

Related Questions

I am trying to use the Maven assembly plugin to build a jar-with-dependencies, except
I am trying to use the maven-assembly plugin like so to build a zip
I'm trying to use proguard in a Maven project this is a obfuscate plugin,
I'm trying to test a client/server application, and using Maven to handle the build/test/deploy.
I'm trying to use Maven to build a Flex project using the Sonatype flexmojos.
I am trying to build a Hadoop job using Maven. This job works well
I'm trying to build an Java EE 6-application on GlassFish V3, using JSF 2.0,
I'm trying to use Maven to create an executable jar file that includes the
Hi I'm trying to use the maven android plugin and robolectric to get tests
I'm trying to use the glassfish-maven-plugin ( https://maven-glassfish-plugin.dev.java.net/ ) with GlassFish v3 (I'm on

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.