[
https://jira.codehaus.org/browse/MNG-2241?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul Benedict updated MNG-2241:
-------------------------------
Fix Version/s: (was: Issues to be reviewed for 3.x)
> Versions are required when it shouldn't with multi-modules projects and war
> dependencies
> ----------------------------------------------------------------------------------------
>
> Key: MNG-2241
> URL: https://jira.codehaus.org/browse/MNG-2241
> Project: Maven
> Issue Type: Bug
> Components: Dependencies
> Affects Versions: 2.0.4
> Environment: Maven 2.0.4, Java 5, Windows XP
> Reporter: Celso Gomes Barreto Junior
>
> In a multi-project with a parent pom which should enforces modules's versions
> in dependencyManagement element, when I use a war dependnecy it starts to
> require the version declaration in child pom's dependencies. When I use jar
> dependencies, it works fine.
> {noformat}
> Project structure:
> parent project
> |_ web (war)
> |_ commons (jar)
> |_ webcommons (war)
> {noformat}
> --------------------------------------------------
> parent project pom:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <project>
> <modelVersion>4.0.0</modelVersion>
> <name>Procdev - ReferĂȘncia</name>
> <groupId>globo</groupId>
> <artifactId>procdevref</artifactId>
> <packaging>pom</packaging>
> <version>0.0.1</version>
> <description>no</description>
> <modules>
> <module>web</module>
> <module>commons</module>
> <module>webcommons</module>
> </modules>
> <dependencyManagement>
> <dependencies>
> <dependency>
> <groupId>globo</groupId>
> <artifactId>procdevref-web</artifactId>
> <version>${project.version}</version>
> </dependency>
> <dependency>
> <groupId>globo</groupId>
> <artifactId>procdevref-commons</artifactId>
> <version>${project.version}</version>
> </dependency>
> <dependency>
> <groupId>globo</groupId>
> <artifactId>procdevref-webcommons</artifactId>
> <version>${project.version}</version>
> </dependency>
> </dependencies>
> </dependencyManagement>
> <dependencies>
> <dependency>
> <groupId>junit</groupId>
> <artifactId>junit</artifactId>
> <version>3.8.1</version>
> <scope>test</scope>
> </dependency>
> </dependencies>
> </project>
> {code}
> --------------------------------------------------
> web project pom:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <project>
> <modelVersion>4.0.0</modelVersion>
> <parent>
> <groupId>globo</groupId>
> <artifactId>procdevref</artifactId>
> <version>0.0.1</version>
> </parent>
> <name>Procdev Web</name>
> <artifactId>procdevref-web</artifactId>
> <packaging>war</packaging>
> <version>0.0.1</version>
> <description>no</description>
> <dependencies>
> <dependency>
> <groupId>globo</groupId>
> <artifactId>procdevref-webcommons</artifactId>
> <type>war</type>
> </dependency>
> <dependency>
> <groupId>globo</groupId>
> <artifactId>procdevref-commons</artifactId>
> </dependency>
> <dependency>
> <groupId>jstl</groupId>
> <artifactId>jstl</artifactId>
> <version>[1.1.2,]</version>
> </dependency>
> <dependency>
> <groupId>taglibs</groupId>
> <artifactId>standard</artifactId>
> <version>[1.1.2,]</version>
> </dependency>
> </dependencies>
> </project>
> {code}
> --------------------------------------------------
> webcommons project pom:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <project>
> <modelVersion>4.0.0</modelVersion>
> <parent>
> <groupId>globo</groupId>
> <artifactId>procdevref</artifactId>
> <version>0.0.1</version>
> </parent>
> <name>Procdev Web Commons</name>
> <artifactId>procdevref-webcommons</artifactId>
> <packaging>war</packaging>
> <version>0.0.1</version>
> <description>no</description>
> </project>
> {code}
> --------------------------------------------------
> commons project pom:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <project>
> <modelVersion>4.0.0</modelVersion>
> <parent>
> <groupId>globo</groupId>
> <artifactId>procdevref</artifactId>
> <version>0.0.1</version>
> </parent>
> <name>Procdev Commons</name>
> <artifactId>procdevref-commons</artifactId>
> <packaging>jar</packaging>
> <version>0.0.1</version>
> <description>no</description>
> </project>
> {code}
> When i Run it with "mvn -X clean install" I get:
> {noformat}
> + Error stacktraces are turned on.
> Maven version: 2.0.4
> [DEBUG] Building Maven user-level plugin registry from: 'C:\Documents and
> Settings\celso.cs\.m2\plugin-registry.xml'
> [DEBUG] Building Maven global-level plugin registry from:
> 'C:\java\maven-2.0.4\bin\..\conf\plugin-registry.xml'
> [INFO] Scanning for projects...
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Error building POM (may not be this project's POM).
> Project ID: globo:procdevref-web
> POM Location: C:\Projetos\ProcdevReferencia\web\pom.xml
> Validation Messages:
> [0] 'dependencies.dependency.version' is missing for
> globo:procdevref-webcommons
> Reason: Failed to validate POM
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.1.6#6162)