17

既存の Maven プロジェクトをインポートしましたが、pom.xml でいくつかのエラーが発生しています。

Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-

 compiler-plugin:2.3.2:compile (execution: default-compile, phase: compile) pom.xml 

 /org.squashtest.csp.tools.unittest line 50 Maven Project Build Lifecycle Mapping Problem

しかし、私はその理由を理解できません。

pom.xml は次のとおりです。

 <?xml version="1.0"?>
 <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>
<parent>
    <artifactId>squashtest-csp-tools</artifactId>
    <groupId>org.squashtest.tm</groupId>
    <version>1.2.0.RELEASE</version>
</parent>
<artifactId>org.squashtest.csp.tools.unittest</artifactId>
<name>Squashtest CSP - Tools module - Unit tests library</name>
<description>Library  of classes used for unit-testing other Squashtest        
     components</description>

<dependencies>
    <!-- ====== GROOVY ====== -->
    <dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy-all</artifactId>
        <scope>compile</scope>
    </dependency>
    <!-- ====== /GROOVY ====== -->
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>org.squashtest.org.hibernate.core</artifactId>
        <version>${hibernate.version}</version>
        <scope>compile</scope>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>org.unitils</groupId>
        <artifactId>unitils-database</artifactId>
        <version>3.1</version>
        <scope>compile</scope>
        <optional>true</optional>
        <exclusions>
            <exclusion>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-nop</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
</dependencies>
<build>
    <sourceDirectory>src/main/groovy</sourceDirectory>
    <testSourceDirectory>src/test/groovy</testSourceDirectory>
    <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <executions><execution></execution></executions>
      <version>2.3.2</version>
      </plugin> 
    </plugins>
 </build>
</project>

前もって感謝します

4

4 に答える 4

0

Maven では、このエラーが発生する前に確認する必要があることがいくつかあります。

  1. .m2 リポジトリから jar をダウンロードできますか? -> このためには、.m2 フォルダの下のリポジトリ フォルダを削除し、Maven プロジェクトを更新してみてください。次に、.m2 フォルダーの下に新しいリポジトリ フォルダーが表示されます。-> すべての maven-plugin jar が org/apache/maven の下にあることを確認します

  2. Settings.xml ファイルで言及したリポジトリの URL を開くことができるかどうかを確認します -> 任意のブラウザでこの URL を開き、開くことができるかどうかを確認します。

  3. サード パーティのリポジトリ jar が破損している場合があります。-> これはサード パーティの担当者が処理します -> 例: Nexus リポジトリを指定している場合、必要な Maven jar をもう一度アップロードする必要があります。jar のアップロード中に破損する場合があります。

于 2014-02-14T09:32:34.037 に答える