2017-05-11 44 views
1

今天我試着將a googlemaps library添加到我的vaadin項目中。 我添加了必需的依賴我的pom.xml,但卻後,我加入了圖書館,行家並不想因爲這個錯誤的重新編譯我的視窗元件,:Vaadin在添加googlemaps vaadin庫後不會編譯Widgetset

Tracing compile failure path for type 'com.vaadin.tapio.googlemaps.client.GoogleMapConnector' 
[INFO]  [ERROR] Errors in 'jar:file:/C:/Users/kolbm/.m2/repository/com/vaadin/tapio/googlemaps/2.0.0/googlemaps-2.0.0.jar!/com/vaadin/tapio/googlemaps/client/GoogleMapConnector.java' 
[INFO]   [ERROR] Line 202: The return type is incompatible with AbstractComponentConnector.getState() 
[INFO]   [ERROR] Line 203: Cannot cast from AbstractComponentState to GoogleMapState 
[INFO]  [ERROR] Errors in 'jar:file:/C:/Users/kolbm/.m2/repository/com/vaadin/tapio/googlemaps/2.0.0/googlemaps-2.0.0.jar!/com/vaadin/tapio/googlemaps/client/GoogleMapState.java' 
[INFO]   [ERROR] Line 9: The import com.vaadin.shared.ui.AbstractComponentContainerState cannot be resolved 
[INFO]   [ERROR] Line 19: AbstractComponentContainerState cannot be resolved to a type 
[INFO] Tracing compile failure path for type 'com.vaadin.tapio.googlemaps.client.GoogleMapState' 
[INFO]  [ERROR] Errors in 'jar:file:/C:/Users/kolbm/.m2/repository/com/vaadin/tapio/googlemaps/2.0.0/googlemaps-2.0.0.jar!/com/vaadin/tapio/googlemaps/client/GoogleMapState.java' 
[INFO]   [ERROR] Line 9: The import com.vaadin.shared.ui.AbstractComponentContainerState cannot be resolved 
[INFO]   [ERROR] Line 19: AbstractComponentContainerState cannot be resolved to a type 
[INFO] [ERROR] Aborting compile due to errors in some input files 

這裏是我的POM:

