- 追加された行はこの色です。
- 削除された行はこの色です。
[[FrontPage]]
#contents
2010/01/20からのアクセス回数 &counter;
** mavenプロジェクトの作成 [#z100f153]
mavenを使って、サーブレット用のプロジェクトを作成します。
#pre{{
$ mvn archetype:create -DgroupId=sample.recommendWeb -DartifactId=recommendWeb \
-DarchetypeArtifactId=maven-archetype-webapp -Dversion=0.0.1
}}
生成されたディレクトリ構成は、以下のようになっています。
#pre{{
+ recommendWeb/
|- pom.xml
|-+ src/
|-+ main/
|-+ resources/
|-+ webapp/
|-+ WEB-INF/
|- web.xml
|- index.jsp
}}
レコメンドアプリケーションと同様にpom.xmlに追加します。
dependeciesに追加
#pre{{
<dependency>
<groupId>org.apache.mahout</groupId>
<artifactId>mahout-core</artifactId>
<version>0.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jcl</artifactId>
<version>1.5.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
}}
buildに追加
#pre{{
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.7</version>
</plugin>
</plugins>
}}
javaプログラムのディレクトリを作成します。
#pre{{
$ mkdir src/main/java
}}
以下のコマンドでEclipseのプロジェクトにします。
#pre{{
mvn eclipse:eclipse -DdownloadSources=true
}}
** javaファイルの追加 [#udfa9fdc]
recommendWebプロジェクトをEclipseにインポートします。
** コメント [#v119199f]
#vote(おもしろかった,そうでもない,わかりずらい)
皆様のご意見、ご希望をお待ちしております。
#comment_kcaptcha