You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mahout.apache.org by huangjia <cu...@gmail.com> on 2012/07/09 17:48:36 UTC

Import Mahout's source code to eclipse

Hi all,

I'm reading Mahout in Action and new to Mahout. Before I can run the code
in 2.2.2 Creating a recommender, I think I need to import Mahout into
Eclipse first.

However,  encountered a problem when trying to import *Mahout*'s source
code to eclipse. My steps are as follows.

1 Start Eclipse, click Help->Install new software: enter "m2e -
http://download.eclipse.org/technology/m2e/releases"
2 downloaded the Mahout source zip file, unzip it, and put it under the
workspace of Eclipse.
3 Start Eclipse, click File->Import->Maven->Existing Maven Projects. Then
chose the Mahout source file as the Root Directory.

However, when I first tried it, it popped out some errors as in this post
http://stackoverflow.com/questions/11282737/errors-when-importing-mahouts-maven-resource-to-eclipse
.
[image: enter image description here]

But when I tried it today, the "Next" button becomes gray, so I cannot
proceed.
[image: Inline image 1]
Does anyone have an idea of what's going on?

Info: I'm using Eclipse Helios, and mahout distribution 0.7. Is it because
the Helios does not support Mahout?
But it shouldn't, I think, since this person did it successfully.
http://shuyo.wordpress.com/2011/02/01/mahout-development-environment-with-maven-and-eclipse-1/
Or, instead of installing Maven in Eclipse, I should download it
separately?

Thanks very much!

Jia

Re: Import Mahout's source code to eclipse

Posted by Manuel Blechschmidt <Ma...@gmx.de>.
Hi everybody,
the following git hub project contains a pre configured eclipse project including m2eclipse configuration:

https://github.com/ManuelB/facebook-recommender-demo/blob/master/docs/EclipseWorkspace.png

Including some well documented Mahout examples.

Just clone it and then click on import existing project and point your eclipse to the root of the repository.

It uses Mahout 0.6 bumping to 0.7 should be easy by just changing the version in the pom.

https://github.com/ManuelB/facebook-recommender-demo/blob/master/pom.xml

If somebody is interested in checking if the examples are still working on 0.7 feel free to send me a patch afterwards.

/Manuel

On 10.07.2012, at 11:33, Alex Ott wrote:

> Hi
> 
> To run code from Mahout in Action, you don't need to import source code
> into Eclipse - either download code from book's site, or clone it from
> https://github.com/tdunning/MiA (the master branch contains code from book,
> while there are separate branches for use with Mahout 0.6 & 0.7). After
> getting source code, just import existing maven project, and everything
> should work.
> 
> On Mon, Jul 9, 2012 at 5:48 PM, huangjia <cu...@gmail.com> wrote:
> 
>> Hi all,
>> 
>> I'm reading Mahout in Action and new to Mahout. Before I can run the code
>> in 2.2.2 Creating a recommender, I think I need to import Mahout into
>> Eclipse first.
>> 
>> However,  encountered a problem when trying to import *Mahout*'s source
>> code to eclipse. My steps are as follows.
>> 
>> 1 Start Eclipse, click Help->Install new software: enter "m2e -
>> http://download.eclipse.org/technology/m2e/releases"
>> 2 downloaded the Mahout source zip file, unzip it, and put it under the
>> workspace of Eclipse.
>> 3 Start Eclipse, click File->Import->Maven->Existing Maven Projects. Then
>> chose the Mahout source file as the Root Directory.
>> 
>> However, when I first tried it, it popped out some errors as in this post
>> http://stackoverflow.com/questions/11282737/errors-when-importing-mahouts-maven-resource-to-eclipse
>> .
>> [image: enter image description here]
>> 
>> But when I tried it today, the "Next" button becomes gray, so I cannot
>> proceed.
>> [image: Inline image 1]
>> Does anyone have an idea of what's going on?
>> 
>> Info: I'm using Eclipse Helios, and mahout distribution 0.7. Is it because
>> the Helios does not support Mahout?
>> But it shouldn't, I think, since this person did it successfully.
>> http://shuyo.wordpress.com/2011/02/01/mahout-development-environment-with-maven-and-eclipse-1/
>> Or, instead of installing Maven in Eclipse, I should download it
>> separately?
>> 
>> Thanks very much!
>> 
>> Jia
>> 
>> 
> 
> 
> -- 
> With best wishes,                    Alex Ott
> http://alexott.net/
> Tiwtter: alexott_en (English), alexott (Russian)
> Skype: alex.ott

