Note that there are some explanatory texts on larger screens.

plurals
  1. POMaven multi module project error
    primarykey
    data
    text
    <p>I'm using the followin folder structure:</p> <pre><code>SpringMvcExample \_ pom.xml (root pom) \_ parent \_ pom.xml (parent pom) \_ model \_ src \_ pom.xml (child pom) </code></pre> <p>Here are files examples:</p> <p>root.pom:</p> <pre><code> &lt;groupId&gt;com.pack&lt;/groupId&gt; &lt;artifactId&gt;SpringMvcExample&lt;/artifactId&gt; &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt; &lt;packaging&gt;pom&lt;/packaging&gt; &lt;name&gt;SpringMvcExample&lt;/name&gt; &lt;url&gt;http://maven.apache.org&lt;/url&gt; &lt;properties&gt; &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt; &lt;/properties&gt; &lt;build&gt; &lt;defaultGoal&gt;package&lt;/defaultGoal&gt; &lt;/build&gt; &lt;modules&gt; &lt;module&gt;parent&lt;/module&gt; &lt;module&gt;model&lt;/module&gt; &lt;/modules&gt; </code></pre> <p>parent pom:</p> <pre><code>&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;com.pack&lt;/groupId&gt; &lt;artifactId&gt;parent&lt;/artifactId&gt; &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt; &lt;packaging&gt;pom&lt;/packaging&gt; &lt;name&gt;parent&lt;/name&gt; &lt;url&gt;http://maven.apache.org&lt;/url&gt; &lt;properties&gt; &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt; &lt;/properties&gt; &lt;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;dependency&gt; &lt;groupId&gt;com.pack&lt;/groupId&gt; &lt;artifactId&gt;model&lt;/artifactId&gt; &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt; &lt;/dependency&gt; &lt;/dependencies&gt; </code></pre> <p>model pom:</p> <pre><code>&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;parent&gt; &lt;groupId&gt;com.pack&lt;/groupId&gt; &lt;artifactId&gt;parent&lt;/artifactId&gt; &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt; &lt;relativePath&gt;../parent&lt;/relativePath&gt; &lt;/parent&gt; &lt;groupId&gt;com.pack&lt;/groupId&gt; &lt;artifactId&gt;model&lt;/artifactId&gt; &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt; &lt;name&gt;model&lt;/name&gt; &lt;url&gt;http://maven.apache.org&lt;/url&gt; &lt;properties&gt; &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt; &lt;/properties&gt; &lt;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; </code></pre> <p>When I try to invoke mvn clean install from the model folder I'm getting the following error:</p> <pre><code>[ERROR] Failed to execute goal on project model: Could not resolve dependencies for project com.pack:model:jar:1.0-SNAPSHOT: Could not find artifact com.pack:model:jar:1.0-SNAPSOT -&gt; [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project model: Could not resolve dependencies for project com.pack:model:jar:1.0-SNAPSHOT: Could not find artifact com.pack:model:jar:1.0-SNAPSHOT </code></pre> <p>What should I do to resolve it?</p> <p>Updated: Cause not all people have met with the same structure, <a href="http://maventweaks.blogspot.ru/2010/10/best-practices-for-multi-module-project.html" rel="nofollow">here</a> is a link to blog that describes it, its advantages and drawbacks. And here is an <a href="https://github.com/jabbrwcky/sample-maven-structure" rel="nofollow">example</a> that I'm trying to reuse.</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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