Hadoop Common
  1. Hadoop Common
  2. HADOOP-8094

Make maven-eclipse-plugin use the spring project nature

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Not a Problem
    • Affects Version/s: 0.23.0
    • Fix Version/s: None
    • Component/s: build
    • Labels:

      Description

      If I want to have multiple versions of Apache Hadoop loaded into my Eclipse IDE today (or any other IDE maybe), I'm supposed to do the following when generating eclipse files, such that the version name is appended to the project name and thereby resolves conflict in project names when I import another version in:

      mvn -Declipse.addVersionToProjectName=true eclipse:eclipse

      But this does not work presently due to a lack of configuration in Apache Hadoop, which https://jira.codehaus.org/browse/MECLIPSE-702 demands. The problem being that though the project names are indeed named with version suffixes, the "related project" name it carries for dependencies do not carry the same suffix and therefore you have a broken import of projects errors everywhere about 'dependent project <regularname> not found'.

      The fix is as Carlo details on https://jira.codehaus.org/browse/MECLIPSE-702 and it works perfectly. I'll attach a patch adding in the same configuration for Apache Hadoop so that the above mechanism is then possible.

        Activity

        Hide
        Harsh J added a comment -

        Actually this whole change can be avoided if one uses M2E plugin for Eclipse. It works fine now (latest updates) with Apache Hadoop projects.

        Resolving as not-an-issue. We should just stop using mvn eclipse:eclipse and get it imported inside Eclipse as maven projects instead.

        Show
        Harsh J added a comment - Actually this whole change can be avoided if one uses M2E plugin for Eclipse. It works fine now (latest updates) with Apache Hadoop projects. Resolving as not-an-issue. We should just stop using mvn eclipse:eclipse and get it imported inside Eclipse as maven projects instead.
        Hide
        Harsh J added a comment -

        (Btw, patch does not change the default eclipse:eclipse behavior - just adds the spring nature for those who want to leverage it.)

        Show
        Harsh J added a comment - (Btw, patch does not change the default eclipse:eclipse behavior - just adds the spring nature for those who want to leverage it.)
        Hide
        Harsh J added a comment -

        Patch does apply but one file is in root of project, the other is in HDFS - QA can't apply this.

        Show
        Harsh J added a comment - Patch does apply but one file is in root of project, the other is in HDFS - QA can't apply this.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12515263/HADOOP-8094.patch
        against trunk revision .

        +1 @author. The patch does not contain any @author tags.

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        -1 patch. The patch command could not apply the patch.

        Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/614//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12515263/HADOOP-8094.patch against trunk revision . +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. -1 patch. The patch command could not apply the patch. Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/614//console This message is automatically generated.
        Hide
        Harsh J added a comment -

        Patch that adds in project-nature configuration.

        Ideally we need only touch the parent hadoop/pom.xml and it propagates the settings of plugins to rest.

        However, I needed to edit the httpfs pom cause it is already overriding the maven-eclipse-plugin (HDFS-2649 needed/added this) and therefore I have to duplicate the configuration there.

        I've added in a comment that indicates it can be removed when the override itself is removed.

        I manually tested this with:

        mvn eclipse:clean; mvn -Declipse.addVersionToProjectName=true eclipse:eclipse

        And then reimported all projects - they carried version suffixes and had no issues with dependencies on one another.

        Show
        Harsh J added a comment - Patch that adds in project-nature configuration. Ideally we need only touch the parent hadoop/pom.xml and it propagates the settings of plugins to rest. However, I needed to edit the httpfs pom cause it is already overriding the maven-eclipse-plugin ( HDFS-2649 needed/added this) and therefore I have to duplicate the configuration there. I've added in a comment that indicates it can be removed when the override itself is removed. I manually tested this with: mvn eclipse:clean; mvn -Declipse.addVersionToProjectName=true eclipse:eclipse And then reimported all projects - they carried version suffixes and had no issues with dependencies on one another.

          People

          • Assignee:
            Harsh J
            Reporter:
            Harsh J
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development