質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.46%
Java

Javaは、1995年にサン・マイクロシステムズが開発したプログラミング言語です。表記法はC言語に似ていますが、既存のプログラミング言語の短所を踏まえていちから設計されており、最初からオブジェクト指向性を備えてデザインされています。セキュリティ面が強力であることや、ネットワーク環境での利用に向いていることが特徴です。Javaで作られたソフトウェアは基本的にいかなるプラットフォームでも作動します。

Spring Boot

Spring Bootは、Javaのフレームワークの一つ。Springプロジェクトが提供する様々なフレームワークを統合した、アプリケーションを高速で開発するために設計されたフレームワークです。

Q&A

0回答

3299閲覧

VScode Springプロジェクト作成後 pom.xmlエラー

SD.KJ

総合スコア4

Java

Javaは、1995年にサン・マイクロシステムズが開発したプログラミング言語です。表記法はC言語に似ていますが、既存のプログラミング言語の短所を踏まえていちから設計されており、最初からオブジェクト指向性を備えてデザインされています。セキュリティ面が強力であることや、ネットワーク環境での利用に向いていることが特徴です。Javaで作られたソフトウェアは基本的にいかなるプラットフォームでも作動します。

Spring Boot

Spring Bootは、Javaのフレームワークの一つ。Springプロジェクトが提供する様々なフレームワークを統合した、アプリケーションを高速で開発するために設計されたフレームワークです。

0グッド

1クリップ

投稿2021/01/28 00:32

編集2021/02/01 00:31

前提・実現したいこと 

Springbootの学習のために下記URLを参考にVScodeでHelloWorldを表示させたい。

Springboot HelloWorld

発生している問題・エラーメッセージ

VScodeでSpring Mavenプロジェクトを作成後、pom.xml<parent>でエラーが発生しています。

Project build error: Non-resolvable parent POM for com.example:demo:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.4.2 from/to central (https://repo.maven.apache.org/maven2): C:\Users\xxxx.m2\repository\org\springframework\boot\spring-boot-starter-parent\2.4.2\aether-9f8c020e-bb36-436b-b3ed-73730c8f5abc-spring-boot-starter-parent-2.4.2.pom-in-progress (指定されたパスが見つかりません。) and 'parent.relativePath' points at no local POMJava(0)

該当のソースコード

pom

1<?xml version="1.0" encoding="UTF-8"?> 2<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 3 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4 <modelVersion>4.0.0</modelVersion> 5 <parent> 6 <groupId>org.springframework.boot</groupId> 7 <artifactId>spring-boot-starter-parent</artifactId> 8 <version>2.4.2</version> 9 <relativePath/> <!-- lookup parent from repository --> 10 </parent> 11

試したこと

Java開発環境の見直し(Java -versionで確認済み)
PCを変えて、環境の構築~Mavenプロジェクト作成

補足情報

Java:11
Spring:2.4.2
VScode:1.52.1
Java Extension Pack:v0.12.1
Spring Boot Extension Pack:v0.0.8

原因、対処法がわかる方ご教授お願い致します。
追記

setting.xml

1<?xml version="1.0" encoding="UTF-8"?> 2 3<!-- 4Licensed to the Apache Software Foundation (ASF) under one 5or more contributor license agreements. See the NOTICE file 6distributed with this work for additional information 7regarding copyright ownership. The ASF licenses this file 8to you under the Apache License, Version 2.0 (the 9"License"); you may not use this file except in compliance 10with the License. You may obtain a copy of the License at 11 12 http://www.apache.org/licenses/LICENSE-2.0 13 14Unless required by applicable law or agreed to in writing, 15software distributed under the License is distributed on an 16"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17KIND, either express or implied. See the License for the 18specific language governing permissions and limitations 19under the License. 20--> 21 22<!-- 23 | This is the configuration file for Maven. It can be specified at two levels: 24 | 25 | 1. User Level. This settings.xml file provides configuration for a single user, 26 | and is normally provided in ${user.home}/.m2/settings.xml. 27 | 28 | NOTE: This location can be overridden with the CLI option: 29 | 30 | -s /path/to/user/settings.xml 31 | 32 | 2. Global Level. This settings.xml file provides configuration for all Maven 33 | users on a machine (assuming they're all using the same Maven 34 | installation). It's normally provided in 35 | ${maven.conf}/settings.xml. 36 | 37 | NOTE: This location can be overridden with the CLI option: 38 | 39 | -gs /path/to/global/settings.xml 40 | 41 | The sections in this sample file are intended to give you a running start at 42 | getting the most out of your Maven installation. Where appropriate, the default 43 | values (values used when the setting is not specified) are provided. 44 | 45 |--> 46<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" 47 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 48 xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> 49 <!-- localRepository 50 | The path to the local repository maven will use to store artifacts. 51 | 52 | Default: ${user.home}/.m2/repository 53 <localRepository>/path/to/local/repo</localRepository> 54 --> 55 56 <!-- interactiveMode 57 | This will determine whether maven prompts you when it needs input. If set to false, 58 | maven will use a sensible default value, perhaps based on some other setting, for 59 | the parameter in question. 60 | 61 | Default: true 62 <interactiveMode>true</interactiveMode> 63 --> 64 65 <!-- offline 66 | Determines whether maven should attempt to connect to the network when executing a build. 67 | This will have an effect on artifact downloads, artifact deployment, and others. 68 | 69 | Default: false 70 <offline>false</offline> 71 --> 72 73 <!-- pluginGroups 74 | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e. 75 | when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers 76 | "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list. 77 |--> 78 <pluginGroups> 79 <!-- pluginGroup 80 | Specifies a further group identifier to use for plugin lookup. 81 <pluginGroup>com.your.plugins</pluginGroup> 82 --> 83 </pluginGroups> 84 85 <!-- proxies 86 | This is a list of proxies which can be used on this machine to connect to the network. 87 | Unless otherwise specified (by system property or command-line switch), the first proxy 88 | specification in this list marked as active will be used. 89 |--> 90 <proxies> 91 92 【省略・・・】 93 94

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

kiino

2021/01/31 14:04

maven の settings.xml ってどうなっていますでしょうか? 追記してもらうことってできますでしょうか。
SD.KJ

2021/02/01 00:32

追記致しました。 投稿文字数制限の関係で下部を省略しております。 宜しくお願い致します。
kiino

2021/02/01 14:00

文字数制限があるんですね、失礼しました。 正常であれば、<ホームディレクトリ>/.m2/repository/... 配下に必要な pom.xml がはいるはずで、 spring-boot-starter-parent も入っていれば参照できるはずなのですが、 それが入っていないので参照できないのかなと思いました。 maven の setting.xml や接続環境が正しくないとエラーになりがちなのですが、 settings.xml の <proxies> や <mirrors> の設定を抽出してもらうことって可能でしょうか。 また、以下のコマンドをターミナルから実行した場合、どのような出力がされるでしょうか。 (VSCode上のものでも大丈夫です) ``` mvn dependency:copy-dependencies ```
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.46%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問