Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#error 怀疑${AnsiColor.BLACK}导致报错 #110

Open
PerCheung opened this issue Aug 3, 2023 · 0 comments
Open

#error 怀疑${AnsiColor.BLACK}导致报错 #110

PerCheung opened this issue Aug 3, 2023 · 0 comments

Comments

@PerCheung
Copy link

模板文件如下

##设置回调
$!callback.setFileName($tool.append("banner.txt"))
$!callback.setSavePath($tool.append($modulePath, "/src/main/resources"))${AnsiStyle.BOLD}${AnsiColor.BRIGHT_RED} ______             ______ _
${AnsiColor.BRIGHT_RED}(_____ \           / _____) |
${AnsiColor.BRIGHT_YELLOW} _____) )___  ____| /     | | _   ____ _   _ ____   ____
${AnsiColor.BRIGHT_GREEN}|  ____/ _  )/ ___) |     | || \ / _  ) | | |  _ \ / _  |
${AnsiColor.BRIGHT_CYAN}| |   ( (/ /| |   | \_____| | | ( (/ /| |_| | | | ( ( | |
${AnsiColor.BRIGHT_MAGENTA}|_|    \____)_|    \______)_| |_|\____)\____|_| |_|\_|| |
${AnsiColor.BRIGHT_MAGENTA}                                                  (_____|
SPRING BOOT VERSION: ${spring-boot.version}${AnsiColor.BLACK}${AnsiStyle.NORMAL}

报错如下

在生成代码时,模板发生了如下语法错误:
        org.apache.velocity.exception.ParseErrorException:Encountered"-boot.version}"at Velocity Code Generate[line 10,column 30]
        Was expecting one of:
        "["...
        "|"...
        "}"...
        "}"...

        at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1437)
        at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1395)
        at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:213)
        at com.sjhy.plugin.tool.VelocityUtils.generate(VelocityUtils.java:58)
        at com.sjhy.plugin.service.impl.CodeGenerateServiceImpl.generate(CodeGenerateServiceImpl.java:152)
        at com.sjhy.plugin.service.impl.CodeGenerateServiceImpl.generate(CodeGenerateServiceImpl.java:101)
        at com.sjhy.plugin.ui.SelectSavePath.onOK(SelectSavePath.java:294)
        at com.sjhy.plugin.ui.SelectSavePath.doOKAction(SelectSavePath.java:248)
        at com.intellij.openapi.ui.DialogWrapper$OkAction.doAction(DialogWrapper.java:1864)
        at com.intellij.openapi.ui.DialogWrapper$DialogWrapperAction.actionPerformed(DialogWrapper.java:1818)
        at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
        at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313)
        at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
        at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
        at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
        at java.desktop/java.awt.Component.processMouseEvent(Component.java:6657)
        at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3385)
        at java.desktop/java.awt.Component.processEvent(Component.java:6422)
        at java.desktop/java.awt.Container.processEvent(Container.java:2266)
        at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
        at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4954)
        at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4581)
        at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4522)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
        at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2808)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:791)
        at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:740)
        at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:734)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:764)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:762)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:761)
        at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:685)
        at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.kt:633)
        at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:588)
        at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:67)
        at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:369)
        at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:368)
        at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
        at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:368)
        at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:363)
        at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:992)
        at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
        at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:992)
        at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:363)
        at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861)
        at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:405)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:121)
        at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:191)
        at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:236)
        at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:234)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
        at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:234)
        at java.desktop/java.awt.Dialog.lambda$show$2(Dialog.java:1081)
        at java.desktop/sun.awt.SunToolkit.performOnMainThreadIfNeeded(SunToolkit.java:2164)
        at java.desktop/java.awt.Dialog.show(Dialog.java:1041)
        at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:743)
        at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:468)
        at com.intellij.openapi.ui.DialogWrapper.doShow(DialogWrapper.java:1685)
        at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1643)
        at com.sjhy.plugin.actions.MainAction.actionPerformed(MainAction.java:68)
        at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.java:339)
        at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAwareWithCallbacks$4(ActionUtil.java:313)
        at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:362)
        at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:313)
        at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$performAction$5(ActionMenuItem.java:300)
        at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:226)
        at com.intellij.openapi.actionSystem.impl.ActionMenuItem.performAction(ActionMenuItem.java:293)
        at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$new$0(ActionMenuItem.java:68)
        at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
        at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$4(ActionMenuItem.java:115)
        at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
        at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94)
        at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:115)
        at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:526)
        at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:558)
        at java.desktop/java.awt.Component.processMouseEvent(Component.java:6657)
        at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3385)
        at java.desktop/java.awt.Component.processEvent(Component.java:6422)
        at java.desktop/java.awt.Container.processEvent(Container.java:2266)
        at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
        at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4954)
        at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4581)
        at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4522)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
        at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2808)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:791)
        at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:740)
        at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:734)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:764)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:762)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:761)
        at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:685)
        at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.kt:633)
        at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:588)
        at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:67)
        at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:369)
        at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:368)
        at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
        at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:368)
        at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:363)
        at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:992)
        at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113)
        at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:992)
        at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:363)
        at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861)
        at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:405)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant