bootJar fails after upgrading to Gradle v7.6 (project is already evaluated) - node.js

I've updated Gradle to v7.6 and now the task bootJar does not work longer.
This is what I have configured in the past and what was working:
bootJar {
mainClass.set("com.dwiner.app.MainApplication")
from("$appDir/dist/angular/browser") {
into 'static'
}
}
bootJar.dependsOn 'npm_run_buildprod'
It seems that the dependsOn has some troubles now, as it the build keeps crashing with the following message:
org.gradle.api.internal.tasks.TaskDependencyResolveException: Could not determine the dependencies of task ':bootJar'.
...
Caused by: org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreationException: Could not create task ':npm_run_buildprod'.
...
Caused by: org.gradle.api.tasks.TaskInstantiationException: Could not create task of type 'NpmTask'.
...
Caused by: org.gradle.api.InvalidUserCodeException: Cannot run Project.afterEvaluate(Closure) when the project is already evaluated.
Update:
It seems that the issue occurs when executing npm_run_buildprod and is not dependent on the dependsOn config.
Any help is appreciated.

Related

Grails4 getting out of memory while compiling groovy

I am getting below out of memory error in my grails4 application after adding more controllers in my workspace.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':cira:compileGroovy'.
GC overhead limit exceeded
so far i have total of 41 controller files in my grails application while adding 42 one i am getting this error while compiling if i remove it and run with existing 41 controllers its working.
Please let me know if you have any solution for this.
Thanks in Advance!
Modify bootRun block of build.gradle as follows
bootRun {
ignoreExitValue true
jvmArgs(
'-Dspring.output.ansi.enabled=always',
'-noverify',
'-XX:TieredStopAtLevel=1',
'-Xmx4096m')
sourceResources sourceSets.main
String springProfilesActive = 'spring.profiles.active'
systemProperty springProfilesActive,
System.getProperty(springProfilesActive)
}

CDIIntegrationService errors were found when Weblogic upgrade from 12.1.2 to 12.1.3

I have upgraded Weblogic version in linux server by changing the wl_home path in the setDomainEnv.sh for 12.1.2 to 12.1.3 and restart. when restarting it gives below errors.
Appreciate if anyone can give idea about this.
java.lang.IllegalAccessError: tried to access method com.bea.logging.LogBufferHandler.bufferLogObject(Ljava/lang/Object;)V from class weblogic.logging.log4j.WLLog4jMemoryBufferAppender
java.lang.IllegalStateException: Unable to perform operation: post construct on weblogic.diagnostics.lifecycle.LoggingServerService
java.lang.IllegalArgumentException: While attempting to resolve the dependencies of weblogic.diagnostics.lifecycle.DiagnosticFoundationService errors were found
java.lang.IllegalStateException: Unable to perform operation: resolve on weblogic.diagnostics.lifecycle.DiagnosticFoundationService
java.lang.IllegalArgumentException: While attempting to resolve the dependencies of com.oracle.injection.integration.CDIIntegrationService errors were found
java.lang.IllegalStateException: Unable to perform operation: resolve on com.oracle.injection.integration.CDIIntegrationService
Use the wllog4j.jar which is part of WLS 12.1.3 build. The one part of WLS_HOME/server/lib diretory.
If your domains-home/lib folder holds older wllog4.jar which was part of 12.1.2 then you will face this issue

Jhipster gradle build failde

When running jhipster from command line I get the following error, I am using jhipster latest version (v3.12.2) on windows machine. It seems there is an issue with gradle build.
gradlew.bat bootRun
:cleanResources
:bootBuildInfo
:bower
:nodeSetup SKIPPED
:gulpConstantDev
[15:59:03] Using gulpfile C:\dev\test\gulpfile.js
[15:59:03] Starting 'ngconstant:dev'...
[15:59:03] Finished 'ngconstant:dev' after 23 ms
:processResources
:compileJava
:classes
:findMainClass
:pathingJar
:bootRun
java.lang.NoClassDefFoundError: org/springframework/core/env/Environment
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: org.springframework.core.env.Environment
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" :bootRun FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':bootRun'.
> Process 'command 'C:\Program Files\Java\jdk1.8.0_66\bin\java.exe'' 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.
BUILD FAILED
Total time: 15.498 secs
Using Maven works.
Regards
Yes, there is a gradle issue in this version, which produces this error if gradle cache path contains spaces. I suggest you permanently remove gradle cache to a path without spaces: Set Gradle Cache Directory?
If you need a temporary quick fix, like me, you can patch this using a dirty approach to fix the JHipster classpath. Suppose your Windows user name is "Your Name". Then it will be a part of the path string and you will need to replace it with "yourna~1" (it is the 8-chars equivalent for Windows long name directories, i.e. first 6 chars of the directory name lowercase without spaces + "~1"). You can patch it in your build.gradle, line 55 and the issue is gone:
attributes 'Class-Path': configurations.runtime.files.collect {
it.toURL().toString().replaceFirst(/file:\/+/, '/').replace("Your Name", "yourna~1")
}.join(' ')

Gradle - won't allow maxHeapSize to be set?

task test(type: Test, overwrite: true, dependsOn: [setupUser]) {
maxHeapSize "3000m"
allJvmArgs "-Xmx3000m"
}
Error:
* What went wrong:
A problem occurred evaluating root project 'myproject'.
> Could not find method allJvmArgs() for arguments [-Xmx3000m] on root project 'myproject'.
No matter what I try, I get heap issues when I run gradle test. I'm using 1.0-milestone-9
The second line (allJvmArgs "-Xmx3000m") is incorrect syntax which explains why Gradle complains. The first line (maxHeapSize "3000m") is fine and I'd be surprised if it didn't work. "3000m" might be too high a value though and could lead to an error when creating the JVM. In any case, look for the following debug output (-d):
[DEBUG] [org.gradle.process.internal.ProcessBuilderFactory] creating process builder for Gradle Worker 1
[DEBUG] [org.gradle.process.internal.ProcessBuilderFactory] in directory /xxx
[DEBUG] [org.gradle.process.internal.ProcessBuilderFactory] with argument#0 = -Xmx300m
...
[DEBUG] [org.gradle.process.internal.DefaultExecHandle] Started Gradle Worker 1.

get archetype catalog failed(can't load Ahcwagon)-m2e-0.12.1

I'm trying to use m2eclipse api to import projects by archetype.
my code is here:
RemoteCatalogFactory remoteCatalogFactory = new RemoteCatalogFactory("http:/server1/archetype-catalog.xml", null, true);
ArchetypeCatalog catalog = remoteCatalogFactory.getArchetypeCatalog();
List<Archetype> archetypes = catalog.getArchetypes();
for (Archetype archetype : archetypes){
System.out.println(archetype.getArtifactId());
}
m2eclipse version is:0.12.1.
Got below exception:
1) Error injecting: org.sonatype.maven.wagon.AhcWagon
at ClassRealm[plexus.core, parent: null]
while locating org.apache.maven.wagon.Wagon annotated with #com.google.inject.name.Named(value=http)
1 error
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:958)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at org.sonatype.guice.bean.locators.LazyQualifiedBean.getValue(LazyQualifiedBean.java:66)
at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:54)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:247)
... 38 more
Caused by: java.lang.TypeNotPresentException: Type org.sonatype.maven.wagon.AhcWagon not present
at org.sonatype.guice.bean.reflect.URLClassSpace.loadClass(URLClassSpace.java:94)
at org.sonatype.guice.bean.reflect.NamedClass.load(NamedClass.java:46)
at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:949)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:995)
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:945)
... 42 more
Caused by: java.lang.ClassNotFoundException: org.sonatype.maven.wagon.AhcWagon
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
at org.sonatype.guice.bean.reflect.URLClassSpace.loadClass(URLClassSpace.java:90)
During debug, I found bundleloader is using org.maven.ide.eclipse's bundle classloader to load AhcWagon class.
because maven embedder bundle haven't export AhcWagon's package, so can't load it.
But my question is: caller(plexus-classworlds.jar) is in maven embedder bundle and AhcWagon(in wagon-ahc.jar) is in the same bundle. Why not use maven embedder's bundle loader to load AhcWagon?
Am I something wrong to use this API?
That's great! If there is any sample code.
Regards
Simon
m2eclipse0.12.1's bug, need to export org.sonatype.maven.wagon in manifest.

Resources