我在使gwt-maven-plugin运行时遇到问题,如文档所述。 使用GWT 2.8.2 使用InteliJ 2018 从2.8.2 webAppCreator生成的示例项目开始,模板为maven,sample,readme。
该基本项目的包装准备就绪
<!-- POM file generated with GWT webAppCreator -->
<modelVersion>4.0.0</modelVersion>
<groupId>org.gwtproject.tutorial</groupId>
<artifactId>TodoList</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>org.gwtproject.tutorial.TodoList</name>
The gwt-maven-plugin is set to 1.0-rc-8
<!-- GWT Maven Plugin-->
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.0-rc-8</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<moduleName>org.gwtproject.tutorial.TodoList</moduleName>
<moduleShortName>TodoList</moduleShortName>
<failOnError>true</failOnError>
<!-- GWT compiler 2.8 requires 1.8, hence define sourceLevel here if you use
a different source language for java compilation -->
<sourceLevel>1.8</sourceLevel>
<!-- Compiler configuration -->
<compilerArgs>
<!-- Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile) -->
<arg>-compileReport</arg>
<arg>-XcompilerMetrics</arg>
</compilerArgs>
<!-- DevMode configuration -->
<warDir>${project.build.directory}/${project.build.finalName}</warDir>
<classpathScope>compile+runtime</classpathScope>
<!-- URL(s) that should be opened by DevMode (gwt:devmode). -->
<startupUrls>
<startupUrl>TodoList.html</startupUrl>
</startupUrls>
</configuration>
</plugin>
这时我可以在DEV模式下运行。一旦我将包装更改为gwt-app(根据插件的文档https://tbroyer.github.io/gwt-maven-plugin/usage.html),它就会失败。
[ERROR] Unknown packaging: gwt-app @ line 9, column 14
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.gwtproject.tutorial:TodoList:1.0-SNAPSHOT (D:\ToDoList\pom.xml) has 1 error
[ERROR] Unknown packaging: gwt-app @ line 9, column 14
[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]
对这个问题有任何想法吗?
谢谢
答案 0 :(得分:1)
您可能在插件中缺少private void DoThings(string appKey, string appSecret, string accessToken,string refreshToken)
{
var config = new BoxConfig(appKey, appSecret, new Uri("http://localhost"));
var session = new OAuthSession(accessToken, refreshToken, 3600, "bearer");
var boxClient = new BoxClient(config, session);
boxClient.Auth.SessionAuthenticated += Auth_SessionAuthenticated;
boxClient.Auth.SessionInvalidated += Auth_SessionInvalidated;
var root = client.FoldersManager.GetInformationAsync("0").Result;
//Do things here
}
void Auth_SessionInvalidated(object sender, EventArgs e)
{
//do nothing
}
void Auth_SessionAuthenticated(object sender, SessionAuthenticatedEventArgs e)
{
// Updates the DB Store with the new token values e.Session.AccessToken, e.Session.RefreshToken
}
。
请注意,<extensions>true</extensions>
只是客户端代码,根本没有服务器端。我建议以https://github.com/tbroyer/gwt-maven-archetypes代替webAppCreator作为起点。模块化的webapp原型在功能上与由webAppCreator生成的示例项目相同,但采用的是面向Maven的设置。