Premise: Machine networking
(1) Use SVN download mahout latest source code, check out http://svn.apache.org/repos/asf/mahout/trunk
Note: release source code under the http://archive.apache.org/dist/mahout/
(2) download Maven, download the binary version of The maven-3.0.3 here, download in the http://archive.apache.org/dist/maven/binaries/, after the download is complete, unzip the apache-maven-3.0.3-bin.tar.gz
(3) install JDK and configure the environment variable java_home, which is required by Maven.
(4) test MVN
[Root @ glnode04 mahout-SVN] #/local/apache-maven-3.0.3/bin/MVN
MVN mvndebug mvnyjp
(5) Compile mahout
View mahout source code
[Zhankunlin @ icthtc ~] $ Ls mahout-SVN
Bin core eclipse install. Log math Pom. xml SRC utils
Buildtools distribution examples license.txt notice.txt readme.txt taste-Web
Go to the source code directory and run the following command for compilation and installation.
[Root @ glnode04 mahout-SVN] #/local/apache-maven-3.0.3/bin/MVN install
Maven uses the default configuration file pom. XML: Compile and package all source code in the core, examples, Eclipse, taste-web, utils, and other directories. During the compilation process, the related dependency packages are automatically downloaded from the Internet, therefore, you must ensure that the machine can be connected to the Internet. Otherwise, the following error occurs during compilation.
[Error] plugin Org. apache. maven. plugins: Maven-install-plugin: 2.3.1 or one of its Dependencies cocould not be resolved: failed to read artifact descriptor for Org. apache. maven. plugins: Maven-install-plugin: jar: 2.3.1: cocould not transfer artifact Org. apache. maven. plugins: Maven-install-plugin: pom: 2.3.1 from/to central (http://repo1.maven.org/maven2): Error transferring file: repo1.maven.org: Unknown host repo1.maven.org-> [help 1]
[Error]
[Error] to see the full stack trace of the errors, re-run Maven with the-e switch.
[Error] re-run Maven using the-x switch to enable full debug logging.
[Error]
[Error] For more information about the errors and possible solutions, please read the following articles:
[Error] [help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
After compilation, view related directories, such as core, examples, Eclipse, taste-web, and utils, and generate related packages and files, including the target directory.
[Zhankunlin @ icthtc ~] $ Ls mahout-SVN/CORE/
Build input output Pom. xml SRC target testdata
[Zhankunlin @ icthtc ~] $ Ls mahout-SVN/CORE/target/
Antrun/mahout-core-0.5-SNAPSHOT.jar Maven-archiver/
Archive-TMP/mahout-core-0.5-SNAPSHOT-job.jar surefire-Reports/
Classes/mahout-core-0.5-SNAPSHOT-sources.jar test-classes/
Generated-source/mahout-core-0.5-SNAPSHOT-tests.jar
[Zhankunlin @ icthtc ~] $ Ls mahout-SVN/CORE/target/
Antrun classes mahout-core-0.5-SNAPSHOT.jar Maven-archiver test-classes
Archive-TMP generated-sources mahout-core-0.5-SNAPSHOT-job.jar mahout-core-0.5-SNAPSHOT-tests.jar surefire-Reports
[Zhankunlin @ icthtc ~] $ Ls mahout-SVN/examples/target/
Antrun classes generated-sources mahout-examples-0.5-SNAPSHOT.jar mahout-examples-0.5-SNAPSHOT-sources.jar surefire-Reports
Archive-TMP dependency grouplens. Jar mahout-examples-0.5-SNAPSHOT-job.jar Maven-archiver test-classes
[Zhankunlin @ icthtc ~] $
The directory before compilation is as follows:
[Zhankunlin @ icthtc mahout-svn-single-compile] $ ls Core
Pom. xml SRC
[Zhankunlin @ icthtc mahout-svn-single-compile] $ ls examples/
Bin build. xml Pom. xml SRC
Bytes -----------------------------------------------------------------------------------
Appendix:
Independently compile core, examples, or other projects
Go to the core and examples directories respectively,
Run the command/local/apache-maven-3.0.3/bin/MVN compile,/local/apache-maven-3.0.3/bin/MVN install,
Maven will read the configuration file Pom. XML in the current directory for compilation,
(The install process should include the compile process)