Note that there are some explanatory texts on larger screens.

plurals
  1. POMaven Multi Module Project
    primarykey
    data
    text
    <p>I havent used Maven extensively</p> <p>Presently have 5 different maven projects , Each has a different pom.xml. As of now there is dependency relationship between them , each one points to other in &lt; dependency > if needed.</p> <p><img src="https://i.stack.imgur.com/2mObi.png" alt="enter image description here"></p> <p>Presently the thing we dont like are </p> <ol> <li>When we release a child projectA , then we need to manually modify all projects having projectA as a dependency to use new version. <strong><em>Saw Maven has a version plugin , not sure how that will help.</em></strong></li> <li>As a solution I want to have a cleaner organization between poms , and possible avoid above issue.</li> </ol> <p><strong>What i thought is ( <em>may be incorrect</em> )</strong> </p> <p><img src="https://i.stack.imgur.com/Z0Yss.png" alt="enter image description here"></p> <p>Where <strong>fat arrow</strong> represents Parent Child relationship and a <strong>thin arrow</strong> represents sub-module. But this does not seem to be working, see code and errors below</p> <p><strong>Child Project 2 pom</strong></p> <pre><code> &lt;groupId&gt;ChildProject2&lt;/groupId&gt; &lt;artifactId&gt;ChildProject2&lt;/artifactId&gt; &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt; &lt;parent&gt; &lt;groupId&gt;Parent&lt;/groupId&gt; &lt;artifactId&gt;Parent&lt;/artifactId&gt; &lt;version&gt;${parent.version}&lt;/version&gt; &lt;relativePath&gt;../Parent/pom.xml&lt;/relativePath&gt; &lt;/parent&gt; &lt;dependencies&gt; ... &lt;/dependencies&gt; </code></pre> <p><strong>ChildProject2 - Error</strong> Project build error: Non-resolvable parent POM: Failure to transfer Parent:Parent:pom:${parent.version} from <a href="http://repo1.maven.org/maven2" rel="nofollow noreferrer">http://repo1.maven.org/maven2</a> was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact Parent:Parent:pom:${parent.version} from/to central (<a href="http://repo1.maven.org/maven2" rel="nofollow noreferrer">http://repo1.maven.org/maven2</a>): Illegal character in path at index 45: <a href="http://repo1.maven.org/maven2/Parent/Parent/" rel="nofollow noreferrer">http://repo1.maven.org/maven2/Parent/Parent/</a>${parent.version}/Parent-${parent.version}.pom and 'parent.relativePath' points at wrong local POM</p> <p><strong>Parent pom</strong></p> <pre><code> &lt;groupId&gt;Parent&lt;/groupId&gt; &lt;artifactId&gt;Parent&lt;/artifactId&gt; &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt; &lt;packaging&gt;pom&lt;/packaging&gt; &lt;properties&gt; &lt;parent.version&gt;0.0.1-SNAPSHOT&lt;/parent.version&gt; &lt;/properties&gt; &lt;modules&gt; &lt;module&gt;../ChildProject2&lt;/module&gt; &lt;module&gt;../ChildProject1&lt;/module&gt; &lt;/modules&gt; &lt;dependencies&gt; ... &lt;/dependencies&gt; </code></pre> <p><strong>GrandParent2 pom</strong></p> <pre><code> &lt;groupId&gt;GrandParent2&lt;/groupId&gt; &lt;artifactId&gt;GrandParent2&lt;/artifactId&gt; &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt; &lt;packaging&gt;pom&lt;/packaging&gt; &lt;properties&gt; &lt;grandparent2.version&gt;0.0.1-SNAPSHOT&lt;/grandparent2.version&gt; &lt;/properties&gt; &lt;modules&gt; &lt;module&gt;../Parent&lt;/module&gt; &lt;/modules&gt; &lt;dependencies&gt;... &lt;/dependencies&gt; </code></pre> <p><strong>ParentMain.java</strong></p> <pre><code>public class ParentMain { public static void main(String[] args) { DocumentFactory df = new DocumentFactory(); ChildProject1Main cp1 = new ChildProject1Main(); ChildProject2Main cp2 = new ChildProject2Main(); } } </code></pre> <p><strong>ParentMain - Errors</strong></p> <ol> <li><ul> <li>ChildProject1Main cannot be resolved to a type</li> </ul></li> <li><ul> <li>ChildProject1Main cannot be resolved to a type</li> </ul></li> </ol> <p>I am currently using <strong>Maven Version</strong> 2.2.1 (open to upgrading if this can be solved using upgraded maven version) <em>One of the comments below says can solve this using " CI tools out there such as Jenkins and TeamCity" ..</em> <strong>any pointer (examples) how to solve this using Maven ( and or Hudson )??</strong></p> <p>What am i doing wrong , how to get best design for such project dependencies</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.
 

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