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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:42:45+00:00 2026-05-30T13:42:45+00:00

While developing an applet, I created a maven project with .jar packaging and different

  • 0

While developing an applet, I created a maven project with .jar packaging and different .jar dependencies. Now I want to add an archive index (/META-INF/INDEX.LIST) to my project’s jar that contains not only the entries for this jar but also the entries of all dependency jar’s.

With the jar command line tool I’d achieve it with

> jar i myproject.jar dependency1.jar dependency2.jar …

Using the maven archive index flag of the maven-jar-plugin only the entries for myproject.jar occur in the archive index, not so the entries of the dependency jars:

  ...
  <plugin>
    <artifactId>maven-jar-plugin</artifactId>
    <configuration>
      <archive>
        <index>true</index>
      </archive>
    </configuration>
  </plugin>
  ...

Is there a possibility to include the entries of dependencies into the index file with maven?

Thank you for any hints…

  • 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-30T13:42:46+00:00Added an answer on May 30, 2026 at 1:42 pm

    I finally solved it with the following configuration:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <index>true</index>
            <manifest>
              <addClasspath>true</addClasspath>
            </manifest>
          </archive>
        </configuration>
      </plugin>
    

    With this configuration, all jar files (project and dependencies) are listed in the MANIFEST.MF’s classpath and their entries (files at directory level and package names according to the jar index doc) will occur in INDEX.LIST.

    Note #1: Using both index and addManifest prior version 2.4 results in the bug described in http://jira.codehaus.org/browse/MJAR-69. So make sure to use version 2.4 of the maven-jar-plugin.

    Note #2: Due to the bug described in http://jira.codehaus.org/browse/MNGECLIPSE-1219, dependencies will occur neither in MANIFEST.MF nor in INDEX.LIST if dependencies are resolved using Resolve Workspace artifacts (option of the Eclipse Run configuration). So make sure that you a) first install/deploy all dependencies and b) disable the Resolve Workspace artifacts option (or close the dependency project in eclipse) if necessary before building the project with eclipse.

    Note #3: Do NOT use both the jar-with-dependencies (maven-assembly-plugin) and addClasspath (maven-jar-plugin), or you’ll double all entries in the resulting jar.

    Note #4: The java jar command line tool does also evaluate the MANIFEST.MF’s classpath (besides explicit listing of jar files when invoking the tool as shown in my initial example), see the index example of the jar doc.

    Due to Note #2, I’ll investigate into ANT’s jar…

    Many thanks to @khmarbaise pointing my to the right direction 🙂

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

Sidebar

Related Questions

While developing a Java project, I place all of my jar files in a
I am using SVN while developing a WordPress site. Now I want to upload
While developing a web application I want to perform certain validation check and only
While developing I've seen a couple different ways to get local resources values from
while developing GWT apps we ran into lots of problems with project configuration. Let
While developing with Firebug I keep getting this error. pages[x].css(z-index,x) is not a function
While developing a C++ application, I had to use a third-party library which produced
While developing products, we often need to create proprietary tools to test some of
While developing my app I have come to realize that the majority of my
While developing a new query at work I wrote it and profiled it in

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.