-- 
Manuel Blechschmidt
M.Sc. IT Systems Engineering
Dortustr. 57
14467 Potsdam
Mobil: 0173/6322621
Twitter: http://twitter.com/Manuel_B


Re: Import Mahout's source code to eclipse

Posted by Alex Ott <al...@gmail.com>.
Hi

To run code from Mahout in Action, you don't need to import source code
into Eclipse - either download code from book's site, or clone it from
https://github.com/tdunning/MiA (the master branch contains code from book,
while there are separate branches for use with Mahout 0.6 & 0.7). After
getting source code, just import existing maven project, and everything
should work.

On Mon, Jul 9, 2012 at 5:48 PM, huangjia <cu...@gmail.com> wrote:

> Hi all,
>
> I'm reading Mahout in Action and new to Mahout. Before I can run the code
> in 2.2.2 Creating a recommender, I think I need to import Mahout into
> Eclipse first.
>
> However,  encountered a problem when trying to import *Mahout*'s source
> code to eclipse. My steps are as follows.
>
> 1 Start Eclipse, click Help->Install new software: enter "m2e -
> http://download.eclipse.org/technology/m2e/releases"
> 2 downloaded the Mahout source zip file, unzip it, and put it under the
> workspace of Eclipse.
> 3 Start Eclipse, click File->Import->Maven->Existing Maven Projects. Then
> chose the Mahout source file as the Root Directory.
>
> However, when I first tried it, it popped out some errors as in this post
> http://stackoverflow.com/questions/11282737/errors-when-importing-mahouts-maven-resource-to-eclipse
> .
> [image: enter image description here]
>
> But when I tried it today, the "Next" button becomes gray, so I cannot
> proceed.
> [image: Inline image 1]
> Does anyone have an idea of what's going on?
>
> Info: I'm using Eclipse Helios, and mahout distribution 0.7. Is it because
> the Helios does not support Mahout?
> But it shouldn't, I think, since this person did it successfully.
> http://shuyo.wordpress.com/2011/02/01/mahout-development-environment-with-maven-and-eclipse-1/
> Or, instead of installing Maven in Eclipse, I should download it
> separately?
>
> Thanks very much!
>
> Jia
>
>


-- 
With best wishes,                    Alex Ott
http://alexott.net/
Tiwtter: alexott_en (English), alexott (Russian)
Skype: alex.ott

Re: Import Mahout's source code to eclipse

Posted by Stevo Slavić <ss...@gmail.com>.
See https://issues.apache.org/jira/browse/MAHOUT-1043 for more info and
feel free to vote up if you're interested in having Apache Mahout sources
importable and buildable in modern eclipse/maven environment.

Kind regards,
Stevo Slavic.

On Mon, Jul 9, 2012 at 6:59 PM, huangjia <cu...@gmail.com> wrote:

