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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:36:15+00:00 2026-06-01T15:36:15+00:00

I’ve been looking into multi-module projects in Maven, and I can only find examples

  • 0

I’ve been looking into multi-module projects in Maven, and I can only find examples of modules existing as subdirectories to a parent project. Would I be mistaken in deducing from this that there’s no way to share a module between two maven projects without having to package it up and deploy it to a repository? That would strike me as needlessly cumbersome.

For example, say I’m actively working on two related projects that don’t talk to each other except through an API bridge I’m working on that I plan to use for future things. The bridge is constantly updating as work on the two projects progress.

So, if I want to leverage Maven modules for this effort, one project pom.xml would look like this…

<groupId>net.syndog</groupId>
<artifactId>myproject</artifactId>
.
.
.
<modules>
    <module>myproject-bridge</module>
</modules>

…and another looks like this…

<groupId>net.syndog</groupId>
<artifactId>myotherproject</artifactId>
.
.
.
<modules>
    <module>myproject-bridge</module>
</modules>

Assuming modules in Maven must be subdirectories of the projects in which they’re a part of, how can myproject and myotherproject both use the myproject-bridge module at once?

Is this even possible with Maven, or do I have to package and deploy myproject-bridge to a repo every time I make a tweak to it? Perhaps I’m mistaken, but this seems like it would be such a commonplace issue, but no one seems to be talking about it. Am I going about this all wrong?

  • 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-06-01T15:36:16+00:00Added an answer on June 1, 2026 at 3:36 pm

    The usual way of using such a dependency is to define a dependency which results in this:

    <dependency>
      <groupId>net.syndog</groupId>
      <artifactId>xyz-api</artifactId>
      <version>1.0-SNAPSHOT</version>
    </dependency>
    

    but the result of this approach is that you need to have a separate project which contains exactly this api. This can be simplified by using a IDE which solves the dependencies between the projects via the workspaces instead of the repository. Otherwise you need to do regularly a mvn install (if you are working locally only) or mvn deploy (via repository manager).

    The other solution would be to use a real multi-module project which would look like this:

    +-- pom.xml (root)
    +-- myproject-bridge
         +--- pom.xml
    +-- myproject-a
         +--- pom.xml
    +-- myproject-b
         +--- pom.xml
    

    where project-a and project-b using the myproject-bridge via a simple dependency. In the root you define the modules (as you mentioned) via

    <modules>
     <module>myproject-bridge</module>
     <module>myproject-a</module>
     <module>myproject-b</module>
    </modules>
    

    and in myproject-a you simply define

    <dependency>
      <groupId>net.syndog</groupId>
      <artifactId>xyz-api</artifactId>
      <version>${project.version}</version>
    </dependency>
    

    and in myproject-b the same way.
    You must be aware that using a module does not necessarily means to define a dependency. This gives you also the opportunity to use the myproject-bridge from a complete different project either after release or as SNAPSHOT.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
I am currently running into a problem where an element is coming back from

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.