2011-08-09 3 views
6

이 매개 변수를 사용하여 Maven 프로젝트를 만들려고 할 때 : Archetype Group Id - org.codehaus.mojo; Archetype Artifact ID - gwt-maven-plugin; Archetype 버전 - 2.3.0-1.이클립스에서 간단하게 GWT ​​2.3 및 Maven2 (3) 프로젝트

  • 플러그인 라이프 사이클 구성에 포함되지 실행 : org.codehaus.mojo : GWT-받는다는 - 플러그인 : 2.3.0-1 : generateAsync (실행 : 기본적 단계 : 나는 이상한 오류를 얻을 생성 org.codehaus.mojo : -sources) 라이프 사이클 구성에 포함

  • 플러그인 실행하지 GWT-받는다는 - 플러그인 : 2.3.0-1 : 국제화 (실행 : 기본적 단계 : 생성 - 소스)

  • 라이프 사이클 설정으로 덮어 쓰지 않은 플러그인 실행 : org.apache.maven.plugins : maven-war-plugin : 2.1 0.1 : 폭발했다 (실행 : 기본적 단계 : 컴파일)

과 같은 몇 가지 경고 :

  • 이 프로젝트 패싯 jst.web의 구현이

    를 찾을 수 없습니다. 기능이 제한됩니다.

  • 프로젝트 패싯 wst.jsdt.web의 구현을 찾을 수 없습니다. 기능이 제한됩니다. 그래서

    <?xml version="1.0" encoding="UTF-8"?> 
    <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/maven-v4_0_0.xsd"> 
    
        <!-- POM file generated with GWT webAppCreator --> 
        <modelVersion>4.0.0</modelVersion> 
        <groupId>net.test1</groupId> 
        <artifactId>TestWebApp</artifactId> 
        <packaging>war</packaging> 
        <version>0.0.1-SNAPSHOT</version> 
        <name>GWT Maven Archetype</name> 
    
        <properties> 
        <!-- Convenience property to set the GWT version --> 
        <gwtVersion>2.3.0</gwtVersion> 
        <!-- GWT needs at least java 1.5 --> 
        <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory> 
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
        </properties> 
    
        <dependencies> 
        <dependency> 
         <groupId>com.google.gwt</groupId> 
         <artifactId>gwt-servlet</artifactId> 
         <version>${gwtVersion}</version> 
         <scope>runtime</scope> 
        </dependency> 
        <dependency> 
         <groupId>com.google.gwt</groupId> 
         <artifactId>gwt-user</artifactId> 
         <version>${gwtVersion}</version> 
         <scope>provided</scope> 
        </dependency> 
        <dependency> 
         <groupId>junit</groupId> 
         <artifactId>junit</artifactId> 
         <version>4.7</version> 
         <scope>test</scope> 
        </dependency> 
        <dependency> 
         <groupId>javax.validation</groupId> 
         <artifactId>validation-api</artifactId> 
         <version>1.0.0.GA</version> 
         <scope>test</scope> 
        </dependency> 
        <dependency> 
         <groupId>javax.validation</groupId> 
         <artifactId>validation-api</artifactId> 
         <version>1.0.0.GA</version> 
         <classifier>sources</classifier> 
         <scope>test</scope> 
        </dependency> 
        </dependencies> 
    
        <build> 
        <!-- Generate compiled stuff in the folder used for developing mode --> 
        <outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory> 
    
        <plugins> 
    
         <!-- GWT Maven Plugin --> 
         <plugin> 
         <groupId>org.codehaus.mojo</groupId> 
         <artifactId>gwt-maven-plugin</artifactId> 
         <version>2.3.0-1</version> 
         <executions> 
          <execution> 
          <goals> 
           <goal>compile</goal> 
           <goal>test</goal> 
           <goal>i18n</goal> 
           <goal>generateAsync</goal> 
          </goals> 
          </execution> 
         </executions> 
         <!-- Plugin configuration. There are many available options, see 
          gwt-maven-plugin documentation at codehaus.org --> 
         <configuration> 
          <runTarget>TestWebApp.html</runTarget> 
          <hostedWebapp>${webappDirectory}</hostedWebapp> 
          <i18nMessagesBundle>net.test1.TestWebApp.client.Messages</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.apache.maven.plugins</groupId> 
         <artifactId>maven-compiler-plugin</artifactId> 
         <version>2.3.2</version> 
         <configuration> 
          <source>1.5</source> 
          <target>1.5</target> 
         </configuration> 
         </plugin> 
        </plugins> 
        </build> 
    
    </project> 
    

    그리고 :

내 pom.xml 파일입니다. 이게 뭐야? 나는 가능한 모든 매뉴얼을 인터넷에서 시험해 보았다. Eclipse를 사용하지 않고 수동으로 프로젝트를 만들려고했습니다. 내 생각에, 문제는 인터넷의 매뉴얼이 이전 버전의 Eclipse, Maven, GWT 용으로 작성되었다는 것입니다. 내가 어떻게 이길 수 있니? 오류없이 GWT 2.3, Maven2 플러그인 및 Eclipse Indigo로 간단한 프로젝트를 만들려면 어떻게해야합니까?

+0

비슷한 오류가 있지만 빌드가 성공합니다. 이러한 오류 및 경고는 m2eclipse에서 발생했다고 생각합니다. m2eclipse를 설치 했습니까? – Adi

답변

11

이것은 알려진 동작으로, Eclipse 위키에서 논의되었습니다. 여기를 참조하십시오 : http://wiki.eclipse.org/M2E_plugin_execution_not_covered.

pom의 문제가있는 부분을 주석 처리하지 마십시오. 정말로 필요합니다. 예를 들어, pom의 maven-war-plugin에 대한 생성 된 주석은 "gwt : run을 실행하기 전에 정적 웹 파일 복사"입니다.이 사실이 밝혀졌습니다. 해당 플러그인을 주석 처리하고 "mvn clean gwt : run"을 실행하면 정적 파일이 대상 폴더에 복사되지 않고 호스트 모드에서 사용할 수 없게됩니다.

다행히도 쉽게 해결할 수 있습니다. 이클립스에서 pom을 열어서 개요 섹션을 살펴보면 맨 위에있는 오류 메시지를 클릭하면 몇 가지 빠른 수정 옵션이 제공됩니다. "pom.xml에 목표가 영구적으로 표시되도록 무시했습니다." 이렇게하면 일부 m2e 구성이 pom에 추가되어 더 이상 오류로 표시되지 않으며 모든 것이 이전과 같이 작동합니다. 귀하의 pom에서 새로 생성 된 섹션은 위의 링크에서 "무시"옵션으로 설명한 것입니다.

희망이 도움이됩니다.