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 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

We have created a jar(Spring project) which we are including using Maven in another
I'm making a maven plugin to start, stop and clear a database. I'm using
I have a nasty problem referencing resources when using a Maven project and Jar
I have two spring projects. Both are currently portlets. I would like to take
here is the structure of my project. proj ---src ----main ----java ----Main.java ----resources ----res.txt
I've imported my project into Eclipse (Helios + m2eclipse), and also into Netbeans (7.0)
I am trying to integrate the generation of an installer as part of a
I am trying to download a specific artifact (and all of its dependencies) to
UPDATE: This problem goes away when I deploy as an exploded EAR i.e. by
I'm trying to upgrade my struts2 web app from guice2.0 to guice3.0. I'm trying

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.