无法执行目标org.codehaus.mojo:gwt-maven-plugin:2.6.1:compile

时间:2014-06-13 08:28:11

标签: java maven vaadin add-on gwt-maven-plugin

我正在使用Vaadin 7,我想在我的项目中添加一个插件。我按照here描述的所有步骤进行了操作,但它不起作用。 这是我在pom.xml中的配置:

<properties>
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  <vaadin.version>7.1.3</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>
  <!-- Needed when using the widgetset optimizer (custom ConnectorBundleLoaderFactory). 
   For widgetset compilation, vaadin-client-compiler is automatically added 
   on the compilation classpath by vaadin-maven-plugin so normally there is 
   no need for an explicit dependency. -->
  <!-- <dependency> <groupId>com.vaadin</groupId> <artifactId>vaadin-client-compiler</artifactId> 
   <version>${vaadin.version}</version> <scope>provided</scope> </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-maven-plugin</artifactId>
   <version>${vaadin.version}</version>
  </dependency>

  <dependency>
   <groupId>com.vaadin</groupId>
   <artifactId>vaadin-push</artifactId>
   <version>${vaadin.version}</version>
  </dependency>
  <dependency>
   <groupId>com.vaadin</groupId>
   <artifactId>vaadin-themes</artifactId>
   <version>${vaadin.version}</version>
  </dependency>
  <dependency>
   <groupId>com.alfresco</groupId>
   <artifactId>com.alfresco.connect</artifactId>
   <version>1.3</version>
  </dependency>
  <dependency>
   <groupId>com.vaadin</groupId>
   <artifactId>vaadin-theme-compiler</artifactId>
   <version>${vaadin.version}</version>
  </dependency>

  <dependency>
   <groupId>com.google.code.gson</groupId>
   <artifactId>gson</artifactId>
   <version>2.2.4</version>
  </dependency>

  <dependency>
   <groupId>com.vaadin.addon</groupId>
   <artifactId>vaadin-charts</artifactId>
   <version>1.0.0</version>
  </dependency>

  <dependency>
   <groupId>org.apache.xmlgraphics</groupId>
   <artifactId>fop</artifactId>
   <version>0.93</version>
  </dependency>

  <dependency>
   <groupId>org.vaadin.addons</groupId>
   <artifactId>animator</artifactId>
   <version>2.0.0</version>
  </dependency>

  <dependency>
   <groupId>com.google.gwt</groupId>
   <artifactId>gwt-servlet</artifactId>
   <version>2.6.1</version>
  </dependency>

  <dependency>
   <groupId>com.alfresco</groupId>
   <artifactId>com.alfresco.connect</artifactId>
   <version>1.5</version>
  </dependency>

  <dependency>
   <groupId>org.vaadin.addon</groupId>
   <artifactId>confirmdialog</artifactId>
   <version>2.0.5</version>
  </dependency>

  <dependency>
   <groupId>com.vaadin.addon</groupId>
   <artifactId>vaadin-charts</artifactId>
   <version>1.1.6</version>
  </dependency>

 </dependencies>

 <build>
  <plugins>
   <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>gwt-maven-plugin</artifactId>
    <version>2.6.1</version>
    <executions>
     <execution>
      <goals>
       <goal>compile</goal>
       <goal>generateAsync</goal>
       <goal>test</goal>
      </goals>
     </execution>
    </executions>
   </plugin>
   <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>

    <configuration>
     <source>1.7</source>
     <target>1.7</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>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.2</version>
    <configuration>
     <failOnMissingWebXml>false</failOnMissingWebXml>
    </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>
     <!-- Most Vaadin apps don't need this stuff, guide that to target -->
     <persistentunitcachedir>${project.build.directory}</persistentunitcachedir>
     <deploy>${project.build.directory}/gwt-deploy</deploy>
     <!-- Compile report is not typically needed either, saves hunreds of 
      mb disk -->
     <compileReport>false</compileReport>
     <noServer>true</noServer>
     <!-- Remove draftCompile when project is ready -->
     <draftCompile>false</draftCompile>

     <style>OBF</style>
     <strict>true</strict>
     <runTarget>http://localhost:8083/</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>clean</goal>
       <goal>resources</goal>
       <goal>update-theme</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.1.2,)
          </versionRange>
          <goals>
           <goal>resources</goal>
           <goal>update-widgetset</goal>
           <goal>compile</goal>
           <goal>update-theme</goal>
           <goal>compile-theme</goal>
          </goals>
         </pluginExecutionFilter>
         <action>
          <ignore></ignore>
         </action>
        </pluginExecution>
       </pluginExecutions>
      </lifecycleMappingMetadata>
     </configuration>
    </plugin>
   </plugins>
  </pluginManagement>
 </build>
 <parent>
  <groupId>com.capgemini</groupId>
  <artifactId>alfresco-custom-application</artifactId>
  <version>0.0.1-SNAPSHOT</version>
 </parent>
</project>

当我运行vaadin:update-widgetset install时,我明白了:

Results :

    Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

    [INFO] 
    [INFO] --- gwt-maven-plugin:2.6.1:compile (default) @ alfredine ---
    [INFO] auto discovered modules [custom.alfresco.UI.widgetset.confirmdialog]
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 6.423s
    [INFO] Finished at: Fri Jun 13 10:25:39 CEST 2014
    [INFO] Final Memory: 19M/347M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.6.1:compile (default) on project alfredine: GWT Module org.vaadin.jouni.dom.DomWidgetset not found in project sources or resources. -> [Help 1]
    [ERROR] 
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR] 
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

我几乎尝试了一切,我无法弄清楚这一点。救命 !

更新: 错误说模块org.vaadin.jouni.dom.DomWidgetset nout发现,我查看了项目中的所有文件,我发现没有任何名为org.vaadin.jouni.dom.DomWidgetset的内容。它来自哪里?!

1 个答案:

答案 0 :(得分:1)

Animator 2.0取决于DOM add-on,所以你也应该将它添加到你的pom.xml中。

有人告诉我,应该可以在Vaadin Directory插件中明确添加依赖项,所以我会看看是否可以在下一个版本中修复它。但是现在你需要自己添加DOM加载项。