作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如何在 2.7 中生成 GWT Soyc 报告?
使用以下 archetype 命令创建的 GWT 2.7 maven 项目。
mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.7.0
我正在尝试为其生成 soyc 报告。我尝试了两种方法,但都无法创建 soyc 报告。这个功能是不是被放弃了。
方法 1 - 我尝试在 pom.xml 中使用配置参数
<compilerMetrics>true</compilerMetrics>
<compileReport>true</compileReport>
<detailedSoyc>true</detailedSoyc>
方法 2 - 我尝试过使用 mvn 命令行参数
mvn -Dgwt.compiler.soycDetailed=true clean install
但是,构建通过,没有创建 soyc,但出现以下异常
[INFO] Compiling module com.appbootup.explore.gwt.HelloGWTApp
[INFO] Compiling 5 permutations
[INFO] Compiling permutation 0...
[INFO] Process output
[INFO] Compiling
[INFO] Compiling permutation 1...
[INFO] Process output
[INFO] Compiling
[INFO] Compiling permutation 4...
[INFO] Process output
[INFO] Compiling
[INFO] Compiling permutation 2...
[INFO] Process output
[INFO] Compiling
[INFO] Compiling permutation 3...
[INFO] Creating Stories file for the compile report
[INFO] [ERROR] Could not write dependency file.
[INFO] java.util.EmptyStackException
[INFO] at java.util.Stack.peek(Stack.java:102)
[INFO] at com.google.gwt.core.ext.soyc.impl.StoryRecorder.analyzeFragment(StoryRecorder.java:179)
[INFO] at com.google.gwt.core.ext.soyc.impl.StoryRecorder.recordStoriesImpl(StoryRecorder.java:132)
[INFO] at com.google.gwt.core.ext.soyc.impl.StoryRecorder.recordStories(StoryRecorder.java:73)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.makeSoycArtifacts(JavaToJavaScriptCompiler.java:619)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.addSoycArtifacts(JavaToJavaScriptCompiler.java:479)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.addSyntheticArtifacts(JavaToJavaScriptCompiler.java:501)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.compilePermutation(JavaToJavaScriptCompiler.java:357)
[INFO] at com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.compilePermutation(MonolithicJavaToJavaScriptCompiler.java:296)
[INFO] at com.google.gwt.dev.jjs.UnifiedAst.compilePermutation(UnifiedAst.java:143)
[INFO] at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:197)
[INFO] at com.google.gwt.dev.ThreadedPermutationWorkerFactory$ThreadedPermutationWorker.compile(ThreadedPermutationWorkerFactory.java:50)
[INFO] at com.google.gwt.dev.PermutationWorkerFactory$Manager$WorkerThread.run(PermutationWorkerFactory.java:74)
[INFO] at java.lang.Thread.run(Thread.java:745)
[INFO] Creating Stories file for the compile report
[INFO] [ERROR] Could not write dependency file.
[INFO] java.util.EmptyStackException
[INFO] at java.util.Stack.peek(Stack.java:102)
[INFO] at com.google.gwt.core.ext.soyc.impl.StoryRecorder.analyzeFragment(StoryRecorder.java:179)
[INFO] at com.google.gwt.core.ext.soyc.impl.StoryRecorder.recordStoriesImpl(StoryRecorder.java:132)
[INFO] at com.google.gwt.core.ext.soyc.impl.StoryRecorder.recordStories(StoryRecorder.java:73)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.makeSoycArtifacts(JavaToJavaScriptCompiler.java:619)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.addSoycArtifacts(JavaToJavaScriptCompiler.java:479)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.addSyntheticArtifacts(JavaToJavaScriptCompiler.java:501)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.compilePermutation(JavaToJavaScriptCompiler.java:357)
[INFO] at com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.compilePermutation(MonolithicJavaToJavaScriptCompiler.java:296)
[INFO] at com.google.gwt.dev.jjs.UnifiedAst.compilePermutation(UnifiedAst.java:143)
[INFO] at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:197)
[INFO] at com.google.gwt.dev.CompilePermsServer.compilePermutation(CompilePermsServer.java:319)
[INFO] at com.google.gwt.dev.CompilePermsServer.run(CompilePermsServer.java:283)
[INFO] at com.google.gwt.dev.CompilePermsServer.main(CompilePermsServer.java:246)
[INFO] Creating Stories file for the compile report
[INFO] [ERROR] Could not write dependency file.
[INFO] java.util.EmptyStackException
[INFO] at java.util.Stack.peek(Stack.java:102)
[INFO] at com.google.gwt.core.ext.soyc.impl.StoryRecorder.analyzeFragment(StoryRecorder.java:179)
[INFO] at com.google.gwt.core.ext.soyc.impl.StoryRecorder.recordStoriesImpl(StoryRecorder.java:132)
[INFO] at com.google.gwt.core.ext.soyc.impl.StoryRecorder.recordStories(StoryRecorder.java:73)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.makeSoycArtifacts(JavaToJavaScriptCompiler.java:619)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.addSoycArtifacts(JavaToJavaScriptCompiler.java:479)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.addSyntheticArtifacts(JavaToJavaScriptCompiler.java:501)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.compilePermutation(JavaToJavaScriptCompiler.java:357)
[INFO] at com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.compilePermutation(MonolithicJavaToJavaScriptCompiler.java:296)
[INFO] at com.google.gwt.dev.jjs.UnifiedAst.compilePermutation(UnifiedAst.java:143)
[INFO] at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:197)
[INFO] at com.google.gwt.dev.CompilePermsServer.compilePermutation(CompilePermsServer.java:319)
[INFO] at com.google.gwt.dev.CompilePermsServer.run(CompilePermsServer.java:283)
[INFO] at com.google.gwt.dev.CompilePermsServer.main(CompilePermsServer.java:246)
[INFO] Creating Stories file for the compile report
[INFO] [ERROR] Could not write dependency file.
[INFO] java.util.EmptyStackException
[INFO] at java.util.Stack.peek(Stack.java:102)
[INFO] at com.google.gwt.core.ext.soyc.impl.StoryRecorder.analyzeFragment(StoryRecorder.java:179)
[INFO] at com.google.gwt.core.ext.soyc.impl.StoryRecorder.recordStoriesImpl(StoryRecorder.java:132)
[INFO] at com.google.gwt.core.ext.soyc.impl.StoryRecorder.recordStories(StoryRecorder.java:73)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.makeSoycArtifacts(JavaToJavaScriptCompiler.java:619)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.addSoycArtifacts(JavaToJavaScriptCompiler.java:479)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.addSyntheticArtifacts(JavaToJavaScriptCompiler.java:501)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.compilePermutation(JavaToJavaScriptCompiler.java:357)
[INFO] at com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.compilePermutation(MonolithicJavaToJavaScriptCompiler.java:296)
[INFO] at com.google.gwt.dev.jjs.UnifiedAst.compilePermutation(UnifiedAst.java:143)
[INFO] at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:197)
[INFO] at com.google.gwt.dev.CompilePermsServer.compilePermutation(CompilePermsServer.java:319)
[INFO] at com.google.gwt.dev.CompilePermsServer.run(CompilePermsServer.java:283)
[INFO] at com.google.gwt.dev.CompilePermsServer.main(CompilePermsServer.java:246)
[INFO] Creating Stories file for the compile report
[INFO] [ERROR] Could not write dependency file.
[INFO] java.util.EmptyStackException
[INFO] at java.util.Stack.peek(Stack.java:102)
[INFO] at com.google.gwt.core.ext.soyc.impl.StoryRecorder.analyzeFragment(StoryRecorder.java:179)
[INFO] at com.google.gwt.core.ext.soyc.impl.StoryRecorder.recordStoriesImpl(StoryRecorder.java:132)
[INFO] at com.google.gwt.core.ext.soyc.impl.StoryRecorder.recordStories(StoryRecorder.java:73)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.makeSoycArtifacts(JavaToJavaScriptCompiler.java:619)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.addSoycArtifacts(JavaToJavaScriptCompiler.java:479)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.addSyntheticArtifacts(JavaToJavaScriptCompiler.java:501)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.compilePermutation(JavaToJavaScriptCompiler.java:357)
[INFO] at com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.compilePermutation(MonolithicJavaToJavaScriptCompiler.java:296)
[INFO] at com.google.gwt.dev.jjs.UnifiedAst.compilePermutation(UnifiedAst.java:143)
[INFO] at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:197)
[INFO] at com.google.gwt.dev.CompilePermsServer.compilePermutation(CompilePermsServer.java:319)
[INFO] at com.google.gwt.dev.CompilePermsServer.run(CompilePermsServer.java:283)
[INFO] at com.google.gwt.dev.CompilePermsServer.main(CompilePermsServer.java:246)
[INFO] Compile of permutations succeeded
[INFO] Compilation succeeded -- 14.936s
[INFO] Linking into D:\workspace\GWork\hello-gwt-app\target\hello-gwt-app-1.0-SNAPSHOT\HelloGWTApp; Writing extras to D:\workspace\GWork\hello-gwt-app\target\extra\HelloGWTApp
[INFO] Link succeeded
[INFO] Linking succeeded -- 0.873s
最佳答案
尝试删除详细的 Soyc 参数。我也遇到了这个问题;我生成 SOYC 没有问题,然后它开始失败,所以我调整了我的设置,直到我恢复了 SOYC。启用 json soyc 并禁用详细 Soyc 后,我仍然可以获得大量详细信息,显示我的编译大小来自何处。
这是我目前正在使用的:
-XjsInteropMode JS -XmethodNameDisplayMode NONE -Xnamespace NONE
-style OBFUSCATED -sourceLevel 1.8 -compileReport -XnocompilerMetrics
-XnocheckCasts -XnoclassMetadata -XclusterFunctions -XinlineLiteralParameters
-XoptimizeDataflow -noincrementalCompileWarnings -XenableJsonSoyc
-nooverlappingSourceWarnings -saveSource -soycReport -XnodetailedSoyc
-optimize 9 -setProperty compiler.stackMode=strip net.wetheinter.webcomponent.GwtcTest
请注意任何其他偶然发现此问题的人,我在 EmptyStackException 上设置了一个 java 异常断点,并发现空堆栈似乎发生在 LongLibBase 周围。这可能是一个编译器错误,因为这是一个内部类,通常与其他类的处理方式不同。
关于gwt-2.7 - GWT 2.7 SOYC 的 Maven 编译失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27897770/
如何在 2.7 中生成 GWT Soyc 报告? 使用以下 archetype 命令创建的 GWT 2.7 maven 项目。 mvn archetype:generate -DarchetypeGr
我是一名优秀的程序员,十分优秀!