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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:28:42+00:00 2026-05-31T10:28:42+00:00

I have a maven web project that imported into eclipse. I have another maven

  • 0

I have a maven web project that imported into eclipse. I have another maven project (generates a jar file) that the web project depends on.

Both of these projects work correctly when executed from the command line. mvn package creates a war file which pulls the jar it depends on from the maven repository for the web project. mvn package creates a valid jar file when run for the library.

When I import the library into Eclipse, m2e recognizes that the web project depends on the library and updates parts of the project to take advantage of the fact that both maven projects are hosted within a single Eclipse workspace. The “Maven Dependencies” section of the “Libraries” tab of the “Java Build Path” preference for the web project removes the library jar file and replaces it with the library project. As the library is updated in Eclipse, the web project recognizes those changes without having to install/deploy the library.

The problem occurs when I attempt to run the web application in Eclipse. Because Eclipse is actually building the Web project against the version of the library in Eclipse, it does not deploy the library file from the maven repository, it creates a new jar file that’s a snapshot of the current version of the library in Eclipse. All of this has generally worked well for me, but on the project I’m currently working on there’s a problem with the jar file that Eclipse is creating. Instead of inserting the class files for the library, it appears that it’s taking the “src” directory of my Maven project and zipping it up as the jar file. The contents of the jar file look something like:

-main
  -java
    -com
      -... *.java
  -resources
    -...
-test
  -java
    -com
      -... *.java

Where I would expect it to look more like:

-com
  -... *.class

Since I have successfully used this type of project before, I’m trying to figure out if there’s something I need to configure or if I’ve just run into a bug.

I’m using the latest update of m2e (1.0.200.20111228-1245) on Eclipse Indigo (Build id: 20120216-1857).

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

    Here’s the solution that I came up with.

    It appears that in my case the rules for the “Deployment Assembly” for the library project are still followed.

    To change it go to the library properties->Deployment Assembly

    In my case that just contained a mapping from ‘/src’ -> ‘/’. I removed that entry and replaced it with a mapping from ‘/target/classes’ -> ‘/’ and ‘/src/main/resources’ -> ‘/’.

    Once I had that mapping in place, when the jar file was deployed it contained exactly what I had configured in the Deployment Assembly. That allows Eclipse to continue to be used without explicitly republishing the library for every change. But, it doesn’t seem to auto redeploy to tomcat for me when the library is updated — I still need to manually restart tomcat for library changes to be reflected.

    It’s still not entirely clear to me what’s going on with this project. I do have previous projects that have a similar structure, and in those projects the Deployment Assembly has not been updated to explicitly include the class files and yet the proper jar file is still deployed.

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

Sidebar

Related Questions

I have java project that depends from other java projects. These projects are maven
I have a .jar that I want included in my IDEA web application project
I have a multi-module Maven project that is a Java web application. I am
I have a Maven project that is packaged as jar . And I also
I have been trying to convert a web project that produces a war file
I have a maven POM file for a web service. For one of the
I have a Maven Java project, imported using m2eclipse . The target/ directory is
I have a maven project that has a set of library dependancies that are
I'm working on a Java web project that uses Maven to build its artifacts.
I have a maven project that I run using jetty: $ mvn run:jetty Where

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.