2011-12-15 16 views
27

Tôi đang sử dụng STS và tôi đã nhập dự án GWT từ một máy khác. Dự án sử dụng m2eclipse. Tôi gặp phải hai lỗi này khi xây dựng dự án:Tại sao tôi nhận được lỗi "Thực thi trình cắm không được bao gồm trong cấu hình vòng đời với GWT"?

Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:gwt-maven-plugin:2.2.0:i18n (execution: default, phase: generate-sources) pom.xml /contactsgwt line 175 
Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-war-plugin:2.1.1:exploded (execution: default, phase: compile) pom.xml /contactsgwt line 198 

Có vấn đề gì? Có bất kỳ cấu hình nào khác cần được thực hiện để gwt maven plugin hoạt động không?

Các pom.xml đang gây ra lỗi:

<!-- GWT Maven Plugin --> 
<plugin> 
    <groupId>org.codehaus.mojo</groupId> 
    <artifactId>gwt-maven-plugin</artifactId> 
    <version>2.2.0</version> 
    <executions> 
     <execution> 
      <goals> 
       <goal>compile</goal> 
       <goal>test</goal> 
       <goal>i18n</goal> 
      </goals> 
     </execution> 
    </executions> 
    <!-- Plugin configuration. There are many available options, see gwt-maven-plugin documentation at codehaus.org --> 
    <configuration> 
     <runTarget>Contacts.html</runTarget> 
     <hostedWebapp>${webappDirectory}</hostedWebapp 
     <i18nMessagesBundle>es.indra.gwt.contactsgwt.client.ContactsMessages</i18nMessagesBundle> 
    </configuration> 
</plugin> 

<!-- Copy static web files before executing gwt:run --> 
<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-war-plugin</artifactId> 
    <version>2.1.1</version> 
    <executions> 
     <execution> 
      <phase>compile</phase> 
      <goals> 
       <goal>exploded</goal> 
      </goals> 
     </execution> 
    </executions> 
    <configuration> 
     <webappDirectory>${webappDirectory}</webappDirectory> 
    </configuration> 
</plugin> 

<plugin> 
    <groupId>org.maven.ide.eclipse</groupId> 
    <artifactId>lifecycle-mapping</artifactId> 
    <version>0.9.9-SNAPSHOT</version> 
    <configuration> 
     <mappingId>generic</mappingId> 
     <configurators></configurators> 
     <mojoExecutions> 
      <mojoExecution runOnIncremental="true">org.codehaus.mojo:gwt-maven-plugin:2.2.0:i18n</mojoExecution> 
      <mojoExecution runOnIncremental="true">org.apache.maven.plugins:maven-resources-plugin:2.4.1:resources</mojoExecution> 
      <mojoExecution runOnIncremental="false">org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile</mojoExecution> 
      <mojoExecution runOnIncremental="false">org.apache.maven.plugins:maven-war-plugin:2.1.1:exploded</mojoExecution> 
      <mojoExecution runOnIncremental="false">org.apache.maven.plugins:maven-resources-plugin:2.4.1:testResources</mojoExecution> 
     </mojoExecutions> 
    </configuration> 
</plugin> 
+0

Liên quan đến: http://stackoverflow.com/questions/9142533/plugin-execution-not-covered-by-lifecycle- configuration-jbossas-7-ear-archetype – Gray

Trả lời

46

Nếu bạn sử dụng Eclipse Indigo (3.7), bạn phải kích hoạt các plugin vòng đời. Xem here để biết thêm chi tiết.

Chỉ cần thêm phần pluginManagement này để phần build lại tập tin pom.xml bạn

<pluginManagement> 
    <plugins> 
     <plugin> 
      <groupId>org.eclipse.m2e</groupId> 
      <artifactId>lifecycle-mapping</artifactId> 
      <version>1.0.0</version> 
      <configuration> 
       <lifecycleMappingMetadata> 
        <pluginExecutions> 
         <pluginExecution> 
          <pluginExecutionFilter> 
           <groupId>org.codehaus.mojo</groupId> 
           <artifactId>gwt-maven-plugin</artifactId> 
           <versionRange>[2.4.0,)</versionRange> 
           <goals> 
            <goal>resources</goal> 
            <goal>compile</goal> 
            <goal>i18n</goal> 
            <goal>generateAsync</goal> 
           </goals> 
          </pluginExecutionFilter> 
          <action> 
           <execute /> 
          </action> 
         </pluginExecution> 
         <pluginExecution> 
          <pluginExecutionFilter> 
           <groupId>org.apache.maven.plugins</groupId> 
           <artifactId>maven-war-plugin</artifactId> 
           <versionRange>[2.1.1,)</versionRange> 
           <goals> 
            <goal>exploded</goal> 
           </goals> 
          </pluginExecutionFilter> 
          <action> 
           <execute /> 
          </action> 
         </pluginExecution> 
        </pluginExecutions> 
       </lifecycleMappingMetadata> 
      </configuration> 
     </plugin> 
    </plugins> 
</pluginManagement> 
+0

cảm ơn !! đã làm cho thủ thuật – Neets

+1

Cảm ơn câu trả lời của bạn. Chúng tôi có thể thêm generateAsync hàng vào phần đầu tiên. Bởi vì một lỗi tương tự có thể xảy ra cho mục tiêu generateAsync và bổ sung này giải quyết lỗi này. – ovunccetin

+1

@ovunccetin cảm ơn vì gợi ý. Tôi đã cập nhật câu trả lời –

Các vấn đề liên quan