前提・実現したいこと
Java(Spring Boot)の勉強のために環境構築をしていますが新規Mavenプロジェクトの作成をすると「ビルド・プランを計算できません」とエラーが出てしまいます。
ファイル>新規>Mavenプロジェクト>
「デフォルト・ワークスペース・ロケーションの使用」にのみチェックを入れて「次へ」
org.apache.maven.archetypes maven-archetype-webapp 1.0
を選択し「次へ」
グループid[example]
アーティファクトid[sample1111]
バージョン「0.0.1-SNAPSHOT(初期値)」
パッケージ「example.sample1111」
で[完了]を押したところ下記のエラーが発生しました。
発生している問題・エラーメッセージ
「Failed to create project "sample1111"」 ビルド・プランを計算できませんでした: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
「複数の問題が発生しました」 ビルド・プランを計算できませんでした: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6 >>maven-archetype-webapp を作成中 >>ワークスペースをビルド中
【『maven-archetype-webapp を作成中』の詳細】 ビルド・プランを計算できませんでした: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6 Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
【『ワークスペースをビルド中』の詳細】 ビルド中にエラーが発生しました。 プロジェクト 'sample1111' でビルダー 'Maven プロジェクト・ビルダー' の実行中にエラーが発生しました。 ビルド・プランを計算できませんでした: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6 Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6 ビルド・プランを計算できませんでした: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6 Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
試したこと
まずエラーが起こる前にやったこと
ググり「【超初心者向け】Maven超入門」という記事を見つけて
settings.xmlの書き換えを行う
・ローカルリポジトリの設定
<localRepository>C:/maven/repository\</localRepository>
を追加
・プロキシの設定
<proxies> <proxy> <id>proxy01</id> <active>true</active> <protocol>http</protocol> <username>proxyuser</username> <password>proxypass</password> <host>proxy.host.net</host> <port>8080</port> <nonProxyHosts>local.net|some.host.com</nonProxyHosts> </proxy> </proxies>
を追加
上記手順でMavenプロジェクトを作成>>エラー発生!
以下エラー後にやったこと
同記事内にあった
「Mavenプラグインの設定」を行う
設定>Maven>ユーザー設定
テキストフィールドに編集したsettings.xmlのパスを入れる
/usr/local/Cellar/maven/3.6.0/libexec/conf/settings.xml
別記事で「.m2下にsettings.xmlを作成する」という情報を見たので作成し同様にMavenプラグインの設定」を行う
settings.xmlには
上記の・プロキシの設定
<proxies> <proxy> <id>proxy01</id> <active>true</active> <protocol>http</protocol> <username>proxyuser</username> <password>proxypass</password> <host>proxy.host.net</host> <port>8080</port> <nonProxyHosts>local.net|some.host.com</nonProxyHosts> </proxy> </proxies>
を記述
パスは/Users/ユーザー/.m2/settings.xml
この時のローカルリポジトリは
/Users/ユーザー/.m2/repository
になってます。
補足情報(FW/ツールのバージョンなど)
使用パソコンはMacBook Proです。
Pleiades All in One のultimateをダウンロードして使っています。
今回が初めての使用です。
STSはインストール済みです。
以下ターミナルで確認しました
$ java -version java version "11.0.2" 2019-01-15 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)
$ mvn -version Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-25T03:41:47+09:00) Maven home: /usr/local/Cellar/maven/3.6.0/libexec Java version: 11.0.2, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home Default locale: ja_JP, platform encoding: UTF-8 OS name: "mac os x", version: "10.14.2", arch: "x86_64", family: "mac"
$ /usr/libexec/java_home -V Matching Java Virtual Machines (2): 11.0.2, x86_64: "Java SE 11.0.2" /Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home 11.0.2, x86_64: "OpenJDK 11.0.2" /Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home
ネットで参考記事を探したのですがwindowsのものが多くてそれの読み替えがうまくできていないのかうまく行きません。今まではRubyを中心に勉強していて、javaは勝手が違い混乱しているのかもしれません。
ご存知の方アドバイスお願いします。




回答1件
あなたの回答
tips
プレビュー