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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T16:27:02+00:00 2026-05-19T16:27:02+00:00

I just created a framework (it would be more accurate to describe it as

  • 0

I just created a framework (it would be more accurate to describe it as an integration), and I’m wondering what would be the best way to distribute it. The project is mavenized and uses Spring 3, but I am a novice in both areas and I am not sure what would be the best way to distribute this.

The framework involves an integration between a Javascript library that I created, Spring 3 (the web MVC part), and Hibernate Validator.

  • I have a pom.xml for the whole project.
  • I have a src/main/java (properly namespaced) with the classes relevant to the integration.
  • I have a webapp directory with a js folder that contains the Javascript files necessary for this integration.
  • I have a WEB-INF/tlds directory with a tld for a custom tag implemented in Java.
  • I have a WEBINF/tags directory for a custom tag.
  • I have an applicationContext.xml in src/main/resources.
  • I have a springmvc-servlet.xml in WEB-INF.
  • I have a web.xml in WEB-INF (looks to be standard and out of the box; I don’t recall making any changes).
  • I have a src/test/java/ that includes tests for the integration framework

What files/directories should I include/exclude, and what would be a good way to distribute this integration (for Spring 3 that is)? Is there a standard?

UPDATE

Sorry I wasn’t cleared about what I meant by “distribute” 🙂 I meant in the sense that other developers can include this framework as an artifact in their project (perhaps as a jar), similar to how libraries are distributed. I’m just confused by the fact that there is webapp-specific stuff in there.

  • 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-19T16:27:02+00:00Added an answer on May 19, 2026 at 4:27 pm

    Making a maven webapp project into a framework will be a bit of hassle for other people to use. The problem isn’t about what you should include/exclude but what the downstream webapp project should include/exclude. The downstream project will need to exclude the web.xml from its war dependency and need to make sure that it doesn’t contain file/folder names which collide with its depending war files.

    Normally, web.xml is exculded by maven-war-plugin but configurations files like logger configurations will not be exculded by default and it will be crash with the downstream project’s. Since the web.xml is exculded, the downstream project will not be able to know what are the servlet definitions in its war dependencies. You will need to copy or define them accordingly yourself.

    Since you do not have any changes to your web.xml, I think you are not going to run it as webapp. You should make it into jar package, instead of war package, and convert it to normal maven jar project, i.e. remove src/main/webapp folder

    Although it is possible to have a war dependency, I highly recommend not to.

    Update

    From your comment, that’s what I am worried about too. It is probably the only reason you have to use war package. So you will need to keep in mind that:

    1. If you have the spring dispatcher configuration xml and bean definition under src/main/webapp, make sure to include/exculde them in your downstream project correctly using configuration setting for maven-war-plugin. Make sure the filename won’t crash with the downstream project. You will need to becareful when you want to reuse beans definition since it may not be configured to suit the need of the downstream project. In many case, you will end up writing a new definition. Tip: putting them as resources under unique package name in the classpath is the safest and easiest way.

    2. The web.xml have to be there in order to make a war package, but it will be exculded from downstream war project by maven-war-plugin. You need to inculde this plugin in your downstream project. If you have any servlet definition in web.xml, it will have be redefined in downstream project web.xml.

    3. Becareful with folder/file collision in under src/main/webapp folder.

    In summary, the main concern is the place where you put xml configuration nd how you want to include/exclude it in the downstream project (not in your integration).

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

Sidebar

Related Questions

No related questions found

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.