2013-02-06 41 views
14

Tôi đang cố gắng đóng gói ứng dụng mẫu từ vaadin 7.0.0 với plugin maven cho nhật thực, nhưng mỗi khi chạy mục tiêu "gói", việc xây dựng không thành công các lỗi sau:Lỗi xây dựng Maven: Không thực hiện được mục tiêu, thiếu một lớp

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project essai: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile failed: A required class was missing while executing org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile: org/codehaus/plexus/compiler/util/scan/InclusionScanException 
[ERROR] ----------------------------------------------------- 
[ERROR] realm = plugin>org.apache.maven.plugins:maven-compiler-plugin:2.3.2 
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy 
[ERROR] urls[0] = file:/C:/Users/Benoit/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/2.3.2/maven-compiler-plugin-2.3.2.jar 
[ERROR] urls[1] = file:/C:/Users/Benoit/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar 
[ERROR] Number of foreign imports: 1 
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]] 

kết quả của gói -X mvn là ở đây: http://pastebin.com/jk5uW8Ut

pom.xml của tôi là như sau: http://maven.apache.org/maven-v4_0_0. xsd "> 4.0.0 com.mycompany essai chiến tranh 0.0.1-SNAPSHOT Vaadin Web Application

<properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <vaadin.version>7.0.0.rc2</vaadin.version> 
    <vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version> 
</properties> 
<repositories> 
    <repository> 
     <id>vaadin-addons</id> 
     <url>http://maven.vaadin.com/vaadin-addons</url> 
    </repository> 
    <repository> 
     <id>vaadin-snapshots</id> 
     <url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url> 
     <releases> 
      <enabled>false</enabled> 
     </releases> 
     <snapshots> 
      <enabled>true</enabled> 
     </snapshots> 
    </repository> 
</repositories> 
<pluginRepositories> 
    <pluginRepository> 
     <id>vaadin-snapshots</id> 
     <url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url> 
     <releases> 
      <enabled>false</enabled> 
     </releases> 
     <snapshots> 
      <enabled>true</enabled> 
     </snapshots> 
    </pluginRepository> 
</pluginRepositories> 
<dependencies> 
    <dependency> 
     <groupId>com.vaadin</groupId> 
     <artifactId>vaadin-server</artifactId> 
     <version>${vaadin.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>com.vaadin</groupId> 
     <artifactId>vaadin-client-compiled</artifactId> 
     <version>${vaadin.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>com.vaadin</groupId> 
     <artifactId>vaadin-client</artifactId> 
     <version>${vaadin.version}</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.vaadin</groupId> 
     <artifactId>vaadin-themes</artifactId> 
     <version>${vaadin.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>servlet-api</artifactId> 
     <version>2.4</version> 
     <scope>provided</scope> 
    </dependency> 
</dependencies> 

<build> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <configuration> 
       <source>1.6</source> 
       <target>1.6</target> 
      </configuration> 
     </plugin> 
     <!-- As we are doing "inplace" GWT compilation, ensure the widgetset --> 
     <!-- directory is cleaned properly --> 
     <plugin> 
      <artifactId>maven-clean-plugin</artifactId> 
      <version>2.4.1</version> 
      <configuration> 
       <filesets> 
        <fileset> 
         <directory>src/main/webapp/VAADIN/widgetsets</directory> 
        </fileset> 
       </filesets> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>com.vaadin</groupId> 
      <artifactId>vaadin-maven-plugin</artifactId> 
      <version>${vaadin.plugin.version}</version> 
      <configuration> 
       <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs> 
       <!-- <runTarget>mobilemail</runTarget> --> 
       <!-- We are doing "inplace" but into subdir VAADIN/widgetsets. This 
        way compatible with Vaadin eclipse plugin. --> 
       <webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets 
       </webappDirectory> 
       <hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets 
       </hostedWebapp> 
       <noServer>true</noServer> 
       <!-- Remove draftCompile when project is ready --> 
       <draftCompile>false</draftCompile> 
       <compileReport>true</compileReport> 
       <style>OBF</style> 
       <strict>true</strict> 
       <runTarget>http://localhost:8080/</runTarget> 
      </configuration> 
      <executions> 
       <execution> 
        <configuration> 
         <!-- if you don't specify any modules, the plugin will find them --> 
         <!-- <modules>  <module>com.vaadin.demo.mobilemail.gwt.ColorPickerWidgetSet</module> 
          </modules> --> 
        </configuration> 
        <goals> 
         <goal>resources</goal> 
         <goal>update-widgetset</goal> 
         <goal>compile</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 
     <plugin> 
      <groupId>org.mortbay.jetty</groupId> 
      <artifactId>jetty-maven-plugin</artifactId> 
     </plugin> 
    </plugins> 
    <pluginManagement> 
     <plugins> 
      <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.--> 
      <plugin> 
       <groupId>org.eclipse.m2e</groupId> 
       <artifactId>lifecycle-mapping</artifactId> 
       <version>1.0.0</version> 
       <configuration> 
        <lifecycleMappingMetadata> 
         <pluginExecutions> 
          <pluginExecution> 
           <pluginExecutionFilter> 
            <groupId>com.vaadin</groupId> 
            <artifactId> 
             vaadin-maven-plugin 
            </artifactId> 
            <versionRange> 
             [7.0.0.rc2,) 
            </versionRange> 
            <goals> 
             <goal>resources</goal> 
             <goal>update-widgetset</goal> 
             <goal>compile</goal> 
            </goals> 
           </pluginExecutionFilter> 
           <action> 
            <ignore></ignore> 
           </action> 
          </pluginExecution> 
         </pluginExecutions> 
        </lifecycleMappingMetadata> 
       </configuration> 
      </plugin> 
     </plugins> 
    </pluginManagement> 
</build> 
</project> 

Tôi mới để maven và thậm chí nếu tôi tìm thấy nhiều bài về lỗi này, tôi đã không thể hiểu được những gì có thể gây ra lỗi này.

+0

Vui lòng đính kèm đầu ra của thực thi bằng tùy chọn dòng lệnh '-X'. –

+0

nó ở đây http://pastebin.com/jk5uW8Ut (không thể dán nó trong bài viết) – Ben

Trả lời

14

Đây có vẻ là vấn đề:

[FATAL] Non-parseable POM C:\Users\Benoit.m2\repository\org\apache\maven\maven-parent\16\maven-parent-16.pom

Do maven lỗi này không thể để thêm vào classpath Plugin của tất cả các thư viện cần thiết.

Tôi khuyên bạn nên xóa mọi thứ trong số C:\Users\Benoit\.m2\repository\org\apache\maven\ và xây dựng lại dự án. Điều này sẽ giúp.

+0

điều này giải quyết vấn đề của tôi, cảm ơn rất nhiều! – Ben

+0

@BenoitHnte Bạn được chào đón. –

+1

Tôi không có lỗi FATAL giống nhau, nhưng vẫn giúp tôi giải quyết vấn đề bằng cách xóa mọi thứ trong ~/.m2 ngoại trừ settings.xml. Cảm ơn! –

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