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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:51:43+00:00 2026-05-31T07:51:43+00:00

I have a project that has a few dependencies on other Jars. I currently

  • 0

I have a project that has a few dependencies on other Jars. I currently use the JavaDoc plugin and Assembly plugin to generate a .zip of my project, which contains my Jar, the dependency Jars, plus the javadoc.

However, I would like to boil things down so that there is only a single Jar inside the .zip, along with the relevant JavaDoc. I know that the assembly plugin + jar-with-dependencies is my friend for this, but how do I work it out such that I can package up a .zip containing this jar, along with my JavaDoc?

Relevant parts of my pom below:

  <properties>
    <assemblyJar>${project.build.finalName}.jar</assemblyJar>
    <assemblyJwd>${project.build.finalName}-jar-with-dependencies.jar</assemblyJwd>
    <java.code.version>1.4</java.code.version>
  </properties>

  <plugin>
    <artifactId>maven-assembly-plugin</artifactId>
    <version>2.2.1</version> <!-- 2.3 might be needed -->
    <configuration>
      <descriptors>
        <descriptor>src/assembly/dist-jwd.xml</descriptor>
      </descriptors>
      <descriptorRefs>
        <descriptorRef>jar-with-dependencies</descriptorRef>
      </descriptorRefs>
    </configuration>
    <executions>
      <execution>
      <id>make-jwd</id>
      <phase>prepare-package</phase>
      <goals>
        <goal>single</goal>
      </goals>
      </execution>
    </executions>
  </plugin>

  <plugin>
    <artifactId>maven-assembly-plugin</artifactId>
    <version>2.2.1</version> <!-- 2.3 might be needed -->
    <configuration>
      <descriptors>
        <descriptor>src/assembly/dist.xml</descriptor>
      </descriptors>
    </configuration>
    <executions>
      <execution>
      <id>make-zip</id>
      <phase>package</phase>
      <goals>
        <goal>single</goal>
      </goals>
      </execution>
    </executions>
  </plugin>

Relevant parts of dist-jwd.xml:

<id>dist-jwd</id>

  <includeBaseDirectory>true</includeBaseDirectory>

  <files>
    <file>
      <fileMode>444</fileMode>
      <source>target/${assemblyJar}</source>
      <outputDirectory></outputDirectory>
    </file>
  </files>

  <dependencySets>
    <dependencySet>
      <outputDirectory>lib</outputDirectory>
      <scope>compile</scope>
      <excludes>
        <exclude>javax.servlet:servlet-api</exclude>
      </excludes>
      <useProjectArtifact>false</useProjectArtifact>
    </dependencySet>
  </dependencySets>

And relevant parts of dist.xml:

<id>dist-zip</id>

  <formats>
    <format>zip</format>
  </formats>

  <includeBaseDirectory>true</includeBaseDirectory>

  <fileSets>
    <fileSet>
      <fileMode>444</fileMode>
      <directory>target/site/apidocs</directory>
      <outputDirectory>javadoc</outputDirectory>
    </fileSet>
  </fileSets>

  <files>
    <file>
      <fileMode>444</fileMode>
      <source>target/${assemblyJwd}</source>
      <outputDirectory></outputDirectory>
    </file>
  </files>

Currently I get the error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2.1:single (make-jwd) on project deviceinsight-api-java: Failed to create assembly: Error adding file to archive: /Users/barmistead/Mercurial/deviceinsight-print/target/deviceinsight-api-java-3.1.16-1-SNAPSHOT-jar-with-dependencies.jar isn't a file. -> [Help 1]

I’m guessing this is a possible chicken-and-egg problem, so If maven doesn’t have a graceful solution then I will have to do something manually. However, I think what I’m trying to do is pretty common, so I would think there would be an easy way.

  • 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-31T07:51:44+00:00Added an answer on May 31, 2026 at 7:51 am

    I ended up giving up and running a .sh script after the maven stuff to do what I wanted.

    Unix to the rescue!

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

Sidebar

Related Questions

I have created a small flash CS4 project that has a few custom components
I have a project that has a makefile with broken dependencies. Is there any
My use case is this... I have a project that has two production branches.
I'm currently working on a C++ project that needs to have as few external
I have an engine that has quite a few dependencies. To make it easier
I have a project that has the following line in the additional includes section:
I have a project that has a revision number of 3960. But unfortunately it
I have a project that has several build configurations (FREE version, male-only, female-only, etc.).
I have a project that has a GUI (written in QT) and a command-line
I have a project that has components in several different directories and would like

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.