> Hi Stevo,
>
> Sorry, but I couldn't quite understand your answer. Do you suggest that I
> change the pom.xml? Is there a permanent solution to my problem?
>
>
> Hi Chenghao,
>
> Where shall I execute the mvn eclipse:eclipse command? In Cygwin?
>
>
> Thank you both !
>
> Jia
>
> On Mon, Jul 9, 2012 at 12:13 PM, Stevo Slavić <ss...@gmail.com> wrote:
>
> > Do not combine maven-eclipse-plugin (eclipse:eclipse) and m2e plugin for
> > eclipse.
> >
> > To explain what's happening when you import with m2e:
> > For maven plugins configured in build scripts to execute on specific
> build
> > lifecycle phases m2e needs metadata/info on what to do with them -
> execute,
> > ignore, ... when file changes in an eclipse project.
> > m2e can consume these metadata from build scripts themselves, from m2e
> > connectors (m2e plugins), or (as of m2e 1.1) from maven plugins. For more
> > info on this, read
> > http://wiki.eclipse.org/M2E_plugin_execution_not_covered
> >
> > For the two maven plugins used in Mahout build scripts there are no such
> > sources of build lifecycle mapping metadata or logic.
> >
> > maven-antrun-plugin is used basically to copy a resource on compile phase
> > (see details in pom:
> > https://svn.apache.org/repos/asf/mahout/trunk/core/pom.xml )
> > I don't understand yet why isn't this resource named and placed under
> > src/main/resources so that maven-antrun-plugin can be removed.
> >
> > As temporary workaround, you can configure lifecycle metadata in mahout
> > parent pom just to ignore maven-antrun-plugin run goal executions.
> >
> > Another pom, https://svn.apache.org/repos/asf/mahout/trunk/math/pom.xml,
> > makes use of mahout-collections-codegen-plugin to generate sources.
> > This plugin should include lifecycle mapping metadata, but it does not.
> SO
> > as another temporary workaround you can configure lifecycle metadata in
> > mahout parent pom to execute mahout-collection-codegen-plugin generate
> goal
> >
> >
> > Kind regards,
> > Stevo Slavic.
> >
> > On Mon, Jul 9, 2012 at 6:03 PM, chenghao liu <tw...@gmail.com> wrote:
> >
> > > try mvn eclipse:eclipse
> > >
> > > 2012/7/9 huangjia <cu...@gmail.com>
> > >
> > > > Hi all,
> > > >
> > > > I'm reading Mahout in Action and new to Mahout. Before I can run the
> > code
> > > > in 2.2.2 Creating a recommender, I think I need to import Mahout into
> > > > Eclipse first.
> > > >
> > > > However,  encountered a problem when trying to import *Mahout*'s
> source
> > > > code to eclipse. My steps are as follows.
> > > >
> > > > 1 Start Eclipse, click Help->Install new software: enter "m2e -
> > > > http://download.eclipse.org/technology/m2e/releases"
> > > > 2 downloaded the Mahout source zip file, unzip it, and put it under
> the
> > > > workspace of Eclipse.
> > > > 3 Start Eclipse, click File->Import->Maven->Existing Maven Projects.
> > Then
> > > > chose the Mahout source file as the Root Directory.
> > > >
> > > > However, when I first tried it, it popped out some errors as in this
> > post
> > > >
> > >
> >
> http://stackoverflow.com/questions/11282737/errors-when-importing-mahouts-maven-resource-to-eclipse
> > > > .
> > > > [image: enter image description here]
> > > >
> > > > But when I tried it today, the "Next" button becomes gray, so I
> cannot
> > > > proceed.
> > > > [image: Inline image 1]
> > > > Does anyone have an idea of what's going on?
> > > >
> > > > Info: I'm using Eclipse Helios, and mahout distribution 0.7. Is it
> > > because
> > > > the Helios does not support Mahout?
> > > > But it shouldn't, I think, since this person did it successfully.
> > > >
> > >
> >
> http://shuyo.wordpress.com/2011/02/01/mahout-development-environment-with-maven-and-eclipse-1/
> > > > Or, instead of installing Maven in Eclipse, I should download it
> > > > separately?
> > > >
> > > > Thanks very much!
> > > >
> > > > Jia
> > > >
> > > >
> > >
> >
> > --
> > Jia Huang
> > PhD student
> > College of Information Science & Technology
> > Drexel University
> >
> >
>

Re: Import Mahout's source code to eclipse

Posted by huangjia <cu...@gmail.com>.
Hi Stevo,

Sorry, but I couldn't quite understand your answer. Do you suggest that I
change the pom.xml? Is there a permanent solution to my problem?


Hi Chenghao,

Where shall I execute the mvn eclipse:eclipse command? In Cygwin?


Thank you both !

Jia

On Mon, Jul 9, 2012 at 12:13 PM, Stevo Slavić <ss...@gmail.com> wrote:

> Do not combine maven-eclipse-plugin (eclipse:eclipse) and m2e plugin for
> eclipse.
>
> To explain what's happening when you import with m2e:
> For maven plugins configured in build scripts to execute on specific build
> lifecycle phases m2e needs metadata/info on what to do with them - execute,
> ignore, ... when file changes in an eclipse project.
> m2e can consume these metadata from build scripts themselves, from m2e
> connectors (m2e plugins), or (as of m2e 1.1) from maven plugins. For more
> info on this, read
> http://wiki.eclipse.org/M2E_plugin_execution_not_covered
>
> For the two maven plugins used in Mahout build scripts there are no such
> sources of build lifecycle mapping metadata or logic.
>
> maven-antrun-plugin is used basically to copy a resource on compile phase
> (see details in pom:
> https://svn.apache.org/repos/asf/mahout/trunk/core/pom.xml )
> I don't understand yet why isn't this resource named and placed under
> src/main/resources so that maven-antrun-plugin can be removed.
>
> As temporary workaround, you can configure lifecycle metadata in mahout
> parent pom just to ignore maven-antrun-plugin run goal executions.
>
> Another pom, https://svn.apache.org/repos/asf/mahout/trunk/math/pom.xml ,
> makes use of mahout-collections-codegen-plugin to generate sources.
> This plugin should include lifecycle mapping metadata, but it does not. SO
> as another temporary workaround you can configure lifecycle metadata in
> mahout parent pom to execute mahout-collection-codegen-plugin generate goal
>
>
> Kind regards,
> Stevo Slavic.
>
> On Mon, Jul 9, 2012 at 6:03 PM, chenghao liu <tw...@gmail.com> wrote:
>
> > try mvn eclipse:eclipse
> >
> > 2012/7/9 huangjia <cu...@gmail.com>
> >
> > > Hi all,
> > >
> > > I'm reading Mahout in Action and new to Mahout. Before I can run the
> code
> > > in 2.2.2 Creating a recommender, I think I need to import Mahout into
> > > Eclipse first.
> > >
> > > However,  encountered a problem when trying to import *Mahout*'s source
> > > code to eclipse. My steps are as follows.
> > >
> > > 1 Start Eclipse, click Help->Install new software: enter "m2e -
> > > http://download.eclipse.org/technology/m2e/releases"
> > > 2 downloaded the Mahout source zip file, unzip it, and put it under the
> > > workspace of Eclipse.
> > > 3 Start Eclipse, click File->Import->Maven->Existing Maven Projects.
> Then
> > > chose the Mahout source file as the Root Directory.
> > >
> > > However, when I first tried it, it popped out some errors as in this
> post
> > >
> >
> http://stackoverflow.com/questions/11282737/errors-when-importing-mahouts-maven-resource-to-eclipse
> > > .
> > > [image: enter image description here]
> > >
> > > But when I tried it today, the "Next" button becomes gray, so I cannot
> > > proceed.
> > > [image: Inline image 1]
> > > Does anyone have an idea of what's going on?
> > >
> > > Info: I'm using Eclipse Helios, and mahout distribution 0.7. Is it
> > because
> > > the Helios does not support Mahout?
> > > But it shouldn't, I think, since this person did it successfully.
> > >
> >
> http://shuyo.wordpress.com/2011/02/01/mahout-development-environment-with-maven-and-eclipse-1/
> > > Or, instead of installing Maven in Eclipse, I should download it
> > > separately?
> > >
> > > Thanks very much!
> > >
> > > Jia
> > >
> > >
> >
>
> --
> Jia Huang
> PhD student
> College of Information Science & Technology
> Drexel University
>
>

Re: Import Mahout's source code to eclipse

Posted by Stevo Slavić <ss...@gmail.com>.
Do not combine maven-eclipse-plugin (eclipse:eclipse) and m2e plugin for
eclipse.

To explain what's happening when you import with m2e:
For maven plugins configured in build scripts to execute on specific build
lifecycle phases m2e needs metadata/info on what to do with them - execute,
ignore, ... when file changes in an eclipse project.
m2e can consume these metadata from build scripts themselves, from m2e
connectors (m2e plugins), or (as of m2e 1.1) from maven plugins. For more
info on this, read http://wiki.eclipse.org/M2E_plugin_execution_not_covered

For the two maven plugins used in Mahout build scripts there are no such
sources of build lifecycle mapping metadata or logic.

maven-antrun-plugin is used basically to copy a resource on compile phase
(see details in pom:
https://svn.apache.org/repos/asf/mahout/trunk/core/pom.xml )
I don't understand yet why isn't this resource named and placed under
src/main/resources so that maven-antrun-plugin can be removed.

As temporary workaround, you can configure lifecycle metadata in mahout
parent pom just to ignore maven-antrun-plugin run goal executions.

Another pom, https://svn.apache.org/repos/asf/mahout/trunk/math/pom.xml ,
makes use of mahout-collections-codegen-plugin to generate sources.
This plugin should include lifecycle mapping metadata, but it does not. SO
as another temporary workaround you can configure lifecycle metadata in
mahout parent pom to execute mahout-collection-codegen-plugin generate goal


Kind regards,
Stevo Slavic.

On Mon, Jul 9, 2012 at 6:03 PM, chenghao liu <tw...@gmail.com> wrote:

> try mvn eclipse:eclipse
>
> 2012/7/9 huangjia <cu...@gmail.com>
>
> > Hi all,
> >
> > I'm reading Mahout in Action and new to Mahout. Before I can run the code
> > in 2.2.2 Creating a recommender, I think I need to import Mahout into
> > Eclipse first.
> >
> > However,  encountered a problem when trying to import *Mahout*'s source
> > code to eclipse. My steps are as follows.
> >
> > 1 Start Eclipse, click Help->Install new software: enter "m2e -
> > http://download.eclipse.org/technology/m2e/releases"
> > 2 downloaded the Mahout source zip file, unzip it, and put it under the
> > workspace of Eclipse.
> > 3 Start Eclipse, click File->Import->Maven->Existing Maven Projects. Then
> > chose the Mahout source file as the Root Directory.
> >
> > However, when I first tried it, it popped out some errors as in this post
> >
> http://stackoverflow.com/questions/11282737/errors-when-importing-mahouts-maven-resource-to-eclipse
> > .
> > [image: enter image description here]
> >
> > But when I tried it today, the "Next" button becomes gray, so I cannot
> > proceed.
> > [image: Inline image 1]
> > Does anyone have an idea of what's going on?
> >
> > Info: I'm using Eclipse Helios, and mahout distribution 0.7. Is it
> because
> > the Helios does not support Mahout?
> > But it shouldn't, I think, since this person did it successfully.
> >
> http://shuyo.wordpress.com/2011/02/01/mahout-development-environment-with-maven-and-eclipse-1/
> > Or, instead of installing Maven in Eclipse, I should download it
> > separately?
> >
> > Thanks very much!
> >
> > Jia
> >
> >
>

Re: Import Mahout's source code to eclipse

Posted by chenghao liu <tw...@gmail.com>.
try mvn eclipse:eclipse

2012/7/9 huangjia <cu...@gmail.com>

> Hi all,
>
> I'm reading Mahout in Action and new to Mahout. Before I can run the code
> in 2.2.2 Creating a recommender, I think I need to import Mahout into
> Eclipse first.
>
> However,  encountered a problem when trying to import *Mahout*'s source
> code to eclipse. My steps are as follows.
>
> 1 Start Eclipse, click Help->Install new software: enter "m2e -
> http://download.eclipse.org/technology/m2e/releases"
> 2 downloaded the Mahout source zip file, unzip it, and put it under the
> workspace of Eclipse.
> 3 Start Eclipse, click File->Import->Maven->Existing Maven Projects. Then
> chose the Mahout source file as the Root Directory.
>
> However, when I first tried it, it popped out some errors as in this post
> http://stackoverflow.com/questions/11282737/errors-when-importing-mahouts-maven-resource-to-eclipse
> .
> [image: enter image description here]
>
> But when I tried it today, the "Next" button becomes gray, so I cannot
> proceed.
> [image: Inline image 1]
> Does anyone have an idea of what's going on?
>
> Info: I'm using Eclipse Helios, and mahout distribution 0.7. Is it because
> the Helios does not support Mahout?
> But it shouldn't, I think, since this person did it successfully.
> http://shuyo.wordpress.com/2011/02/01/mahout-development-environment-with-maven-and-eclipse-1/
> Or, instead of installing Maven in Eclipse, I should download it
> separately?
>
> Thanks very much!
>
> Jia
>
>