FrontPage

2010/01/20からのアクセス回数 7789

mavenプロジェクトの作成

mavenを使って、サーブレット用のプロジェクトを作成します。

$ mvn archetype:create -DgroupId=sample.recommendWeb -DartifactId=recommendWeb \
    -DarchetypeArtifactId=maven-archetype-webapp -Dversion=0.0.1

生成されたディレクトリ構成は、以下のようになっています。

+ recommendWeb/
|- pom.xml
|-+ src/
  |-+ main/
    |-+ resources/
    |-+ webapp/
      |-+ WEB-INF/
        |- web.xml
        |- index.jsp

レコメンドアプリケーションと同様にpom.xmlに追加します。

dependeciesに追加

    <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に追加

    <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プログラムのディレクトリを作成します。

$ mkdir src/main/java

以下のコマンドでEclipseのプロジェクトにします。

mvn eclipse:eclipse -DdownloadSources=true

javaファイルの追加

recommendWebプロジェクトをEclipseにインポートします。

コメント

選択肢 投票
おもしろかった 0  
そうでもない 0  
わかりずらい 0  

皆様のご意見、ご希望をお待ちしております。


(Input image string)

トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
SmartDoc