<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/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 

    <groupId>xxx</groupId> 
    <artifactId>xxx</artifactId> 
    <packaging>war</packaging> 
    <version>1.0-SNAPSHOT</version> 
    <name>client</name> 

    <prerequisites> 
     <maven>3</maven> 
    </prerequisites> 

    <properties> 
     <vaadin.version>7.7.3</vaadin.version> 
     <vaadin.plugin.version>7.7.3</vaadin.plugin.version> 
     <jetty.plugin.version>9.3.9.v20160517</jetty.plugin.version> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <maven.compiler.source>1.8</maven.compiler.source> 
     <maven.compiler.target>1.8</maven.compiler.target> 
     <!--<vaadin.widgetset.mode>local</vaadin.widgetset.mode>--> 
    </properties> 

    <dependencyManagement> 
     <dependencies> 
      <dependency> 
       <groupId>com.vaadin</groupId> 
       <artifactId>vaadin-bom</artifactId> 
       <version>${vaadin.version}</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 
     </dependencies> 
    </dependencyManagement> 

    <dependencies> 
     <dependency> 
      <groupId>com.vaadin.tapio</groupId> 
      <artifactId>googlemaps</artifactId> 
      <version>2.0.0</version> 
     </dependency> 
     <dependency> 
      <groupId>javax.servlet</groupId> 
      <artifactId>javax.servlet-api</artifactId> 
      <version>3.0.1</version> 
      <scope>provided</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.vaadin</groupId> 
      <artifactId>vaadin-server</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>com.vaadin</groupId> 
      <artifactId>vaadin-themes</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.httpcomponents</groupId> 
      <artifactId>httpmime</artifactId> 
      <version>4.3.6</version> 
     </dependency> 
     <dependency> 
      <groupId>org.json</groupId> 
      <artifactId>json</artifactId> 
      <version>20140107</version> 
     </dependency> 
     <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind --> 
     <dependency> 
      <groupId>com.fasterxml.jackson.core</groupId> 
      <artifactId>jackson-databind</artifactId> 
      <version>2.8.5</version> 
     </dependency> 
     <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations --> 
     <dependency> 
      <groupId>com.fasterxml.jackson.core</groupId> 
      <artifactId>jackson-annotations</artifactId> 
      <version>2.8.5</version> 
     </dependency> 
     <!-- https://mvnrepository.com/artifact/junit/junit --> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.12</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>info.cukes</groupId> 
      <artifactId>cucumber-java</artifactId> 
      <version>1.2.5</version> 
     </dependency> 
     <dependency> 
      <groupId>org.seleniumhq.selenium</groupId> 
      <artifactId>selenium-java</artifactId> 
      <version>2.47.1</version> 
     </dependency> 
    </dependencies> 

    <build> 
     <testSourceDirectory>${project.basedir}/src/test</testSourceDirectory> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-war-plugin</artifactId> 
       <version>2.6</version> 
       <configuration> 
        <failOnMissingWebXml>false</failOnMissingWebXml> 
        <!-- Exclude an unnecessary file generated by the GWT compiler. --> 
        <packagingExcludes>WEB-INF/classes/VAADIN/widgetsets/WEB-INF/**</packagingExcludes> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>com.vaadin</groupId> 
       <artifactId>vaadin-maven-plugin</artifactId> 
       <version>${vaadin.plugin.version}</version> 
       <configuration> 
        <webappDirectory>${basedir}/target/classes/VAADIN/widgetsets</webappDirectory> 
        <persistentunitcachedir>${basedir}/target/tmp/gwt-unitCache</persistentunitcachedir> 
       </configuration> 
       <executions> 
        <execution> 
         <goals> 
          <goal>resources</goal> 
          <goal>update-widgetset</goal> 
          <goal>update-theme</goal> 
          <goal>compile</goal> 
          <!-- Comment out compile-theme goal to use on-the-fly theme compilation --> 
          <goal>compile-theme</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-clean-plugin</artifactId> 
       <version>3.0.0</version> 
       <!-- Clean up also any pre-compiled themes --> 
       <configuration> 
        <filesets> 
         <fileset> 
          <directory>src/main/webapp/VAADIN/themes</directory> 
          <includes> 
           <include>**/styles.css</include> 
           <include>**/styles.scss.cache</include> 
          </includes> 
         </fileset> 
        </filesets> 
       </configuration> 
      </plugin> 

      <!-- The Jetty plugin allows us to easily test the development build by 
       running jetty:run on the command line. --> 
      <plugin> 
       <groupId>org.eclipse.jetty</groupId> 
       <artifactId>jetty-maven-plugin</artifactId> 
       <version>9.4.0.RC2</version> 
       <configuration> 
        <scanIntervalSeconds>2</scanIntervalSeconds> 
        <webApp> 
         <contextPath>/</contextPath> 
        </webApp> 
        <scanTargets> 
         <scanTarget> 
          target/classes 
         </scanTarget> 
        </scanTargets> 
       </configuration> 
      </plugin> 

      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-surefire-plugin</artifactId> 
       <version>2.20</version> 
       <configuration> 
        <includes> 
         <include>**/Test*.java</include> 
         <include>**/test*.java</include> 
        </includes> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 


    <profiles> 
     <profile> 
      <!-- Vaadin pre-release repositories --> 
      <id>vaadin-prerelease</id> 
      <activation> 
       <activeByDefault>false</activeByDefault> 
      </activation> 

      <repositories> 
       <repository> 
        <id>vaadin-addons</id> 
        <url>http://maven.vaadin.com/vaadin-addons</url> 
       </repository> 
       <repository> 
        <id>vaadin-prereleases</id> 
        <url>http://maven.vaadin.com/vaadin-prereleases</url> 
       </repository> 
       <repository> 
        <id>vaadin-snapshots</id> 
        <url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url> 
        <releases> 
         <enabled>false</enabled> 
        </releases> 
        <snapshots> 
         <enabled>true</enabled> 
        </snapshots> 
       </repository> 
      </repositories> 
      <pluginRepositories> 
       <pluginRepository> 
        <id>vaadin-prereleases</id> 
        <url>http://maven.vaadin.com/vaadin-prereleases</url> 
       </pluginRepository> 
       <pluginRepository> 
        <id>vaadin-snapshots</id> 
        <url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url> 
        <releases> 
         <enabled>false</enabled> 
        </releases> 
        <snapshots> 
         <enabled>true</enabled> 
        </snapshots> 
       </pluginRepository> 
      </pluginRepositories> 
     </profile> 
    </profiles> 

希望有人知道該怎麼做,因爲我發現在互聯網上沒有什麼...

回答

1

您正在使用vaadin 7,但谷歌地圖插件的版本2.0.0是有針對性地vaadin 8 嘗試使用1.3版。 4谷歌地圖插件