Note that there are some explanatory texts on larger screens.

plurals
  1. POIndependently building Maven submodules
    primarykey
    data
    text
    <p>After being introduced to Maven in my most recent project, I've been experimenting with it for the past couple of weeks.</p> <p>I currently have a multi-module project in my development environment. Project "A" and Project "B" are child modules of Project "root", with B having a dependency on A.</p> <p>I am aware that I can build B <strong>independently</strong> by using <code>mvn reactor:make...</code> as outlined <a href="http://maven.apache.org/plugins/maven-reactor-plugin/examples.html" rel="nofollow">here</a>. However, I'm curious as to why am I not allowed to build B from inside B's root folder.</p> <p>To illustrate this, I first built A independently by running a <code>clean install</code> from within A's root directory. However, when I tried doing the same action from B's root directory, Maven reported an error as below -</p> <pre><code>Could not find artifact org.divesh.mavenrnd:root:pom:1.0 in central </code></pre> <p>It looks like Maven is not able to resolve the parent's POM file. Any thoughts on why this is happening? From my initial understanding of Maven multi-module projects, the main reason to split a project into sub modules is to share dependencies. This should not, however, prevent me from building a particular module independently from within its folder.</p> <p>Thanks.</p> <p><strong>EDIT</strong></p> <p>Ran an <code>mvn -N clean install</code> to install only the root project's POM in the rep. After this, I was able to successfully build B after building and installing A. There is still one thing I'm not quite clear about - Assuming I've installed the root project's POM in the repository, if I try to build A, does it refer to the parent root POM directly above it or the POM that is installed in the repository?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload