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

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

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

Spring Framework は、Javaプラットフォーム向けのオープンソースアプリケーションフレームワークです。 Java Platform上に、 Web ベースのアプリケーションを設計するための拡張機能が数多く用意されています。

Q&A

解決済

1回答

26651閲覧

pomのエラー理由がわからない

kazuhihi

総合スコア20

Spring

Spring Framework は、Javaプラットフォーム向けのオープンソースアプリケーションフレームワークです。 Java Platform上に、 Web ベースのアプリケーションを設計するための拡張機能が数多く用意されています。

0グッド

0クリップ

投稿2017/01/07 07:56

###前提・実現したいこと
初質問です。
フレームワークspringにてMaven projectを新規に作成しpomを設定しているのですがpom設定画面にて以下のエラーメッセージが発生しました。
ご教授いただけませんでしょうか。

何卒よろしくお願いいたします。

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

エラーメッセージ
Description Resource Path Location Type
Error resolving version for plugin 'org.apache.maven.plugins:maven-compile-plugin' from the repositories [local (/Users/ユーザー名/.m2/repository), central (https://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository pom.xml /bulletinboard line 1 Maven pom Loading Problem

###該当のソースコード
ここで上記エラーが発生<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>first</groupId>
<artifactId>bulletinboard
</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>bulletinboard"pom.xml"
Maven Webapp</name>
<url>http://maven.apache.org</url>

<dependencyManagement> <dependencies> <dependency> <groupId>io.spring.platform</groupId> <artifactId>platform-bom</artifactId> <version>2.0.5.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>
<dependencies> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.taglibs</groupId> <artifactId>taglibs-standard-jstlel</artifactId> </dependency> </dependencies>
<build> <finalName>bulletinboard</finalName> <pluginManagement> <plugins> <plugin> <artifactId>maven-compile-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </pluginManagement> </build> </project>

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

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

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

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

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

guest

回答1

0

ベストアンサー

※servlet-apiが重複して指定されているため、別のエラーが出ます。

本題ですが、maven-compiler-pluginのバージョンを指定しましょう。

xml

1<plugin> 2 <artifactId>maven-compile-plugin</artifactId> 3 <version>3.3</version> 4 <configuration> 5 <source>1.8</source> 6 <target>1.8</target> 7 </configuration> 8</plugin>

投稿2017/01/07 08:24

A-pZ

総合スコア12011

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

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

kazuhihi

2017/01/07 08:30

ありがとうございます! 解決しました! バージョンの指定は必須なのでしょうか?
A-pZ

2017/01/07 15:35

mavenでは必ずバージョンを指定します。 プロジェクトにて指定したアーティファクト(=mavenを使って入手するjarファイルたち)に対してバージョンを指定しないのは、参照している親プロジェクト(またはひな形プロジェクト)にて管理しているバージョンがあらかじめ指定されており、spring.platformはひな形にあたります。spring.platformの2.0.5にて、それぞれのバージョンが指定してあるため、省略できるのです。
kazuhihi

2017/01/17 11:47

ありがとうございます!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問