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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:00:26+00:00 2026-05-17T23:00:26+00:00

I am using maven jar plugin to package the jar file. But it looks

  • 0

I am using maven jar plugin to package the jar file. But it looks like maven jar plugin just only pack the stuff that stay inside target/classes. I am also want to pack all the classes in target/classes and (resource and class) files from many other directories. How can i do that with maven jar?

  • 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-17T23:00:27+00:00Added an answer on May 17, 2026 at 11:00 pm

    The resource files stays in another folder of project.

    If you can’t (or just don’t want to) put them under src/main/resources, you can declare additional resource locations using the <resource> element:

    <project>
     ...
     <build>
       ...
       <resources>
         <resource>
           <directory> [your folder here] </directory>
         </resource>
       </resources>
       ...
     </build>
     ...
    </project>
    

    See Specifying resource directories.

    The other classes are generated classes.

    The convention with plugins generating sources it to generate them in target/generated-sources/<tool> and a well implemented plugin should add the specified path as a source directory (so that generated code would be compiled). When they don’t, the Build Helper Maven Plugin can come to the rescue.

    If you are generating classes, why don’t you generate them in ${project.build.outputDirectory} (i.e. target/classes by default)? I don’t think you can add a 2nd classes directory anyway.

    If this doesn’t help, please clarify your exact constraints and requirements.

    References

    • Specifying resource directories
    • MavenPropertiesGuide
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Maven Assembly plugin to pack a jar file. But when I
I'm using the minijar-maven-plugin to reduce the size of my jar-with-dependencies jar but I
I'm using the Maven Appassembler plugin to package my application. I'd like to package
I am using the Maven-Shade-Plugin to create a runnable Uber-jar. According to the last
Right now I am using the maven-javadoc-plugin to attach the Javadoc to .jar artifacts
We're using maven 2.1.0. I have multiple modules that are completely separate, but still
I'm using NewRelic for monitoring. I want Maven to package both newrelic.jar and newrelic.yaml
Problem: I'd like to specify the main class in a jar file that I
I have a huge JAR file, which I created with Maven Shade plugin. I
I am creating an executable jar using the jar-with-dependencies component of the maven-assembly-plugin during

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.