Maven設定

1.EclipseのHelpメニューからInstall New Software…を選択。
2.Addボタンを押す。

3.Locationに下記のアドレスを入力(Nameは適当でよい)、OKボタンを押す。
http://download.eclipse.org/technology/m2e/releases

4.すべて選択して、Next。
5.確認し、Next。
6.規約を合意するのチェックを入れて、Finish。

7.Eclipseを再起動。
8.EclipseのWindowメニューからPreferencesを選択。
9.Maven>InstallationsからAddを選択。
10.解凍したmavenフォルダーを選択し、OK。
11.OKボタンをクリック。

12.User setting.xmlを作成。
C:\Users\ユーザー名\.m2フォルダーを作成し、settings.xmlファイルを作成。
内容は、下記のよい。
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0                       http://maven.apache.org/xsd/settings-1.0.0.xsd">   
    <localRepository/>   
    <interactiveMode/>   
    <usePluginRegistry/>   
    <offline/>   
    <pluginGroups/>   
    <servers/>   
    <mirrors/>   
    <proxies/>   
    <profiles/>   
    <activeProfiles/> 
</settings>

13.settings.xmlを設定。
WindowメニューからPreferencesを選択し、Maven>User Settingsを選択、先ほど作成したsettings.xmlを選択し、OKボタンを押す。

14.クラスパスにmaven libraryを追加。
(これは、

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved問題を解決)

)
プロジェクトを右クリックし、Build Path>Configure Build Pathを選択。
Order and Exportタブで、Maven Dependenciesのチェックを入れる。


Comments