1

私はmaven2とeclipseheliosを使用おり、プラグインM2E 1.0をここからインストールした後:

http://download.eclipse.org/technology/m2e/releases

Eclipseで次のエラーが発生します:

Project configurator "org.jboss.tools.maven.apt.MavenCompilerAptProjectConfigurator" is not available. 
To enable full functionality, install the project configurator and run Maven->Update Project Configuration

また、次の2つのエラーが発生します。

Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile 
(execution: default-compile, phase: compile)

Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile 
(execution: default-testCompile, phase: test-compile)

私のpomファイルのビルドセクション:

<build>

  <resources>

            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>

  </resources>

      <plugins>


          <plugin> 
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
                <execution>
                    <id>copy-dependencies</id>
                    <phase>prepare-package</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${project.build.directory}/lib</outputDirectory>                       
                        <overWriteReleases>false</overWriteReleases>
                        <overWriteSnapshots>false</overWriteSnapshots>
                        <overWriteIfNewer>true</overWriteIfNewer>
                    </configuration>
                </execution>
            </executions>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <configuration>
                <archive>
                    <manifest>
                        <addClasspath>true</addClasspath>
                        <classpathPrefix>lib/</classpathPrefix>
                        <mainClass>com.myapp.MainClass</mainClass>
                    </manifest>
                </archive>
            </configuration> 
        </plugin>


            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>install</id>
                        <phase>install</phase>
                        <goals>
                            <goal>sources</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-resources-plugin</artifactId>
               <version>2.5</version>
               <configuration>
               <encoding>UTF-8</encoding>
               </configuration>
            </plugin>


      </plugins>

      <pluginManagement>
      <plugins>
    <!-- Ignore/Execute plugin execution -->
      <plugin>
        <groupId>org.eclipse.m2e</groupId>
        <artifactId>lifecycle-mapping</artifactId>
        <version>1.0.0</version>
        <configuration>
            <lifecycleMappingMetadata>
                <pluginExecutions>
                    <!-- copy-dependency plugin --> 
                    <pluginExecution>
                        <pluginExecutionFilter>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-dependency-plugin</artifactId>
                            <versionRange>[1.0.0,)</versionRange>
                            <goals>
                                <goal>copy-dependencies</goal>
                            </goals>
                        </pluginExecutionFilter>
                        <action>
                            <ignore />
                        </action>
                    </pluginExecution>
                </pluginExecutions>
            </lifecycleMappingMetadata>
        </configuration>
    </plugin>
   </plugins>
   </pluginManagement>
  </build>

このエラーを修正する方法を教えてください、ありがとう。

4

1 に答える 1

0

私は次のように言及されたプラグインにignoreタグを追加することによってそれを修正しました:

  <plugin>

    <groupId>org.eclipse.m2e</groupId>
    <artifactId>lifecycle-mapping</artifactId>
    <version>1.0.0</version>
    <configuration>
        <lifecycleMappingMetadata>
            <pluginExecutions>
                <!-- copy-dependency plugin --> 
                <pluginExecution>
                    <pluginExecutionFilter>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <versionRange>[1.0.0,)</versionRange>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                    </pluginExecutionFilter>
                    <action>
                        <ignore />
                    </action>
                </pluginExecution>
                <pluginExecution>
                    <pluginExecutionFilter>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>
                            maven-compiler-plugin
                        </artifactId>
                        <versionRange>[2.3.2,)</versionRange>
                        <goals>
                            <goal>testCompile</goal>
                            <goal>compile</goal>
                        </goals>
                    </pluginExecutionFilter>
                    <action>
                        <ignore></ignore>
                    </action>
                </pluginExecution>

            </pluginExecutions>
        </lifecycleMappingMetadata>
    </configuration>

于 2012-07-31T11:51:37.513 に答える