FAQ
Hi All,



I can see lot of compilation issues after setting up my development
environment using "mvn eclipse:eclipse".

All these compilation issues are resolved after adding
"target/generated-test-sources" as a source folder to the common project.



When verified the "pom.xml", it's noticed that these are included under
"generate-test-sources" phase.

This seems to be a problem occurred because of incorrect understanding/usage
of "build-helper-maven-plugin" in Common project.



All these compilation issues are resolved after changing the phase to
"generate-sources".



Please correct me if my understanding is wrong.



I found similar issue here.

https://issues.sonatype.org/browse/MNGECLIPSE-2387

--

Thanks,

Laxman

Search Discussions

  • Alejandro Abdelnur at Sep 20, 2011 at 1:36 pm
    Laxman,

    This is not an incorrect usage of maven phases, those generated Java classes
    are test classes, thus is generation in the 'generate-test-sources' phase.

    The problem seem to be that eclipse does not recognize the
    target/generated-test-source/java directory as a source directory (for
    example, IntelliJ does).

    One thing we could try (not 100% correct but it would simplify the life of
    eclipse developers) is -as you suggest- to change the phase to
    'generate-sources'. But the generated sources and corresponding compiled
    classes there must be compiled and used for testing, the classes should end
    up in the target/test-classes directory.

    If the above is doable it should a nice workaround.

    Please open a JIRA to follow up with this. Note that is not only in common
    that code is generated, but in mapreduce as well. And there are different
    things being generated, avro, protobuf, etc.

    Thanks.

    Alejandro
    On Tue, Sep 20, 2011 at 2:41 AM, Laxman wrote:

    Hi All,



    I can see lot of compilation issues after setting up my development
    environment using "mvn eclipse:eclipse".

    All these compilation issues are resolved after adding
    "target/generated-test-sources" as a source folder to the common project.



    When verified the "pom.xml", it's noticed that these are included under
    "generate-test-sources" phase.

    This seems to be a problem occurred because of incorrect
    understanding/usage
    of "build-helper-maven-plugin" in Common project.



    All these compilation issues are resolved after changing the phase to
    "generate-sources".



    Please correct me if my understanding is wrong.



    I found similar issue here.

    https://issues.sonatype.org/browse/MNGECLIPSE-2387

    --

    Thanks,

    Laxman
  • Robert Evans at Sep 20, 2011 at 2:01 pm
    This is a known issue with the eclipse maven mojo

    http://jira.codehaus.org/browse/MECLIPSE-37

    The JIRA also describes a workaround, add the generated tests directory in the eclipse config with a pom change, which I think would be better then trying to move the phase where test code is generated. So please file a JIRA for it and we can discuss the proper fix in context of that JIRA.

    --Bobby Evans


    On 9/20/11 8:35 AM, "Alejandro Abdelnur" wrote:

    Laxman,

    This is not an incorrect usage of maven phases, those generated Java classes
    are test classes, thus is generation in the 'generate-test-sources' phase.

    The problem seem to be that eclipse does not recognize the
    target/generated-test-source/java directory as a source directory (for
    example, IntelliJ does).

    One thing we could try (not 100% correct but it would simplify the life of
    eclipse developers) is -as you suggest- to change the phase to
    'generate-sources'. But the generated sources and corresponding compiled
    classes there must be compiled and used for testing, the classes should end
    up in the target/test-classes directory.

    If the above is doable it should a nice workaround.

    Please open a JIRA to follow up with this. Note that is not only in common
    that code is generated, but in mapreduce as well. And there are different
    things being generated, avro, protobuf, etc.

    Thanks.

    Alejandro
    On Tue, Sep 20, 2011 at 2:41 AM, Laxman wrote:

    Hi All,



    I can see lot of compilation issues after setting up my development
    environment using "mvn eclipse:eclipse".

    All these compilation issues are resolved after adding
    "target/generated-test-sources" as a source folder to the common project.



    When verified the "pom.xml", it's noticed that these are included under
    "generate-test-sources" phase.

    This seems to be a problem occurred because of incorrect
    understanding/usage
    of "build-helper-maven-plugin" in Common project.



    All these compilation issues are resolved after changing the phase to
    "generate-sources".



    Please correct me if my understanding is wrong.



    I found similar issue here.

    https://issues.sonatype.org/browse/MNGECLIPSE-2387

    --

    Thanks,

    Laxman
  • Alejandro Abdelnur at Sep 20, 2011 at 2:15 pm
    Bobby,

    What is the POM change you are referring to?

    Thanks.

    Alejandro
    On Tue, Sep 20, 2011 at 7:00 AM, Robert Evans wrote:

    This is a known issue with the eclipse maven mojo

    http://jira.codehaus.org/browse/MECLIPSE-37

    The JIRA also describes a workaround, add the generated tests directory in
    the eclipse config with a pom change, which I think would be better then
    trying to move the phase where test code is generated. So please file a
    JIRA for it and we can discuss the proper fix in context of that JIRA.

    --Bobby Evans


    On 9/20/11 8:35 AM, "Alejandro Abdelnur" wrote:

    Laxman,

    This is not an incorrect usage of maven phases, those generated Java
    classes
    are test classes, thus is generation in the 'generate-test-sources' phase.

    The problem seem to be that eclipse does not recognize the
    target/generated-test-source/java directory as a source directory (for
    example, IntelliJ does).

    One thing we could try (not 100% correct but it would simplify the life of
    eclipse developers) is -as you suggest- to change the phase to
    'generate-sources'. But the generated sources and corresponding compiled
    classes there must be compiled and used for testing, the classes should end
    up in the target/test-classes directory.

    If the above is doable it should a nice workaround.

    Please open a JIRA to follow up with this. Note that is not only in common
    that code is generated, but in mapreduce as well. And there are different
    things being generated, avro, protobuf, etc.

    Thanks.

    Alejandro
    On Tue, Sep 20, 2011 at 2:41 AM, Laxman wrote:

    Hi All,



    I can see lot of compilation issues after setting up my development
    environment using "mvn eclipse:eclipse".

    All these compilation issues are resolved after adding
    "target/generated-test-sources" as a source folder to the common project.



    When verified the "pom.xml", it's noticed that these are included under
    "generate-test-sources" phase.

    This seems to be a problem occurred because of incorrect
    understanding/usage
    of "build-helper-maven-plugin" in Common project.



    All these compilation issues are resolved after changing the phase to
    "generate-sources".



    Please correct me if my understanding is wrong.



    I found similar issue here.

    https://issues.sonatype.org/browse/MNGECLIPSE-2387

    --

    Thanks,

    Laxman
  • Robert Evans at Sep 20, 2011 at 2:35 pm
    Sorry that was a different page I looked at before going to the JIRA.

    It said that we can manually add in the target/generated-test-source/java directory as a source directory with something like

    <sourceIncludes>target/generated-test-source/java/**/*.java</sourceIncludes>

    I have no idea if it will work, but it looked cleaner to me.

    --Bobby Evans

    On 9/20/11 9:14 AM, "Alejandro Abdelnur" wrote:

    Bobby,

    What is the POM change you are referring to?

    Thanks.

    Alejandro
    On Tue, Sep 20, 2011 at 7:00 AM, Robert Evans wrote:

    This is a known issue with the eclipse maven mojo

    http://jira.codehaus.org/browse/MECLIPSE-37

    The JIRA also describes a workaround, add the generated tests directory in
    the eclipse config with a pom change, which I think would be better then
    trying to move the phase where test code is generated. So please file a
    JIRA for it and we can discuss the proper fix in context of that JIRA.

    --Bobby Evans


    On 9/20/11 8:35 AM, "Alejandro Abdelnur" wrote:

    Laxman,

    This is not an incorrect usage of maven phases, those generated Java
    classes
    are test classes, thus is generation in the 'generate-test-sources' phase.

    The problem seem to be that eclipse does not recognize the
    target/generated-test-source/java directory as a source directory (for
    example, IntelliJ does).

    One thing we could try (not 100% correct but it would simplify the life of
    eclipse developers) is -as you suggest- to change the phase to
    'generate-sources'. But the generated sources and corresponding compiled
    classes there must be compiled and used for testing, the classes should end
    up in the target/test-classes directory.

    If the above is doable it should a nice workaround.

    Please open a JIRA to follow up with this. Note that is not only in common
    that code is generated, but in mapreduce as well. And there are different
    things being generated, avro, protobuf, etc.

    Thanks.

    Alejandro
    On Tue, Sep 20, 2011 at 2:41 AM, Laxman wrote:

    Hi All,



    I can see lot of compilation issues after setting up my development
    environment using "mvn eclipse:eclipse".

    All these compilation issues are resolved after adding
    "target/generated-test-sources" as a source folder to the common project.



    When verified the "pom.xml", it's noticed that these are included under
    "generate-test-sources" phase.

    This seems to be a problem occurred because of incorrect
    understanding/usage
    of "build-helper-maven-plugin" in Common project.



    All these compilation issues are resolved after changing the phase to
    "generate-sources".



    Please correct me if my understanding is wrong.



    I found similar issue here.

    https://issues.sonatype.org/browse/MNGECLIPSE-2387

    --

    Thanks,

    Laxman
  • Laxman at Sep 20, 2011 at 2:55 pm
    Thanks Bobby and Alejandro for your inputs.
    Please open a JIRA to follow up with this. Note that is not only in common
    that code is generated, but in mapreduce as well. And there are different
    things being generated, avro, protobuf, etc.
    Filed a new JIRA for this issue
    https://issues.apache.org/jira/browse/HADOOP-7660

    Do we need to file a separate JIRA for mapreduce?
    One thing we could try (not 100% correct but it would simplify the life of
    eclipse developers) is -as you suggest- to change the phase to
    'generate-sources'. But the generated sources and corresponding compiled
    classes there must be compiled and used for testing, the classes should end
    up in the target/test-classes directory.
    If we agree upon changing the phase to 'generate-sources' I will submit a
    patch for common.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommon-dev @
categorieshadoop
postedSep 20, '11 at 9:42a
activeSep 20, '11 at 2:55p
posts6
users3
websitehadoop.apache.org...
irc#hadoop

People

Translate

site design / logo © 2022 Grokbase