I've taken an approach which separates parents and aggregates.  I've put
all my parents into one eclipse project, each with a folder naming the
parent, and in that folder, a pom.xml; this is of course a "flat"
structure.  These I then "mvn install" into my local repo, and/or
deploy.  I'm following the convention of labeling these with version
like 1, 2, 3 ... see for instance the common apache pom
(http://repo1.maven.org/maven2/org/apache/apache/7/apache-7.pom).  Using
m2eclipse you can select the folder containing a pom, right click, and
pick the run -> mvn install to do this very easily (or from the main
Eclipse run menu, once you do it once this right-click way, because it
gets set up as an Eclipse run configuration).

The aggregate poms just do aggregation, and are not parents of anything.

With this approach, I think that there is no need to have relativePath set.

-Marshall


On 4/27/2010 5:17 AM, subir.sasiku...@wipro.com wrote:
> You need to add a <relativePath> for parent elements. Its mandatory in
> Maven 3.
> Add those and your builds should work.
>
> And you can always see other issues about compatibility by googling.
>
> Subir 
>
> -----Original Message-----
> From: Robert Einsle [mailto:rob...@einsle.de] 
> Sent: Tuesday, April 27, 2010 12:59 PM
> To: Maven Users List
> Subject: Different behavior of Maven 2 and 3 on Flat Projekt Layout
>
> Hy List,
>
> lets assume i have 3 Projects:
>
> xx.yy.app.parent
> xx.yy.app.module1
> xx.yy.app.module2
>
> .parent is Parent of both modules
>
> --- cut ---
> <parent>
> <artifactId>xx.yy.app.parent</artifactId>
> <groupId>xx.yy.app</groupId>
> <version>1.0.0-SNAPSHOT</version>
> </parent>
> <modelVersion>4.0.0</modelVersion>
> <groupId>xx.yy.app</groupId>
> <artifactId>xx.yy.app.module1</artifactId>
> <version>1.0.0-SNAPSHOT</version>
> <name>Module 1</name>
> --- cut ---
>
> , in .parent the both modules are linked with:
>
> --- cut ---
> <modules>
> <module>../xx.yy.app.module1</module>
> <module>../xx.yy.app.module2</module>
> </modules>
> --- cut ---
>
> Now i start "clean package" on Eclipse, my output is:
>
> --- cut ---
> [INFO] Scanning for projects...
> [ERROR] The build could not read 2 projects -> [Help 1]
> [ERROR]   The project xx.yy.app:xx.yy.app.module1:1.0.0-SNAPSHOT 
> (D:\Eclipse_Workspaces\maven-3.5.2\xx.yy.app.module1\pom.xml) has 1
> error
> [ERROR]     Non-resolvable parent POM 
> xx.yy.app:xx.yy.app.parent:1.0.0-SNAPSHOT for
> xx.yy.app:xx.yy.app.module1:1.0.0-SNAPSHOT: Failed to resolve POM for
> xx.yy.app:xx.yy.app.parent:1.0.0-SNAPSHOT due to Missing:
> ----------
> 1) xx.yy.app:xx.yy.app.parent:pom:1.0.0-SNAPSHOT
> ----------
> 1 required artifact is missing.
>
> for artifact:
>    xx.yy.app:xx.yy.app.parent:pom:1.0.0-SNAPSHOT
>
> from the specified remote repositories:
>    central (http://repo1.maven.org/maven2, releases=true,
> snapshots=false)
>      -> [Help 2]
> [ERROR]   The project xx.yy.app:xx.yy.app.module2:1.0.0-SNAPSHOT 
> (D:\Eclipse_Workspaces\maven-3.5.2\xx.yy.app.module2\pom.xml) has 1
> error
> [ERROR]     Non-resolvable parent POM 
> xx.yy.app:xx.yy.app.parent:1.0.0-SNAPSHOT for
> xx.yy.app:xx.yy.app.module2:1.0.0-SNAPSHOT: Failed to resolve POM for
> xx.yy.app:xx.yy.app.parent:1.0.0-SNAPSHOT due to Missing:
> ----------
> 1) xx.yy.app:xx.yy.app.parent:pom:1.0.0-SNAPSHOT
> ----------
> 1 required artifact is missing.
>
> for artifact:
>    xx.yy.app:xx.yy.app.parent:pom:1.0.0-SNAPSHOT
>
> from the specified remote repositories:
>    central (http://repo1.maven.org/maven2, releases=true,
> snapshots=false)
>      -> [Help 2]
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the
> -e switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions,
> please read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingExceptio
> n
> [ERROR] [Help 2]
> http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelExcept
> ion
> --- cut ---
>
> when i run this on Maven 2.2.1
>
> --- cut ---
> [INFO] Scanning for projects...
> [INFO] Reactor build order:
> [INFO]   Application Parent
> [INFO]   Module 1
> [INFO]   Module 2
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building Application Parent
> [INFO]    task-segment: [clean, package]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] [clean:clean {execution: default-clean}] [INFO]
> [site:attach-descriptor {execution: default-attach-descriptor}] [INFO]
> ------------------------------------------------------------------------
> [INFO] Building Module 1
> [INFO]    task-segment: [clean, package]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] [clean:clean {execution: default-clean}] [INFO] Deleting
> directory D:\Eclipse_Workspaces\maven-3.5.2\xx.yy.app.module1\target
> [INFO] [resources:resources {execution: default-resources}] [WARNING]
> Using platform encoding (Cp1252 actually) to copy filtered resources,
> i.e. build is platform dependent!
> [INFO] Copying 0 resource
> [INFO] [compiler:compile {execution: default-compile}] [INFO] Nothing to
> compile - all classes are up to date [INFO] [resources:testResources
> {execution: default-testResources}] [WARNING] Using platform encoding
> (Cp1252 actually) to copy filtered resources, i.e. build is platform
> dependent!
> [INFO] skip non existing resourceDirectory
> D:\Eclipse_Workspaces\maven-3.5.2\xx.yy.app.module1\src\test\resources
> [INFO] [compiler:testCompile {execution: default-testCompile}] [INFO] No
> sources to compile [INFO] [surefire:test {execution: default-test}]
> [INFO] No tests to run.
> [INFO] [jar:jar {execution: default-jar}] [INFO] Building jar: 
> D:\Eclipse_Workspaces\maven-3.5.2\xx.yy.app.module1\target\xx.yy.app.mod
> ule1-1.0.0-SNAPSHOT.jar
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building Module 2
> [INFO]    task-segment: [clean, package]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] [clean:clean {execution: default-clean}] [INFO] Deleting
> directory D:\Eclipse_Workspaces\maven-3.5.2\xx.yy.app.module2\target
> [INFO] [resources:resources {execution: default-resources}] [WARNING]
> Using platform encoding (Cp1252 actually) to copy filtered resources,
> i.e. build is platform dependent!
> [INFO] Copying 0 resource
> [INFO] [compiler:compile {execution: default-compile}] [INFO] Nothing to
> compile - all classes are up to date [INFO] [resources:testResources
> {execution: default-testResources}] [WARNING] Using platform encoding
> (Cp1252 actually) to copy filtered resources, i.e. build is platform
> dependent!
> [INFO] skip non existing resourceDirectory
> D:\Eclipse_Workspaces\maven-3.5.2\xx.yy.app.module2\src\test\resources
> [INFO] [compiler:testCompile {execution: default-testCompile}] [INFO] No
> sources to compile [INFO] [surefire:test {execution: default-test}]
> [INFO] No tests to run.
> [INFO] [jar:jar {execution: default-jar}] [INFO] Building jar: 
> D:\Eclipse_Workspaces\maven-3.5.2\xx.yy.app.module2\target\xx.yy.app.mod
> ule2-1.0.0-SNAPSHOT.jar
> [INFO]
> [INFO]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Reactor Summary:
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Application Parent .................................... SUCCESS
> [3.453s] [INFO] Module 1 ..............................................
> SUCCESS [1.953s] [INFO] Module 2
> .............................................. SUCCESS [0.125s] [INFO]
> ------------------------------------------------------------------------
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 5 seconds
> [INFO] Finished at: Tue Apr 27 09:21:48 CEST 2010 [INFO] Final Memory:
> 14M/34M [INFO]
> ------------------------------------------------------------------------
> --- cut ---
>
> The same behavoir i have running it on plain Maven.
>
> Does maven 3 don't allow flat multi project layout?
>
> how can i resolve this Problem?
>
> Thanks
>
> Robert
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to