2017-04-27 3 views
0

私はスプリングブートを使用してWebアプリケーションを作成し、jsを反応させたいとします(チュートリアルhere)。 pom.xmlで は私が追加:org.apache.maven.pluginsのアーティファクト記述子の読み込みに失敗しました:maven-resources-plugin:jar:3.0.5

<plugin> 
    <artifactId>maven-resources-plugin</artifactId> 
    <version>3.0.5</version> 
    <executions> 
     <execution> 
      <id>Copy frontend production build to resources</id> 
      <phase>package</phase> 
      <goals> 
       <goal>copy-resources</goal> 
      </goals> 
      <configuration> 
       <outputDirectory>${basedir}/target/classes</outputDirectory> 
       <resources> 
        <resource> 
         <directory>src/main/app/build/</directory> 
         <filtering>true</filtering> 
        </resource> 
       </resources> 
      </configuration> 
     </execution> 
    </executions> 
</plugin> 

をMVNきれいなパッケージを実行すると、私は次のエラーを取得します。 Mavenのバージョンは3.0.5です。

Plugin org.apache.maven.plugins:maven-resources-plugin:3.0.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:3.0.5: Failure to find org.apache.maven.plugins:maven-resources-plugin:pom:3.0.5 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced

EDIT: 私は3.0.2へのmaven-リソース・プラグインタグ、Mavenのバージョンで変更されましたが、今私は上のエラーを取得:

<plugin> 
    <groupId>com.github.eirslett</groupId> 
    <artifactId>frontend-maven-plugin</artifactId> 
    <version>1.2</version> 
    <executions> 
     <execution> 
      <id>Install Node and Yarn</id> 
      <goals> 
       <goal>install-node-and-yarn</goal> 
      </goals> 
     </execution> 

     <execution> 
      <id>yarn install</id> 
      <goals> 
       <goal>yarn</goal> 
      </goals> 
      <configuration> 
       <arguments>install</arguments> 
      </configuration> 
     </execution> 

     <execution> 
      <id>Frontend production build</id> 
      <phase>package</phase> 
      <goals> 
       <goal>yarn</goal> 
      </goals> 
      <configuration> 
       <arguments>run build</arguments> 
      </configuration> 
     </execution> 
    </executions> 
    <configuration> 
     <nodeVersion>v7.2.0</nodeVersion> 
     <yarnVersion>v0.18.0</yarnVersion> 
     <installDirectory>.mvn</installDirectory> 
     <workingDirectory>src/main/app</workingDirectory> 
    </configuration> 
</plugin> 

ERROR:

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.2:install-node-and-yarn (Install Node and Yarn) on project ema: The plugin com.github.eirslett:frontend-maven-plugin:1.2 requires Maven version 3.1.0 -> [Help 1]

+0

今取り組んでいるコード1.5.9.RELEASEを変更します。その後、例えばmvn package -Uを使ってmavenビルドを再起動する必要があります。 -Uはあなたの依存関係をredownloadします。 – Sarief

+0

また、チュートリアルでは3.0.1のバージョンを使用しているので、代わりにそのバージョンを使用することもできます。私は 3.0.2を置く場合 – Sarief

答えて

2

簡単に言えば、あなたの問題はここにあります:

<artifactId>maven-resources-plugin</artifactId> 
<version>3.0.5</version> 

このバージョンは、Maven自体ではなく、maven-resources-pluginのバージョンを伝えるためのものです。

ここに適用できる最新のバージョンは3.0.2です。

また、Mavenインストール全体を最新の3.5.0リリースにアップグレードすることをお勧めします。それは、最新のだから、私は同じ問題に直面していた

+0

私はここでエラーを取得しフロントエンド - のmaven-pluginの(V 1.2) –

+0

私が手に:フロントエンド-mavenの-プラグイン:1.2 [ERROR]がゴールcom.github.eirslettの実行に失敗しました:プロジェクトema上のinstall-node-and-yarn(ノードと糸のインストール):プラグインcom.github.eirslett:frontend-maven-plugin:1.2では、Mavenバージョン3.1.0 - > [Help 1] が必要です。 2 –

+0

私の答えの最後の行を参照してください... –

0

それから私は、あなたが3.0.2にバージョンを変更する必要がperfectlty

<parent> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-parent</artifactId> 
    <version>1.5.9.RELEASE</version> 
    <relativePath/> <!-- lookup parent from repository --> 
</parent> 
関連する問題