トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS

Java:Maven:Eclipseでmavenプロジェクトが使えるようになるまで

Last-modified: 2013-12-05 (木) 18:54:53 (3793d)
Top / Java:Maven:Eclipseでmavenプロジェクトが使えるようになるまで

Java:Maven:Eclipseでmavenプロジェクトが使えるようになるまで

この記事はPleiadesの4.3 Keplerをダウンロードしてきてから発生したエラーとその対象をまとめたものです。

最初にやったこと

ダウンロード直後には、mavenの設定ファイルが存在しないため、空の設定ファイルを作成しました。

やり方は

  1. 【メニュー】→【ウィンドウ】→【設定】
  2. 【Maven】→【ユーザ設定】
  3. ユーザ設定ファイルがありません的なメッセージが出力されているため、表示されているパスにsertting.xmlを作成し、指定。

setting.xmlのひな形は以下のURLよりゲット。

ちなみに、コピペするとこれです。

<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>

まあ、設定が必要な項目を設定します。

※小生はプロキシの設定を入れてます。

「Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved」が発生

まず、Pleiadesを起動して、mavenプロジェクトを作成しようとしたら、以下のようなエラーが発生しました。

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

意味不明でしたが、mavenのキャッシュファイルをすべて削除し、再度実行することで問題が解消しました。

  • 削除ディレクトリ:[ホームディレクトリ]\.m2\repository\*

JavaDoc?とソースコードを自動でダウンロードするようにする。

pomに以下の内容を追記することでできます。

<build>
 <plugins>
  <plugin>
   <artifactId>maven-eclipse-plugin</artifactId>
   <configuration>
    <downloadSources>true</downloadSources>
    <downloadJavadocs>true</downloadJavadocs>
   </configuration>
  </plugin>
 </plugins>
</build>

参考サイト

キャッシュクリアについてのstackoverflow

JavaDoc?とかをダウンロード