Vaadin:日历插件的问题 - 无法编译小部件集



我想将日历(https://vaadin.com/directory/component/calendar-add-on)添加到我的项目中。所以我在我的pom中添加了依赖.xml。
当我使用日历组件运行项目时,我遇到了错误,其中组件是:

Widgetset 'com.vaadin.DefaultWidgetSet' 不包含 org.vaadin.addon.calendar.Calendar site:vaadin.com

我在某处读到我需要将"不存在的模块"添加到配置中,然后编译小部件集。
所以我这样做了,现在当我编译小部件集时,它给了我一个JS解析器错误。
我做错了什么吗?
下面是小部件集编译输出:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building portal 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- vaadin-maven-plugin:8.2.0:update-widgetset (default-cli) @ portal ---
[INFO] Updating widgetset non-existing-module
[INFO] Adding resource directory to command classpath: C:UsersMichuSWZTZportalsrcmainresources
[INFO] Adding resource directory to command classpath: C:UsersMichuSWZTZportalsrcmainresources
[INFO] Widgetsets found from classpath:
[INFO] org.vaadin.addon.calendar.WidgetSet in jar:file:C:/Users/Michu/.m2/repository/org/vaadin/blackbluegl/calendar-component/2.0-BETA3/calendar-component-2.0-BETA3.jar!/
[INFO] com.vaadin.DefaultWidgetSet in jar:file:C:/Users/Michu/.m2/repository/com/vaadin/vaadin-client/8.2.0/vaadin-client-8.2.0.jar!/
[INFO] Addon styles found from classpath:
[INFO] VAADIN/addons/calendar/calendar-addon.scss in jar:file:C:/Users/Michu/.m2/repository/org/vaadin/blackbluegl/calendar-component/2.0-BETA3/calendar-component-2.0-BETA3.jar!/
[INFO]
[INFO] Search took 8ms
[INFO]
[INFO] --- vaadin-maven-plugin:8.2.0:compile (default-cli) @ portal ---
[INFO] Compiling module non-existing-module
[INFO] Computing all possible rebind results for 'com.vaadin.client.metadata.ConnectorBundleLoader'
[INFO] Rebinding com.vaadin.client.metadata.ConnectorBundleLoader
[INFO] Invoking generator com.vaadin.server.widgetsetutils.ConnectorBundleLoaderFactory
[INFO] Populating eager bundle
[INFO] Visiting DataCommunicatorConnector with ConnectorInitVisitor
[INFO] DataCommunicatorConnector will be in the eager bundle
[INFO] Will serialize class com.vaadin.shared.extension.datacommunicator.DataCommunicatorState as a bean
[INFO] Will serialize class com.vaadin.shared.communication.URLReference using URLReference_Serializer
(...)
[INFO] Populating CalendarConnector bundle
[INFO] Visiting CalendarConnector with ConnectorInitVisitor
[INFO] CalendarConnector will be in the org.vaadin.addon.calendar.client.CalendarConnector bundle
[INFO] Will serialize class org.vaadin.addon.calendar.client.CalendarState as a bean
[INFO] Will serialize class org.vaadin.addon.calendar.client.CalendarState.ItemSortOrder as an enum
[INFO] Will serialize class org.vaadin.addon.calendar.client.CalendarState.Item as a bean
[INFO] Will serialize class org.vaadin.addon.calendar.client.CalendarState.Day as a bean
[INFO] Will serialize class org.vaadin.addon.calendar.client.CalendarState.Action as a bean
[INFO] Computing all possible rebind results for 'com.vaadin.client.ui.dd.VAcceptCriterionFactory'
[INFO] Rebinding com.vaadin.client.ui.dd.VAcceptCriterionFactory
[INFO] Invoking generator com.vaadin.server.widgetsetutils.AcceptCriteriaFactoryGenerator
[INFO] Detecting available criteria ...
[INFO] creating mapping for com.vaadin.event.dd.acceptcriteria.AcceptAll
[INFO] creating mapping for com.vaadin.event.dd.acceptcriteria.And
[INFO] creating mapping for com.vaadin.event.dd.acceptcriteria.ContainsDataFlavor
[INFO] creating mapping for com.vaadin.event.dd.acceptcriteria.SourceIs
[INFO] creating mapping for com.vaadin.event.dd.acceptcriteria.Not
[INFO] creating mapping for com.vaadin.event.dd.acceptcriteria.Or
[INFO] creating mapping for com.vaadin.event.dd.acceptcriteria.ServerSideCriterion
[INFO] creating mapping for com.vaadin.event.dd.acceptcriteria.SourceIsTarget
[INFO] creating mapping for com.vaadin.event.dd.acceptcriteria.TargetDetailIs
[INFO] Done. (0seconds)
[INFO] Compiling 1 permutation
[INFO] Compiling permutation 0...
[INFO] Compile of permutations succeeded
[INFO] Compilation succeeded -- 64,335s
[INFO] Linking into C:UsersMichuSWZTZportalsrcmainwebappVAADINwidgetsetsnon-existing-module; Writing extras to C:UsersMichuSWZTZportaltargetextranon-existing-module
[INFO] Invoking Linker Cross-Site-Iframe
[INFO] Attempting to optimize JS
[INFO] [ERROR] Unable to parse JavaScript
[INFO] com.google.gwt.dev.js.JsParserException: StandardLinkerContext.optimizeJavaScript(17): missing ( before function parameters
[INFO] > function non-existing-module() {
[INFO] > -------------^
[INFO] at com.google.gwt.dev.js.JsParser$1.error(JsParser.java:111)
[INFO] at com.google.gwt.dev.js.rhino.Context.reportError(Context.java:459)
[INFO] at com.google.gwt.dev.js.rhino.TokenStream.reportSyntaxError(TokenStream.java:1594)
[INFO] at com.google.gwt.dev.js.rhino.Parser.reportError(Parser.java:72)
[INFO] at com.google.gwt.dev.js.rhino.Parser.mustMatchToken(Parser.java:64)
[INFO] at com.google.gwt.dev.js.rhino.Parser.function(Parser.java:189)
[INFO] at com.google.gwt.dev.js.rhino.Parser.parse(Parser.java:116)
[INFO] at com.google.gwt.dev.js.JsParser.parseImpl(JsParser.java:133)
[INFO] at com.google.gwt.dev.js.JsParser.parse(JsParser.java:88)
[INFO] at com.google.gwt.dev.js.JsParser.parseInto(JsParser.java:93)
[INFO] at com.google.gwt.core.ext.linker.impl.StandardLinkerContext.optimizeJavaScript(StandardLinkerContext.java:443)
[INFO] at com.google.gwt.core.ext.linker.impl.SelectionScriptLinker.generateSelectionScript(SelectionScriptLinker.java:428)
[INFO] at com.google.gwt.core.ext.linker.impl.SelectionScriptLinker.generateSelectionScript(SelectionScriptLinker.java:416)
[INFO] at com.google.gwt.core.ext.linker.impl.SelectionScriptLinker.emitSelectionScript(SelectionScriptLinker.java:310)
[INFO] at com.google.gwt.core.ext.linker.impl.SelectionScriptLinker.link(SelectionScriptLinker.java:212)
[INFO] at com.google.gwt.core.ext.linker.impl.StandardLinkerContext.invokeFinalLink(StandardLinkerContext.java:339)
[INFO] at com.google.gwt.dev.Link.doSimulatedShardingLink(Link.java:459)
[INFO] at com.google.gwt.dev.Link.link(Link.java:178)
[INFO] at com.google.gwt.dev.Compiler.compile(Compiler.java:244)
[INFO] at com.google.gwt.dev.Compiler.compile(Compiler.java:155)
[INFO] at com.google.gwt.dev.Compiler.compile(Compiler.java:144)
[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:118)
[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:125)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:15 min
[INFO] Finished at: 2018-01-02T16:35:07+01:00
[INFO] Final Memory: 34M/363M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:8.2.0:compile (default-cli) on project portal: Command [[
[ERROR] C:Program FilesJavajdk1.8.0_112jrebinjava -Xmx1G -Dgwt.persistentunitcache=false com.google.gwt.dev.Compiler -logLevel INFO -style OBF -war C:UsersMichuSWZTZportalsrcmainwebappVAADINwidgetsets -localWorkers 8 -failOnError -compileReport -XfragmentCount -1 -sourceLevel auto -extra C:UsersMichuSWZTZportaltargetextra -gen C:UsersMichuSWZTZportaltarget.generated non-existing-module
[ERROR] ]] failed with status 1
[ERROR] -> [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

这是我的绒球.xml:

<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>pl.swztz</groupId>
<artifactId>portal</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>portal</name>
<description>Portal SWZTZ</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<vaadin.version>8.2.0</vaadin.version>
</properties>
<repositories>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.vaadin.addon</groupId>
<artifactId>confirmdialog</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.vaadin.blackbluegl</groupId>
<artifactId>calendar-component</artifactId>
<version>2.0-BETA3</version>
</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-themes</artifactId>
<version>${vaadin.version}</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-bom</artifactId>
<version>${vaadin.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<finalName>PortalSWZTZ</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<filesets>
<fileset>
<directory>src/main/webapp/VAADIN/widgetsets</directory>
</fileset>
<fileset>
<directory>src/main/webapp/VAADIN/gwt-unitCache</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.version}</version>
<configuration>
<webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets</webappDirectory>
<hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets</hostedWebapp>
<noServer>true</noServer>
<draftCompile>false</draftCompile>
<style>OBF</style>
<strict>true</strict>
<compileReport>true</compileReport>
<runTarget>http://localhost:8080/</runTarget>
<modules>
<module>non-existing-module</module>
</modules>
</configuration>
<executions>
<execution>
<configuration>
<skipTests>${skipTests}</skipTests>
</configuration>
<goals>
<goal>resources</goal>
<goal>update-widgetset</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

好的,它正在工作! 我将pom中的"non-existing-module"更改为"MyWidgetset.Widgetset.gwt.xml",然后将注释@Widgetset("MyWidgetset.Widgetset.gwt.xml")添加到UI类中。

最新更新