Компиляция Maven для GWT 2.7 SOYC не работает

Как мне сгенерировать отчет GWT Soyc в 2.7?

Проект GWT 2.7 maven создан с использованием следующей команды archetype.

mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.7.0

Я пытаюсь сгенерировать соевый отчет. Я попробовал 2 подхода, и оба не в состоянии создать отчет о сои. Отказалась ли эта функция?

Подход 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

1 ответ

Решение

Попробуйте удалить подробный параметр 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

Примечание для всех, кто сталкивается с этим, я установил точку останова java-исключения для EmptyStackException и обнаружил, что пустой стек, кажется, происходит вокруг LongLibBase. Это может быть ошибкой компилятора, поскольку это внутренний класс, который обычно обрабатывается иначе, чем другие классы.

Другие вопросы по тегам