Note that there are some explanatory texts on larger screens.

plurals
  1. POMaven doesn't recognize sibling modules when running mvn dependency:tree
    primarykey
    data
    text
    <p>I'm trying to set up a multi-module Maven project, and the inter-module dependencies are apparently not being set up correctly.</p> <p>I have:</p> <pre class="lang-xml prettyprint-override"><code>&lt;modules&gt; &lt;module&gt;commons&lt;/module&gt; &lt;module&gt;storage&lt;/module&gt; &lt;/modules&gt; </code></pre> <p>in the parent POM (which has a packaging-type pom) and then subdirectories <code>commons/</code> and <code>storage/</code> which define JAR poms with the same name.</p> <p>Storage depends on Commons.</p> <p>In the main (master) directory, I run <code>mvn dependency:tree</code> and see:</p> <pre class="lang-xml prettyprint-override"><code>[INFO] Building system [INFO] task-segment: [dependency:tree] [INFO] ------------------------------------------------------------------------ [INFO] [dependency:tree {execution: default-cli}] [INFO] domain:system:pom:1.0-SNAPSHOT [INFO] \- junit:junit:jar:3.8.1:test [INFO] ------------------------------------------------------------------------ [INFO] Building commons [INFO] task-segment: [dependency:tree] [INFO] ------------------------------------------------------------------------ [INFO] [dependency:tree {execution: default-cli}] ...correct tree... [INFO] ------------------------------------------------------------------------ [INFO] Building storage [INFO] task-segment: [dependency:tree] [INFO] ------------------------------------------------------------------------ Downloading: http://my.repo/artifactory/repo/domain/commons/1.0-SNAPSHOT/commons-1.0-SNAPSHOT.jar [INFO] Unable to find resource 'domain:commons:jar:1.0-SNAPSHOT' in repository my.repo (http://my.repo/artifactory/repo) [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Failed to resolve artifact. Missing: ---------- 1) domain:commons:jar:1.0-SNAPSHOT </code></pre> <p>Why does the dependency on "commons" fail, even though the reactor has obviously seen it because it successfully processes its dependency tree? It should definitely not be going to the 'net to find it as it's right there...</p> <p>The pom for storage:</p> <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;packaging&gt;jar&lt;/packaging&gt; &lt;parent&gt; &lt;artifactId&gt;system&lt;/artifactId&gt; &lt;groupId&gt;domain&lt;/groupId&gt; &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt; &lt;/parent&gt; &lt;groupId&gt;domain&lt;/groupId&gt; &lt;artifactId&gt;storage&lt;/artifactId&gt; &lt;name&gt;storage&lt;/name&gt; &lt;url&gt;http://maven.apache.org&lt;/url&gt; &lt;dependencies&gt; &lt;!-- module dependencies --&gt; &lt;dependency&gt; &lt;groupId&gt;domain&lt;/groupId&gt; &lt;artifactId&gt;commons&lt;/artifactId&gt; &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt; &lt;/dependency&gt; &lt;!-- other dependencies --&gt; &lt;dependency&gt; &lt;groupId&gt;junit&lt;/groupId&gt; &lt;artifactId&gt;junit&lt;/artifactId&gt; &lt;version&gt;3.8.1&lt;/version&gt; &lt;scope&gt;test&lt;/scope&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;/project&gt; </code></pre> <p>Thanks for any suggestions!</p> <p>(Edit)</p> <p>To clarify, what I am looking for here is this: I don't want to have to install module X to build module Y which depends on X, given that both are modules referenced from the same parent POM. This makes intuitive sense to me that if I have two things in the same source tree, I shouldn't have to install intermediate products to continue the build. Hopefully my thinking makes some sense here...</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.
 

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