Skip to content

Commit

Permalink
solve anjuke#7
Browse files Browse the repository at this point in the history
  • Loading branch information
kdlan committed Apr 16, 2013
1 parent 8a286cc commit ebfdc91
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 9 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ A Simple Recommendation Web Service
$ cd romar
$ mvn

## Compute Item Similarity with HADOOP

$ run bin/runHadoop.sh
默认使用Hadoop local方式执行<br/>
将core-site.xml hdfs-site.xml mapred-site.xml 放在conf/目录下即可提交任务到Hadoop集群执行


## Copyright & License

Licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)
Expand Down
12 changes: 12 additions & 0 deletions bin/runHadoop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cd $(dirname $0)/
cd ..
ROMAR_HOME=`pwd`

java -cp \
$ROMAR_HOME/romar-core-1.1.0-snapshot-jar-with-dependencies.jar:\
$ROMAR_HOME/lib/hadoop-core-0.20.204.0.jar:\
$ROMAR_HOME/conf \
org.apache.hadoop.util.RunJar \
romar-core-1.1.0-snapshot-jar-with-dependencies.jar \
org.apache.mahout.cf.taste.hadoop.similarity.item.ItemSimilarityJob \
$@
15 changes: 7 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,9 @@
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/assembly/all.xml
</descriptor>
<descriptor>src/assembly/jar-with-dependencies.xml</descriptor>
<descriptor>src/assembly/all.xml</descriptor>
</descriptors>
</configuration>
<executions>
Expand Down Expand Up @@ -100,11 +99,11 @@
<downloadJavadocs>false</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.10</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.10</version>
</plugin>
</plugins>
</build>

Expand Down
3 changes: 2 additions & 1 deletion src/assembly/all.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
<excludes>
<exclude>com.anjuke.romar:romar-core</exclude>
</excludes>

</dependencySet>
</dependencySets>

Expand Down Expand Up @@ -55,6 +54,8 @@
<outputDirectory></outputDirectory>
<includes>
<include>${project.build.finalName}.jar</include>
<include>${project.build.finalName}-jar-with-dependencies.jar
</include>
</includes>
</fileSet>
</fileSets>
Expand Down
24 changes: 24 additions & 0 deletions src/assembly/jar-with-dependencies.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<!-- TODO: a jarjar format would be better -->
<id>jar-with-dependencies</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>/</outputDirectory>
<useProjectArtifact>true</useProjectArtifact>
<unpack>true</unpack>
<scope>runtime</scope>
<excludes>
<exclude>com.sun.jersey:*</exclude>
<exclude>org.eclipse.jetty:*</exclude>
<exclude>org.apache.hadoop:hadoop-core</exclude>
</excludes>
</dependencySet>
</dependencySets>
</assembly>

1 comment on commit ebfdc91

@zzz6519003
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看来solve不能关issue

Please sign in to comment.