You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Alejandro Abdelnur (JIRA)" <ji...@apache.org> on 2011/08/03 18:55:27 UTC

[jira] [Commented] (HADOOP-7506) hadoopcommon build version cant be set from the maven commandline

    [ https://issues.apache.org/jira/browse/HADOOP-7506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13078839#comment-13078839 ] 

Alejandro Abdelnur commented on HADOOP-7506:
--------------------------------------------

Note Maven warning on this:

{code}
[WARNING] Some problems were encountered while building the effective model for org.apache.hadoop:hadoop-project:pom:0.23.0-SNAPSHOST
[WARNING] 'version' contains an expression but should be a constant. @ org.apache.hadoop:hadoop-project:${hadoop.version}, /Users/tucu/src/apache/hadoop/utrunk/hadoop-project/pom.xml, line 19, column 12
{code}

In addition, this won't work (I've tried this approach a couple of years ago when starting with Oozie) for the following reason:

The installed/deployed POMs will have a variable as the version and Maven dependency resolution won't be able to resolve that variable to a concrete value. Following there is a minimal POM that fails after doing a 'mvn install' with the HADOOP-7506 patch. (Make sure you trash other snapshots of hadoop-* and you are using -offline, to force the use of the just installed artifacts).

{code}
<?xml version="1.0" encoding="UTF-8"?>
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>x</groupId>
  <artifactId>x</artifactId>
  <version>1</version>
  <packaging>jar</packaging>

  <dependencies>
    <dependency>
    <groupId>org.apache.hadoop</groupId>
    <artifactId>hadoop-common</artifactId>
    <version>0.23.0-SNAPSHOT</version>
    </dependency>
  </dependencies>

</project>
{code}

One of the reasons for the failure is that the version is defined in hadoop-common's parent POM (hadoop-project) and then Maven cannot determine the version of hadoop-project to use because (chicken & egg problem).

The Maven way to take care of version upgrades through out the POMs is using the maven-release-plugin (I've used it in the past and it works quite well in multi-module projects)




> hadoopcommon build version cant be set from the maven commandline
> -----------------------------------------------------------------
>
>                 Key: HADOOP-7506
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7506
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: build
>    Affects Versions: 0.23.0
>            Reporter: Giridharan Kesavan
>            Assignee: Giridharan Kesavan
>         Attachments: HADOOP-7506.PATCH
>
>
> pom.xml had to introduce hadoop.version property with the default value set to the snapshot version. If someone during build time want to override the version from maven command line they can do so by passing -Dhadoop.version="". For ppl who doesnt want to change the default version can continue building. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira