67

m2e 1.0 を正しく動作させるために、ライフサイクル マッピングを指定する必要がありました。

    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>org.bsc.maven</groupId>
                                    <artifactId>maven-processor-plugin</artifactId>
                                    <versionRange>[2.0.2,)</versionRange>
                                    <goals>
                                        <goal>process</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute />
                                </action>
                            </pluginExecution>
                        </pluginExecutions>                         
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>

しかし、その後、次の警告が表示されます。

 [WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is missing, no dependency information available
 [WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0

たとえば、特定のmavenタスクを実行した場合mvn clean install findbugs:findbugs(実行した場合のみmvn clean install、そのようなメッセージはありません)

問題は、マッピング情報を保持するためだけに定義されているため、この POM が存在しないことです。( m2e ライフサイクル マッピングが見つかりません)

とにかく、警告なしでビルドをクリーンに保ちたいのですが、どうすればこの特定のものを取り除くことができますか? (私の CI サーバーは、警告がないことを確認します。 )

私は Maven 3.0.2 を使用し、Maven 3.0.3 も試しましたが、同じ結果になりました。

4

5 に答える 5

72

私のチームは、関連する構成をプロファイルにラップすることで、この問題を回避しています。

<profile>
  <id>only-eclipse</id>
  <activation>
    <property>
      <name>m2e.version</name>
    </property>
  </activation>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            ...
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</profile>
于 2014-05-17T02:38:38.707 に答える
20

This a known bug with WONTFIX resolution. The suggested solution is the simplest in my opinion:

mvn archetype:generate -DgroupId=org.eclipse.m2e -DartifactId=lifecycle-mapping \
 -Dversion=1.0.0 -DarchetypeArtifactId=maven-archetype-mojo

and install this project.

于 2013-09-02T08:38:50.473 に答える
8

このソリューションは現在廃止されています。受け入れられている回答である @ctrueden による「プロファイル」ソリューションを使用することをお勧めします。

最もクリーンなソリューションではありませんが、会社でリポジトリ マネージャーを使用している場合、または自分でリポジトリ マネージャーを使用している場合は、当面は次のようにすることをお勧めします . -mvn install自分で実行mvn deploy -DaltDeploymentRepository=REPO_ID::default::YOUR_THIRDPARTY_REPO_URLする場合 - Nexus や Artifactory などのリポジトリ マネージャーがある場合に実行します。- https://github.com/mfriedenhagen/dummy-lifecycle-mapping-plugin/blob/master/README.creoleも参照してください。

よろしくミルコ

于 2012-01-05T11:03:07.063 に答える
0

現在、より良い解決策があります (Eclipse のエラー メッセージのみ)。

Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:buildnumber-maven-plugin:1.1:create-timestamp (execution: default-create-timestamp, phase: validate)CTR+1というエラーを押して、次のオプションを選択します。

ここに画像の説明を入力

これはorg.eclipse.m2e.editor.xml_1.2.0.20120903-1050.jarプラグインで動作します(おそらく以前も)

于 2012-11-09T10:17:50.847 に答える