I am trying to set up command line code inspection with IntelliJ Idea, but the program seems to crash. The project builds with Gradle.
I get the following errors (full stack trace below)
2022-11-11 09:17:13,214 [ 15890] SEVERE - #o.j.p.g.GradleCommandLineProjectConfigurator - Gradle resolve failure <unnamed>:0
com.intellij.openapi.externalSystem.model.ExternalSystemException: The project directory does not exist!
It is not clear which directory it is trying to access, and I have not been able to reproduce this error by calling Gradle directly. This error also appears when I run Idea graphically, and it seems to work just fine so it might be a red herring. But in that case I have no idea what's wrong.
Any help pointing me in the right direction would be very welcome!
build.gradle:
plugins {
id 'application'
id 'java-library'
}
repositories {
maven {
url '/opt/java-deps'
}
}
dependencies {
implementation 'org.apache.commons:commons-csv:1.8'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'org.junit.jupiter:junit-jupiter:5.7.2'
}
sourceSets {
main {
java {
srcDirs = ['src', 'generated']
}
resources {
srcDirs = ['src']
}
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Werror" << "-Xlint:all"
}
tasks.withType(Javadoc) {
options {
showAll()
// https://github.com/gradle/gradle/issues/2354
addStringOption("Xwerror", "-quiet")
}
}
}
test {
useJUnitPlatform()
}
application {
mainClass = 'tests.Main'
}
settings.gradle:
rootProject.name = 'vt'
Stack trace (some of the stack traces are trimmed due to post size limits):
vkl#debian:~/*$ idea inspect . .idea/inspections/Project_Default.xml inspection
2022-11-11 09:16:59,517 [ 2193] WARN - #c.i.n.i.NotificationGroupManagerImpl - Notification group CodeWithMe is already registered (group=com.intellij.notification.NotificationGroup#52ca8e3). Plugin descriptor: PluginDescriptor(name=Code With Me, id=com.jetbrains.codeWithMe, descriptorPath=plugin.xml, path=/opt/intellij_idea/plugins/cwm-plugin, version=221.5591.52, package=null, isBundled=true)
Info | RdCoroutineScope | 10:JobScheduler FJ pool 0/4 | RdCoroutineHost overridden
2022-11-11 09:17:09,115 [ 11791] SEVERE - #c.i.o.a.i.FlushQueue - null
java.awt.HeadlessException
at java.desktop/javax.swing.JTree.checkDragEnabled(JTree.java:1222)
at java.desktop/javax.swing.JTree.setDragEnabled(JTree.java:1216)
at com.intellij.openapi.vcs.changes.ui.ChangesListView.<init>(ChangesListView.java:59)
at com.intellij.openapi.vcs.changes.ChangesViewPanel$MyChangesListView.<init>(ChangesViewPanel.kt:89)
at com.intellij.openapi.vcs.changes.ChangesViewPanel.<init>(ChangesViewPanel.kt:30)
at com.intellij.openapi.vcs.changes.ChangesViewManager$ChangesViewToolWindowPanel.<init>(ChangesViewManager.java:353)
at com.intellij.openapi.vcs.changes.ChangesViewManager.initToolWindowPanel(ChangesViewManager.java:179)
at com.intellij.openapi.vcs.changes.ChangesViewManager.updateCommitWorkflow(ChangesViewManager.java:272)
at com.intellij.openapi.vcs.changes.ChangesViewManager.lambda$new$0(ChangesViewManager.java:117)
at com.intellij.util.messages.impl.MessageBusImpl.invokeMethod(MessageBusImpl.java:639)
at com.intellij.util.messages.impl.MessageBusImpl.invokeListener(MessageBusImpl.java:621)
at com.intellij.util.messages.impl.MessageBusImpl.access$300(MessageBusImpl.java:34)
at com.intellij.util.messages.impl.MessageBusImpl$MessagePublisher.executeOrAddToQueue(MessageBusImpl.java:209)
at com.intellij.openapi.application.impl.BaseExpirableExecutorMixinImpl.access$scheduleWithinConstraints$s1153900543(BaseExpirableExecutorMixinImpl.kt:12)
at com.intellij.openapi.application.impl.BaseExpirableExecutorMixinImpl$scheduleWithinConstraints$$inlined$Runnable$1.run(Runnable.kt:19)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:215)
at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:22)
at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:197)
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)
2022-11-11 09:17:09,137 [ 11813] SEVERE - #c.i.o.a.i.FlushQueue - IntelliJ IDEA 2022.1.1 Build #IC-221.5591.52
2022-11-11 09:17:09,139 [ 11815] SEVERE - #c.i.o.a.i.FlushQueue - JDK: 11.0.14.1; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2022-11-11 09:17:09,141 [ 11817] SEVERE - #c.i.o.a.i.FlushQueue - OS: Linux
2022-11-11 09:17:09,671 [ 12347] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,675 [ 12351] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,676 [ 12352] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,677 [ 12353] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,679 [ 12355] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,680 [ 12356] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,682 [ 12358] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,685 [ 12361] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,700 [ 12376] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored file under another root: *; root: /src; mapped root: null
2022-11-11 09:17:09,719 [ 12395] WARN - #g.r.GitUntrackedFilesHolder - Ignoring ignored files under another root: 48 files total
2022-11-11 09:17:12,825 [ 15501] WARN - #c.a.t.i.g.p.s.i.SyncIssueUsageReporterImpl - Multiple sync failures reported. Discarding: SDK_BUILD_TOOLS_TOO_LOW
2022-11-11 09:17:13,214 [ 15890] SEVERE - #o.j.p.g.GradleCommandLineProjectConfigurator - Gradle resolve failure <unnamed>:0
com.intellij.openapi.externalSystem.model.ExternalSystemException: The project directory does not exist!
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionErrorHandler.createUserFriendlyError(GradleExecutionErrorHandler.java:197)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectImportErrorHandler.createUserFriendlyError(AbstractProjectImportErrorHandler.java:46)
at org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.doGetUserFriendlyError(BaseProjectImportErrorHandler.java:167)
at org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.getUserFriendlyError(BaseProjectImportErrorHandler.java:48)
at org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.checkErrorsWithoutQuickFixes(BaseProjectImportErrorHandler.java:62)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$1.getUserFriendlyError(GradleProjectResolver.java:877)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:806)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:775)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.lambda$execute$0(GradleExecutionHelper.java:138)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.maybeFixSystemProperties(GradleExecutionHelper.java:165)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.lambda$execute$1(GradleExecutionHelper.java:138)
at org.jetbrains.plugins.gradle.GradleConnectorService$Companion.withGradleConnection(GradleConnectorService.kt:181)
at org.jetbrains.plugins.gradle.GradleConnectorService.withGradleConnection(GradleConnectorService.kt)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:130)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:154)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:74)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.lambda$resolveProjectInfo$0(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:43)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:36)
at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:48)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:115)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:151)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:135)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.executeImpl(ExternalSystemUtil.java:491)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.lambda$execute$0(ExternalSystemUtil.java:327)
at com.intellij.openapi.project.DumbServiceHeavyActivities.suspendIndexingAndRun(DumbServiceHeavyActivities.java:21)
at com.intellij.openapi.project.DumbServiceImpl.suspendIndexingAndRun(DumbServiceImpl.java:190)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.execute(ExternalSystemUtil.java:327)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4.run(ExternalSystemUtil.java:614)
at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:442)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressInCurrentThread$10(CoreProgressManager.java:561)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressInCurrentThread(CoreProgressManager.java:561)
at com.intellij.openapi.progress.impl.CoreProgressManager.run(CoreProgressManager.java:381)
at com.intellij.openapi.progress.Task.queue(Task.java:119)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil.refreshProject(ExternalSystemUtil.java:616)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil.refreshProject(ExternalSystemUtil.java:282)
at com.intellij.openapi.externalSystem.service.project.autoimport.ProjectAware.reloadProject(ProjectAware.kt:62)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.reloadProject(AutoImportProjectTracker.kt:141)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.access$reloadProject(AutoImportProjectTracker.kt:33)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$scheduleProjectRefresh$1.invoke(AutoImportProjectTracker.kt:76)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$scheduleProjectRefresh$1.invoke(AutoImportProjectTracker.kt:33)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$schedule$1.invoke(AutoImportProjectTracker.kt:103)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$schedule$1.invoke(AutoImportProjectTracker.kt:33)
at com.intellij.openapi.externalSystem.autoimport.update.PriorityEatUpdate$Companion$invoke$1.run(PriorityEatUpdate.kt:15)
at com.intellij.util.ui.update.MergingUpdateQueue.queue(MergingUpdateQueue.java:347)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.schedule(AutoImportProjectTracker.kt:98)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.scheduleProjectRefresh(AutoImportProjectTracker.kt:76)
at org.jetbrains.plugins.gradle.GradleCommandLineProjectConfigurator.importProjects(GradleCommandLineProjectConfigurator.kt:95)
at org.jetbrains.plugins.gradle.GradleCommandLineProjectConfigurator.configureProject(GradleCommandLineProjectConfigurator.kt:75)
at com.intellij.codeInspection.InspectionApplicationBase.configureProject(InspectionApplicationBase.java:462)
at com.intellij.codeInspection.InspectionApplicationBase.lambda$runUnderProgress$22(InspectionApplicationBase.java:698)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176)
at com.intellij.codeInspection.InspectionApplicationBase.runUnderProgress(InspectionApplicationBase.java:697)
at com.intellij.codeInspection.InspectionApplicationBase.runAnalysis(InspectionApplicationBase.java:492)
at com.intellij.codeInspection.InspectionApplicationBase.runAnalysisOnScope(InspectionApplicationBase.java:449)
at ...
2022-11-11 09:17:13,227 [ 15903] SEVERE - #o.j.p.g.GradleCommandLineProjectConfigurator - IntelliJ IDEA 2022.1.1 Build #IC-221.5591.52
2022-11-11 09:17:13,228 [ 15904] SEVERE - #o.j.p.g.GradleCommandLineProjectConfigurator - JDK: 11.0.14.1; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2022-11-11 09:17:13,229 [ 15905] SEVERE - #o.j.p.g.GradleCommandLineProjectConfigurator - OS: Linux
2022-11-11 09:17:13,266 [ 15942] WARN - #c.a.t.i.g.p.s.GradleSyncState - Gradle sync failed in 2 s 236 ms. The project directory does not exist!
2022-11-11 09:17:15,351 [ 18027] SEVERE - #c.i.c.InspectionApplicationBase - java.lang.IllegalStateException: Gradle project <unnamed>:0 resolve failed.
java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Gradle project <unnamed>:0 resolve failed.
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
at org.jetbrains.plugins.gradle.GradleCommandLineProjectConfigurator$StateNotificationListener.waitForImportEnd(GradleCommandLineProjectConfigurator.kt:196)
at org.jetbrains.plugins.gradle.GradleCommandLineProjectConfigurator.configureProject(GradleCommandLineProjectConfigurator.kt:76)
at com.intellij.codeInspection.InspectionApplicationBase.configureProject(InspectionApplicationBase.java:462)
at com.intellij.codeInspection.InspectionApplicationBase.lambda$runUnderProgress$22(InspectionApplicationBase.java:698)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176)
at com.intellij.codeInspection.InspectionApplicationBase.runUnderProgress(InspectionApplicationBase.java:697)
at com.intellij.codeInspection.InspectionApplicationBase.runAnalysis(InspectionApplicationBase.java:492)
at com.intellij.codeInspection.InspectionApplicationBase.runAnalysisOnScope(InspectionApplicationBase.java:449)
at com.intellij.codeInspection.InspectionApplicationBase.run(InspectionApplicationBase.java:221)
at com.intellij.codeInspection.InspectionApplicationBase.execute(InspectionApplicationBase.java:159)
at com.intellij.codeInspection.InspectionApplicationBase.startup(InspectionApplicationBase.java:123)
at com.intellij.codeInspection.InspectionMain.main(InspectionMain.java:115)
at com.intellij.openapi.application.ApplicationStarter.main(ApplicationStarter.java:52)
at com.intellij.idea.ApplicationLoader$initApplication$4.accept(ApplicationLoader.kt:176)
at com.intellij.idea.ApplicationLoader$initApplication$4.accept(ApplicationLoader.kt)
at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1742)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1728)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: java.lang.IllegalStateException: Gradle project <unnamed>:0 resolve failed.
at org.jetbrains.plugins.gradle.GradleCommandLineProjectConfigurator$StateNotificationListener.onFailure(GradleCommandLineProjectConfigurator.kt:179)
at com.intellij.openapi.externalSystem.service.remote.ExternalSystemProgressNotificationManagerImpl$TaskListenerWrapper.onFailure(ExternalSystemProgressNotificationManagerImpl.kt:106)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.intellij.util.EventDispatcher.dispatchVoidMethod(EventDispatcher.java:120)
at com.intellij.util.EventDispatcher.lambda$createMulticaster$1(EventDispatcher.java:85)
at com.sun.proxy.$Proxy120.onFailure(Unknown Source)
at com.intellij.openapi.externalSystem.service.remote.ExternalSystemProgressNotificationManagerImpl$onFailure$1.invoke(ExternalSystemProgressNotificationManagerImpl.kt:65)
at com.intellij.openapi.externalSystem.service.remote.ExternalSystemProgressNotificationManagerImpl$onFailure$1.invoke(ExternalSystemProgressNotificationManagerImpl.kt:17)
at com.intellij.openapi.externalSystem.service.remote.ExternalSystemProgressNotificationManagerImpl.forEachListener(ExternalSystemProgressNotificationManagerImpl.kt:90)
at com.intellij.openapi.externalSystem.service.remote.ExternalSystemProgressNotificationManagerImpl.onFailure(ExternalSystemProgressNotificationManagerImpl.kt:65)
at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:56)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:115)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:151)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:135)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.executeImpl(ExternalSystemUtil.java:491)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.lambda$execute$0(ExternalSystemUtil.java:327)
at com.intellij.openapi.project.DumbServiceHeavyActivities.suspendIndexingAndRun(DumbServiceHeavyActivities.java:21)
at com.intellij.openapi.project.DumbServiceImpl.suspendIndexingAndRun(DumbServiceImpl.java:190)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.execute(ExternalSystemUtil.java:327)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4.run(ExternalSystemUtil.java:614)
at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:442)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressInCurrentThread$10(CoreProgressManager.java:561)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressInCurrentThread(CoreProgressManager.java:561)
at com.intellij.openapi.progress.impl.CoreProgressManager.run(CoreProgressManager.java:381)
at com.intellij.openapi.progress.Task.queue(Task.java:119)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil.refreshProject(ExternalSystemUtil.java:616)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil.refreshProject(ExternalSystemUtil.java:282)
at com.intellij.openapi.externalSystem.service.project.autoimport.ProjectAware.reloadProject(ProjectAware.kt:62)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.reloadProject(AutoImportProjectTracker.kt:141)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.access$reloadProject(AutoImportProjectTracker.kt:33)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$scheduleProjectRefresh$1.invoke(AutoImportProjectTracker.kt:76)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$scheduleProjectRefresh$1.invoke(AutoImportProjectTracker.kt:33)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$schedule$1.invoke(AutoImportProjectTracker.kt:103)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker$schedule$1.invoke(AutoImportProjectTracker.kt:33)
at com.intellij.openapi.externalSystem.autoimport.update.PriorityEatUpdate$Companion$invoke$1.run(PriorityEatUpdate.kt:15)
at com.intellij.util.ui.update.MergingUpdateQueue.queue(MergingUpdateQueue.java:347)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.schedule(AutoImportProjectTracker.kt:98)
at com.intellij.openapi.externalSystem.autoimport.AutoImportProjectTracker.scheduleProjectRefresh(AutoImportProjectTracker.kt:76)
at org.jetbrains.plugins.gradle.GradleCommandLineProjectConfigurator.importProjects(GradleCommandLineProjectConfigurator.kt:95)
at org.jetbrains.plugins.gradle.GradleCommandLineProjectConfigurator.configureProject(GradleCommandLineProjectConfigurator.kt:75)
... 28 more
Caused by: com.intellij.openapi.externalSystem.model.ExternalSystemException: The project directory does not exist!
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionErrorHandler.createUserFriendlyError(GradleExecutionErrorHandler.java:197)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectImportErrorHandler.createUserFriendlyError(AbstractProjectImportErrorHandler.java:46)
at org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.doGetUserFriendlyError(BaseProjectImportErrorHandler.java:167)
at org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.getUserFriendlyError(BaseProjectImportErrorHandler.java:48)
at org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.checkErrorsWithoutQuickFixes(BaseProjectImportErrorHandler.java:62)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$1.getUserFriendlyError(GradleProjectResolver.java:877)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:806)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:775)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.lambda$execute$0(GradleExecutionHelper.java:138)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.maybeFixSystemProperties(GradleExecutionHelper.java:165)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.lambda$execute$1(GradleExecutionHelper.java:138)
at org.jetbrains.plugins.gradle.GradleConnectorService$Companion.withGradleConnection(GradleConnectorService.kt:181)
at ...
2022-11-11 09:17:15,378 [ 18054] SEVERE - #c.i.c.InspectionApplicationBase - IntelliJ IDEA 2022.1.1 Build #IC-221.5591.52
2022-11-11 09:17:15,380 [ 18056] SEVERE - #c.i.c.InspectionApplicationBase - JDK: 11.0.14.1; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2022-11-11 09:17:15,382 [ 18058] SEVERE - #c.i.c.InspectionApplicationBase - OS: Linux
java.lang.IllegalStateException: Gradle project <unnamed>:0 resolve failed.
vkl#debian:~/*$ echo $?
1
vkl#debian:~/*$ ls inspection/
Related
im having some problems refreshing anything, be it #ConfigurationProperties or #Value, using the
implementation("com.azure.spring:azure-spring-cloud-appconfiguration-config:2.1.1")
library. From what i could find and debug, the inner AppConfigurationRefresh class is called and the RefreshEvent is created reacting correctly to changes done in Azure Config Server. Problem is that, when context is updated, there also should be new values recognized by the ContextRefresher, which is not the case for me.
Spring Boot ContextRefresher
public synchronized Set<String> refreshEnvironment() {
Map<String, Object> before = extract(this.context.getEnvironment().getPropertySources());
updateEnvironment();
Set<String> keys = changes(before, extract(this.context.getEnvironment().getPropertySources())).keySet();
this.context.publishEvent(new EnvironmentChangeEvent(this.context, keys));
return keys;
}
The result of that refresh method is always empty, which means no changes were found.
Logs generated by the refresh event:
2021-11-29 19:53:03.543 INFO [] 34820 --- [ task-2] c.a.s.c.config.AppConfigurationRefresh : Configuration Refresh Event triggered by /myprefix/my.config.value
2021-11-29 19:53:53.694 INFO [] 34820 --- [ task-2] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-/application/https://my-config-store-stage.azconfig.io/dev'}]
2021-11-29 19:53:53.719 INFO [] 34820 --- [ task-2] o.s.boot.SpringApplication : The following profiles are active: messaging,db,dev
2021-11-29 19:53:53.736 INFO [] 34820 --- [ task-2] o.s.boot.SpringApplication : Started application in 3.347 seconds (JVM running for 158.594)
2021-11-29 19:54:01.265 INFO [] 34820 --- [ task-2] o.s.c.e.event.RefreshEventListener : Refresh keys changed: []
2021-11-29 19:54:03.553 INFO [] 34820 --- [ scheduling-1] d.l.d.a.s.c.AppConfigurationUpdater : All configurations were refreshed.
bootstrap.yml
spring:
cloud:
azure:
appconfiguration:
stores:
- connection-string: ${connection-string}
selects:
- key-filter: '/myprefix/'
label-filter: dev
monitoring:
enabled: true
refresh-interval: 1s
triggers:
-
label: dev
key: /myprefix/my.config.value
I only noticed one thing that could be relevant to this, looking at log from start of the application (where everything is loaded properly) and at the point of refresh:
2021-11-29 19:51:31.578 INFO [] 34820 --- [ main] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-/myprefix/https://my-config-store-stage.azconfig.io/dev'}, BootstrapPropertySource {name='bootstrapProperties-/application/https://my-config-store-stage.azconfig.io/dev'}]
2021-11-29 19:53:53.694 INFO [] 34820 --- [ task-2] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-/application/https://my-config-store-stage.azconfig.io/dev'}]
It seems that when refreshing, the Spring is not able to locate all BootstrapPropertySources and maybe thats why there are no changes found. Am i missing some configuration somewhere to specify these or does anyone know whats the problem here. Thanks
The Problem
The changed values in azure appconfig store are triggering refresh event (either automaticaly using "web" version of library or through manual call to AppConfigurationRefresh.refreshConfigurations) and you can see it in the logs like this:
2021-11-29 19:53:03.543 INFO [] 34820 --- [ task-2] c.a.s.c.config.AppConfigurationRefresh : Configuration Refresh Event triggered by /myprefix/my.config.value
2021-11-29 19:53:53.694 INFO [] 34820 --- [ task-2] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-/application/https://my-config-store-stage.azconfig.io/dev'}]
2021-11-29 19:53:53.719 INFO [] 34820 --- [ task-2] o.s.boot.SpringApplication : The following profiles are active: messaging,db,dev
2021-11-29 19:53:53.736 INFO [] 34820 --- [ task-2] o.s.boot.SpringApplication : Started application in 3.347 seconds (JVM running for 158.594)
2021-11-29 19:54:01.265 INFO [] 34820 --- [ task-2] o.s.c.e.event.RefreshEventListener : Refresh keys changed: []
However the Spring Boot is unable to locate any changes in PropertySources as is evident from:
2021-11-29 19:54:01.265 INFO [] 34820 --- [ task-2] o.s.c.e.event.RefreshEventListener : Refresh keys changed: []
The Research
What actually was deciding factor for me to find the issue, was indeed the difference between the found BootstrapPropertySources at the start of the application and at the refresh.
2021-11-29 19:51:31.578 INFO [] 34820 --- [ main] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-/myprefix/https://my-config-store-stage.azconfig.io/dev'}, BootstrapPropertySource {name='bootstrapProperties-/application/https://my-config-store-stage.azconfig.io/dev'}]
2021-11-29 19:53:53.694 INFO [] 34820 --- [ task-2] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-/application/https://my-config-store-stage.azconfig.io/dev'}]
The culprit for the not found changes is indeed the missing BootstrapPropertySource at the update. From my testing its evident, that all configuration properties are dependant on the name of the PropertySource they came from and if its missing, they will retain their original old value.
The problem is in the way the appconfig library is locating/creating the BootstrapPropertySources and does not differentiate between startup and update.
The following code is from appconfiguration library and i only took the part that is causing the bug.
public final class AppConfigurationPropertySourceLocator implements PropertySourceLocator {
...
#Override
public PropertySource<?> locate(Environment environment) {
...
String applicationName = this.properties.getName();
if (!StringUtils.hasText(applicationName)) {
applicationName = env.getProperty(SPRING_APP_NAME_PROP);
}
...
}
...
}
The problem here is that env.getProperty(SPRING_APP_NAME_PROP); is filled with "spring.application.name" during startup, because spring loads all .yml files at once, but is not available during update. Also the AppConfigurationProperties properties.name is never mentioned in any documentation from azure, but is crutial to overcome this problem.
The Solution
If you are using custom spring.application.name include some name also into the bootstrap.yml like this:
spring:
cloud:
azure:
appconfiguration:
name: your-name #any value will work
stores:
- connection-string: ${connection-string}
selects:
- key-filter: '/myprefix/'
label-filter: dev
monitoring:
enabled: true
refresh-interval: 1s
triggers:
-
label: dev
key: /myprefix/my.config.value
This will make the library use the properties name value at all times and avoid usage of the problematic spring.application.name value.
You should be using "com.azure.spring:azure-spring-cloud-appconfiguration-config-web:2.1.1" if you want to enable auto refresh. Otherwise you have to manually trigger refresh using AzureCloudConfigRefresh's refreshConfiguration. See: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/appconfiguration/azure-spring-cloud-starter-appconfiguration-config#configuration-refresh
As for the ContextRefresher, is it inside of the refresh scope? If not then the values are unable to be changed.
Though looking at your logs you don't seem to be picking up the changes. Can you take a look at this demo?
https://github.com/Azure-Samples/azure-spring-boot-samples/tree/main/appconfiguration/azure-appconfiguration-refresh-sample
The instructions to run it are here https://github.com/Azure-Samples/azure-spring-boot-samples/pull/106/files
I've set up the Grunt workflow as described here:
https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/css-topics/css_debug.html
My local-themes.js looks like this:
➜ m2 git:(master) ✗ cat dev/tools/grunt/configs/local-themes.js
'use strict';
module.exports = {
ac_default: {
area: 'frontend',
name: 'Ac/Default',
locale: 'en_US',
files: [
'css/source/_extend',
],
dsl: 'less'
},
ac_retail: {
area: 'frontend',
name: 'Ac/Retail',
locale: 'en_US',
files: [
'css/source/_extend',
],
dsl: 'less'
},
ac_wholesale: {
area: 'frontend',
name: 'Ac/Wholesale',
locale: 'en_US',
files: [
'css/source/_extend',
],
dsl: 'less'
}
};
I grunt watch successfully triggers when a less file in my child theme gets changed:
➜ m2 git:(master) ✗ grunt watch:ac_retail -v
Initializing
Command-line options: --verbose, --gruntfile=/data/src/m2/Gruntfile.js
Reading "Gruntfile.js" Gruntfile...OK
Registering Gruntfile tasks.
Initializing config...OK
Loading "Gruntfile.js" tasks...OK
+ black-list-generator, clean-black-list, default, deploy, documentation, legacy-build, mage-minify, prod, refresh, spec, static
Running tasks: watch:ac_retail
Loading "grunt-contrib-watch" plugin
Registering "/data/src/m2/node_modules/grunt-contrib-watch/tasks" tasks.
Loading "watch.js" tasks...OK
+ watch
Running "watch:ac_retail" (watch) task
Waiting...
Verifying property watch exists in config...OK
Verifying property watch.ac_retail.files exists in config...OK
Live reload server started on *:35729
Watching pub/static/frontend/Ac/Retail/en_US/css/source/_extend.less for changes.
>> File "pub/static/frontend/Ac/Retail/en_US/css/source/_extend.less" changed.
Initializing
Command-line options: --verbose, --gruntfile=/data/src/m2/Gruntfile.js
Reading "Gruntfile.js" Gruntfile...OK
Registering Gruntfile tasks.
Initializing config...OK
Loading "Gruntfile.js" tasks...OK
+ black-list-generator, clean-black-list, default, deploy, documentation, legacy-build, mage-minify, prod, refresh, spec, static
Running tasks: less:ac_retail
Loading "grunt-contrib-less" plugin
Registering "/data/src/m2/node_modules/grunt-contrib-less/tasks" tasks.
Loading "less.js" tasks...OK
+ less
Running "less:ac_retail" (less) task
Verifying property less.ac_retail exists in config...OK
Files: pub/static/frontend/Ac/Retail/en_US/css/source/_extend.less -> pub/static/frontend/Ac/Retail/en_US/css/source/_extend.css
Options: banner="", sourceMap, strictImports=false, sourceMapRootpath="/", dumpLineNumbers=false, ieCompat=false
Reading pub/static/frontend/Ac/Retail/en_US/css/source/_extend.less...OK
Writing pub/static/frontend/Ac/Retail/en_US/css/source/_extend.css.map...OK
File pub/static/frontend/Ac/Retail/en_US/css/source/_extend.css.map created.
Writing pub/static/frontend/Ac/Retail/en_US/css/source/_extend.css...OK
File pub/static/frontend/Ac/Retail/en_US/css/source/_extend.css created
>> 1 stylesheet created.
>> 1 sourcemap created.
Done.
Execution Time (2019-01-16 16:13:35 UTC-8)
loading tasks 42ms ▇▇▇▇▇▇▇▇▇▇▇▇▇ 39%
loading grunt-contrib-less 34ms ▇▇▇▇▇▇▇▇▇▇ 32%
less:ac_retail 31ms ▇▇▇▇▇▇▇▇▇ 29%
Total 107ms
Live reloading pub/static/frontend/Ac/Retail/en_US/css/source/_extend.less...
Completed in 0.729s at Wed Jan 16 2019 16:13:35 GMT-0800 (Pacific Standard Time) - Waiting...
Unfortunately the styles-m.css or styles-l.css files are not updated. Therefore when I refresh the page the changes made in the less files are not reflected on the page.
I posted a ticket in the Magento bug tracker but they have not been particularly helpful.
https://github.com/magento/magento2/issues/20356
My question is. Does anyone here uses Grunt to compile less for a setup with multiple child themes?
In my case the intended theme inheritance looks like this:
ac_retail inherits from ac_default inherits from luma
ac_wholesale inherits from ac_default inherits from luma
From what I can tell the Grunt workflow is the only workflow that is actually suitable for theme development. Server and client side compilation are way too slow to use for development.
Finally figured it out. The documentation has errors. You need to specify the parent themes style files, even if your child theme has it's own root source files, if you want to re-compile styles-m.css and styles-l.css, when the child themes less files change. This local-themes.js ended up working for me:
>>'use strict';
>>module.exports = {
ac_default: {
area: 'frontend',
name: 'Ac/Default',
locale: 'en_US',
files: [
'css/styles-m',
'css/styles-l',
],
dsl: 'less'
},
ac_retail: {
area: 'frontend',
name: 'Ac/Retail',
locale: 'en_US',
files: [
'css/styles-m',
'css/styles-l',
],
dsl: 'less'
},
ac_wholesale: {
area: 'frontend',
name: 'Ac/Wholesale',
locale: 'en_US',
files: [
'css/styles-m',
'css/styles-l',
],
dsl: 'less'
}
};
adding
'css/styles-m',
'css/styles-l',
fixed it for me too. Thanks for this
ISSUE SOLVED see below for infos
after searching for a solutions for 2 days now i give up. I coudn't find a similar issue on the web and i don't know what to do.
Hope somebody can help there...
Issue
The application is building and running fine with gradlew -Pdev bootWar jibDockerBuild
However, the build won't work when selecting the prod profile:
gradlew -Pprod bootWar jibDockerBuild
Reference Exception
ERROR in Illegal State: referring to a type without a variable
{"filePath":"D:/dev/myApp/node_modules/#angular/forms/forms.d.ts",
"name":"FormGroupDirective","members":[]}
FULL EXCEPTION
The following is printed on execution:
D:\dev\myApp>gradlew -Pprod bootWar jibDockerBuild
> Task :yarn_install
yarn install v1.9.4
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents#1.2.4: The platform "win32" is incompatible with this module.
info "fsevents#1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > bootstrap#4.1.3" has unmet peer dependency "jquery#1.9.1 - 3".
warning " > bootstrap#4.1.3" has unmet peer dependency "popper.js#^1.14.3".
warning " > ngx-webstorage#2.0.1" has incorrect peer dependency "#angular/core#^5.0.0".
[5/5] Building fresh packages...
Done in 97.47s.
> Task :webpack
yarn run v1.9.4
$ yarn run cleanup && yarn run webpack:prod:main && yarn run clean-www
$ rimraf build/{aot,www}
$ yarn run webpack --config webpack/webpack.prod.js --profile
$ node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js --config webpack/webpack.prod.js --profile
(node:28256) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
Hash: 6aab3d14e434ee333c51
Version: webpack 4.8.0
Time: 8812ms
Built at: 2018-10-07 18:52:03
6 assets
Entrypoint polyfills = app/polyfills.6aab3d14e434ee333c51.bundle.js
Entrypoint global = global.1e92ecdbfdaf2bb32590.css app/global.6aab3d14e434ee333c51.bundle.js
Entrypoint main = app/main.6aab3d14e434ee333c51.bundle.js
[0] ./src/main/webapp/app/app.main.ts 0 bytes {0} [built]
factory:4638ms building:3545ms = 8183ms
[2] ./src/main/webapp/content/css/global.css 39 bytes {1} [built]
factory:4639ms building:2778ms = 7417ms
[3] ./src/main/webapp/app/polyfills.ts 0 bytes {2} [built]
factory:4638ms building:3540ms = 8178ms
+ 1 hidden module
ERROR in Illegal State: referring to a type without a variable {"filePath":"D:/dev/myApp/node_modules/#angular/forms/forms.d.ts","name":"FormGroupDirective","members":[]}
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
> Task :webpack FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':webpack'.
> Process 'command 'yarn.cmd'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.9/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1m 58s
5 actionable tasks: 3 executed, 2 up-to-date
ENVIRONMENT
Windows 10
Using JHipster version installed locally in current project's node_modules
Executing jhipster:info
Options: from-cli: true
Welcome to the JHipster Information Sub-Generator
JHipster Version(s)
myApp#0.0.0 D:\dev\myApp
`-- generator-jhipster#5.4.1
JHipster configuration, a .yo-rc.json file generated in the root folder
<details>
<summary>.yo-rc.json file</summary>
<pre>
{
"generator-jhipster": {
"promptValues": {
"packageName": "de.myApp.myApp",
"nativeLanguage": "de"
},
"jhipsterVersion": "5.4.1",
"applicationType": "monolith",
"baseName": "myApp",
"packageName": "de.myApp.myApp",
"packageFolder": "de/myApp/myApp",
"serverPort": "8080",
"authenticationType": "session",
"cacheProvider": "ehcache",
"enableHibernateCache": true,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "mysql",
"prodDatabaseType": "mysql",
"searchEngine": false,
"messageBroker": false,
"serviceDiscoveryType": false,
"buildTool": "gradle",
"enableSwaggerCodegen": false,
"rememberMeKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
"clientFramework": "angularX",
"useSass": false,
"clientPackageManager": "yarn",
"testFrameworks": [],
"jhiPrefix": "jhi",
"enableTranslation": true,
"nativeLanguage": "de",
"languages": [
"de",
"en",
"fr"
],
"appsFolders": [
"myApp"
],
"directoryPath": "../",
"monitoring": "elk",
"consoleOptions": [
"curator"
],
"jwtSecretKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons"
}
}
</pre>
</details>
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
SKIPPED
Environment and Tools
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
git version 1.8.4.msysgit.0
node: v8.11.3
npm: 5.6.0
yarn: 1.9.4
Docker version 18.06.1-ce, build e68fc7a
docker-compose version 1.22.0, build f46880fe
I found the cause of the issue:
I obviously placed the ReactiveFormModul imports at the wrong place. I had it in a module "upwards", but actually, I had to place it into the module where I actually have the components defining the form. To be honest ... I don't understand exactly why this is an issue, maybe someone can clarify.
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '#angular/core';
import { RouterModule } from '#angular/router';
import { ReactiveFormsModule } from '#angular/forms';
*** other imports
#NgModule({
imports: [***, ReactiveFormsModule, *** ROUTER stuff,
declarations: [MyReactiveFormComponent],
schemas: [***]
})
export class MyReactiveFormModule {}
After this, I found also other issues that was working fine in the dev-build (again ... don't understand the reason. I guess that has to do with a stricter "compile" configuration):
The variable referencing the formGroup was declared "private". Therefore I got a compile Error on the prod profile. I had to change it so that it can be accessed by the html template.
Variables accessed in html must be public (or accessible by means of a getter method)
Accessing Form Controls in subsequent html elements must be "public"
Code-Example:
MyReactiveComponent.ts:
this.myForm = this.fb.group({
id: [this.myObject.id],
date: [this.myObject.date, Validators.required],
number: [this.myObject.number, [Validators.required, Validators.min(2), Validators.max(100)]],
dynamicOptions: this.fb.array([]),
prefilledOptions: [this.prefilledOptions, Validators.required]
});
MyReactiveComponent.html:
<div class="row justify-content-center">
<div class="col-8">
<form [formGroup]="myForm" id="myFormId" novalidate (ngSubmit)="save()" #editForm="ngForm">
<h2>Create or edit a Play</h2>
<div>
<jhi-alert-error></jhi-alert-error>
<div class="form-group">
<input type="number" class="form-control" formControlName="number" (blur)="updateNumber()" id="field_number" required min="2" jhiMin="2" max="100" jhiMax="100"/>
<div [hidden]="!(number?.dirty && number?.invalid)">
<small class="form-text text-danger"
[hidden]="!number?.errors?.required">
This field is required.
</small>
...
Accessing number in "number?.dirty" for example requires to have a getter-method to be able to access it:
get number() {
return this.myForm.get('number') as FormControl;
}
Hope that helps other when struggling...
I'm deploying a Jhipster application on Clevercloud.
I have set up some configuration:
war.json
{
"build": {
"type": "maven",
"goal": "package -Pprod -DskipTests"
},
"deploy": {
"goal": "package -Pprod -DskipTests",
"container": "TOMCAT8",
"war": [
{
"file": "target/myapp-1.0.0.war"
}
]
}
}
maven.json
{
"build": {
"type": "maven",
"goal": "package -Pprod -DskipTests"
},
"deploy": {
"goal": "package -Pprod -DskipTests"
}
}
I have modified the application-prod.yml to include the url/username/password of the db add-on.
When I deploy, the deployment is successfull but the application is not running.
On the application page I have 404 error.
The DB is correctly initialised.
In the logs I have the following messages that I don't understand or I'm not able to solve:
multiple times this message
2017-09-18T09:21:22.701Z: 09:21:21.483 [localhost-startStop-1] DEBUG org.springframework.jndi.JndiTemplate - Looking up JNDI object with name [java:comp/env/logging.exception-conversion-word]
2017-09-18T09:21:22.702Z: 09:21:21.486 [localhost-startStop-1] DEBUG org.springframework.jndi.JndiLocatorDelegate - Converted JNDI name [java:comp/env/logging.exception-conversion-word] not found - trying original name [logging.exception-conversion-word]. javax.naming.NameNotFoundException: Name [logging.exception-conversion-word] is not bound in this Context. Unable to find [logging.exception-conversion-word].
2017-09-18T09:21:22.702Z: 09:21:21.486 [localhost-startStop-1] DEBUG org.springframework.jndi.JndiTemplate - Looking up JNDI object with name [logging.exception-conversion-word]
2017-09-18T09:21:22.702Z: 09:21:21.486 [localhost-startStop-1] DEBUG org.springframework.jndi.JndiPropertySource - JNDI lookup for name [logging.exception-conversion-word] threw NamingException with message: Name [logging.exception-conversion-word] is not bound in this Context. Unable to find [logging.exception-conversion-word].. Returning null.
then:
2017-09-18T09:21:22.777Z: [09:21:12.705][debug][talledLocalContainer] Connection attempt with socket Socket[unconnected], current time is 1505726472705
2017-09-18T09:21:22.778Z: [09:21:12.705][debug][talledLocalContainer] Socket Socket[unconnected] for port 8009 closed
2017-09-18T09:21:22.778Z: [09:21:13.068][debug][talledLocalContainer] Executing '/usr/x86_64-pc-linux-gnu/lib/icedtea8/jre/bin/java' with arguments:
2017-09-18T09:21:22.778Z: '-version'
2017-09-18T09:21:22.778Z: The ' characters around the executable and arguments are
2017-09-18T09:21:22.778Z: not part of the command.
2017-09-18T09:21:22.779Z: [09:21:13.085][debug][talledLocalContainer] Output appended to /tmp/cargo-jvm-version-4176730048875251522.txt
2017-09-18T09:21:22.779Z: [09:21:13.085][debug][talledLocalContainer] Error appended to /tmp/cargo-jvm-version-4176730048875251522.txt
2017-09-18T09:21:22.779Z: [09:21:13.086][debug][talledLocalContainer] Project base dir set to: /home/bas/app_4b724c3b-6703-474e-9ec4-65d775cd0013
2017-09-18T09:21:22.779Z: [09:21:13.086][debug][talledLocalContainer] Execute:Java13CommandLauncher: Executing '/usr/x86_64-pc-linux-gnu/lib/icedtea8/jre/bin/java' with arguments:
2017-09-18T09:21:22.779Z: '-version'
2017-09-18T09:21:22.779Z: The ' characters around the executable and arguments are
2017-09-18T09:21:22.779Z: not part of the command.
And multiples times:
2017-09-18T09:21:22.793Z: [09:21:13.416][debug][URLDeployableMonitor] Checking URL [http://localhost:8080/cargocpc/index.html] for status using a timeout of [120000] ms...
2017-09-18T09:21:22.794Z: [09:21:13.452][debug][URLDeployableMonitor] URL [http://localhost:8080/cargocpc/index.html] is not responding: -1 java.net.ConnectException: Connection refused (Connection refused)
2017-09-18T09:21:22.794Z: [09:21:13.452][debug][URLDeployableMonitor] Notifying monitor listener [org.codehaus.cargo.container.spi.deployer.DeployerWatchdog#7bd4937b]
Ending with:
2017-09-18T09:21:32.710Z: 2017-09-18 09:21:28.724 INFO 2232 --- [ost-startStop-1] com.bbs.dm.config.WebConfigurer : Web application configuration, using profiles: prod
2017-09-18T09:21:32.711Z: 2017-09-18 09:21:28.735 INFO 2232 --- [ost-startStop-1] com.bbs.dm.config.WebConfigurer : Web application fully configured
2017-09-18T09:21:32.711Z: 2017-09-18 09:21:28.994 DEBUG 2232 --- [ost-startStop-1] i.g.j.c.liquibase.AsyncSpringLiquibase : Starting Liquibase synchronously
2017-09-18T09:21:36.985Z: Nothing listening on 8080. Please update your configuration and redeploy
2017-09-18T09:21:52.730Z: 2017-09-18 09:21:47.492 DEBUG 2232 --- [ost-startStop-1] i.g.j.c.liquibase.AsyncSpringLiquibase : Started Liquibase in 18498 ms
2017-09-18T09:21:57.985Z: Application start successful
2017-09-18T09:21:57.985Z: No cron to setup
2017-09-18T09:21:57.986Z: Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-agentd.service → /usr/x86_64-pc-linux-gnu/lib/systemd/system/zabbix-agentd.service.
I have done nothing else except following Clevercloud documentation to deploy
Have I miss something in the configuration?
(For info, the application is deploying well on other platform like Heroku or Pivotal)
To deploy a jhipster application on Clevercloud.
Here is what worked for me.
I have followed the indications given to create an application and deploy it using the CLI
Configuration files:
clevercloud/war.json
{
"build": {
"type": "maven",
"goal": "package -Pprod -DskipTests"
},
"deploy": {
"jarName": "target/myapp-1.0.0.war"
}
}
clevercloud/maven.json
{
"build": {
"type": "maven",
"goal": "package -Pprod -DskipTests"
},
"deploy": {
"goal": "package -Pprod -DskipTests"
}
}
I modified my application-prod.yml to link the db.
After every sonar scan we can see the list of newly added issues in both portal and Scan logs like shown below. Iam able to get the list of newly added issues using the Rest API
http://localhost:9000/api/issues/search?createdAfter=2015-08-15
Here we can see 18 Major issues have been fixed , and being shown in green.
Is there any way to find out the list of fixed issues in a particular scan.
Using API or any other approach
[sonar:sonar] 07:06:13.946 INFO - ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/ICDP_NOV_2015
[sonar:sonar] 07:06:14.012 INFO - Executing post-job class org.sonar.issuesreport.ReportJob
[sonar:sonar] 07:06:21.327 INFO - HTML Issues Report generated: /hosting/workspace/Sonar_20151102/make/sonar_deploy/.sonar/issues-report/issues-report.html
[sonar:sonar] 07:06:21.494 INFO - Light HTML Issues Report generated: /hosting/workspace/Sonar_20151102/make/sonar_deploy/.sonar/issues-report/issues-report-light.html
[sonar:sonar] 07:06:21.497 INFO -
[sonar:sonar]
[sonar:sonar] ------------- Issues Report -------------
[sonar:sonar]
[sonar:sonar] +27 issues
[sonar:sonar]
[sonar:sonar] +20 major
[sonar:sonar] +7 minor
[sonar:sonar]
[sonar:sonar] -------------------------------------------
[sonar:sonar]
[sonar:sonar]
[sonar:sonar] 07:06:21.497 INFO - Executing post-job class org.sonar.plugins.issueassign.notification.SendIssueNotificationsPostJob
[sonar:sonar] 07:06:21.902 INFO - Executing post-job class org.sonar.plugins.core.issue.notification.SendIssueNotificationsPostJob
[sonar:sonar] 07:06:22.361 INFO - Executing post-job class org.sonar.pl
That's not yet possible to track the remediated technical debt. You can only track for the time being the new technical debt.
There is one possible way of doing that, but not the best way
Once you call http://localhost:9000/api/issues/search and you will get an array like below,
{
"paging":{
"pageIndex":1,
"pageSize":100,
"total":1
},
"issues":[
{
"key":"01fc972e-2a3c-433e-bcae-0bd7f88f5123",
"component":"com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
"project":"com.github.kevinsawicki:http-request",
"rule":"checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
"status":"RESOLVED",
"resolution":"FALSE-POSITIVE",
"severity":"MINOR",
"message":"'3' is a magic number.",
"line":530,
"textRange":{
"startLine":81,
"endLine":81,
"startOffset":0,
"endOffset":134
},
"author":"Developer 1",
"effort":"2h1min",
"creationDate":"2013-05-13T17:55:39+0200",
"updateDate":"2013-05-13T17:55:39+0200",
"tags":[
"bug"
],
"type":"RELIABILITY",
"comments":[
{
"key":"7d7c56f5-7b5a-41b9-87f8-36fa70caa5ba",
"login":"john.smith",
"htmlText":"Must be "final"!",
"markdown":"Must be \"final\"!",
"updatable":false,
"createdAt":"2013-05-13T18:08:34+0200"
}
],
"attr":{
"jira-issue-key":"SONAR-1234"
},
"transitions":[
"unconfirm",
"resolve",
"falsepositive"
],
"actions":[
"comment"
]
}
],
"components":[
{
"key":"com.github.kevinsawicki:http-request:src/main/java/com/github/kevinsawicki/http/HttpRequest.java",
"enabled":true,
"qualifier":"FIL",
"name":"HttpRequest.java",
"longName":"src/main/java/com/github/kevinsawicki/http/HttpRequest.java",
"path":"src/main/java/com/github/kevinsawicki/http/HttpRequest.java"
},
{
"key":"com.github.kevinsawicki:http-request",
"enabled":true,
"qualifier":"TRK",
"name":"http-request",
"longName":"http-request"
}
],
"rules":[
{
"key":"checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
"name":"Magic Number",
"status":"READY",
"lang":"java",
"langName":"Java"
}
],
"users":[
{
"login":"admin",
"name":"Administrator",
"active":true,
"email":"admin#sonarqube.org"
}
]
}
What you can do is read all the objects and check the updated date ("updateDate":"2013-05-13T17:55:39+0200") is greater than your analysis date (which you can get by SonrQube webHooks). Then read the status as well to check the issue is fixed ("status":"RESOLVED")
Once an issue is fixed the "updateDate" variable will be updated.
when you call the API http://localhost:9000/api/issues/search you can use the parameter statuses=RESOLVED,CLOSED if you want only the fixed issues. You can add this parameter to reduce the number of results you get and optimize your process.
Refer https://codeen-app.euclid-ec.org/sonar/web_api/api/issues for more details.