My build.gradle file:
//Hibernate
implementation 'org.hibernate:hibernate-core:5.4.2.Final'
implementation 'org.hibernate:hibernate-entitymanager:5.4.2.Final'
//Hibernate Search
implementation 'org.hibernate:hibernate-search:5.11.1.Final'
implementation 'org.hibernate:hibernate-annotations:3.5.6-Final'
implementation 'org.apache.solr:solr-common:1.3.0'
implementation 'org.apache.solr:solr-core:7.6.0'
implementation 'org.lucee:lucene-snowball:2.9.4'
When I ran ./gradlew clean jar in IntelliJ, I've got the error:
12:40:34: Executing task 'jar'...
Task :wrapper
BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed
Task :compileJava FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':compileJava'.
Could not resolve all files for configuration ':compileClasspath'.
Could not find org.restlet.jee:org.restlet:2.3.0.
Required by:
project : > org.apache.solr:solr-core:7.6.0
Could not find org.restlet.jee:org.restlet.ext.servlet:2.3.0.
Required by:
project : > org.apache.solr:solr-core:7.6.0
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
BUILD FAILED in 3s
1 actionable task: 1 executed
Could not find org.restlet.jee:org.restlet:2.3.0.
Required by:
project : > org.apache.solr:solr-core:7.6.0
Search in build.gradle files
12:40:38: Task execution finished 'jar'.
Solr is not necessary to use Hibernate Search. Try removing the Solr dependencies.
If you added these dependencies to use extra analyzers, you may want to know that in the past few years most analyzers were moved from Solr to Lucene, and thus you should be able to depend on Lucene jars instead: see here
Related
I want to use log4j2 appenders for gradle's task logs. for example, when I run simple build command I see below stdout logs.
> Task :test FAILED
TestserverApplicationTests > contextLoads() FAILED
org.opentest4j.AssertionFailedError at TestserverApplicationTests.java:21
1 test completed, 1 failed
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test'.
> There were failing tests. See the report at: file:///Users/jaekukkim/dev/testserver/build/reports/tests/test/index.html
* 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
BUILD FAILED in 7s
7 actionable tasks: 1 executed, 6 up-to-date
And I am trying get above logs via log4j appender, but I only log application level logs instead of gradle build task logs.
Is it possible such job in configuration changes in build.gradle?
I have been facing this error for 2 days on Linux(Ubuntu 20.04) machine, and I have tried almost every possible solution found on stack-overflow and git-hub but I could'not resolve this. Any idea about this error?
Task :app:compileDebugJavaWithJavac
Task :app:mergeDebugJavaResource FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings
217 actionable tasks: 3 executed, 214 up-to-date
Note: /home/fareed/Data/Office/Alfabolt/DeNaio-Mobile-App/android/app/src/debug/java/com/denaio/ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDebugJavaResource'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Failed to transform bcprov-jdk15on-1.69.jar (org.bouncycastle:bcprov-jdk15on:1.69) to match attributes {artifactType=android-java-res, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for JetifyTransform: /home/fareed/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcprov-jdk15on/1.69/91e1628251cf3ca90093ce9d0fe67e5b7dab3850/bcprov-jdk15on-1.69.jar.
> Failed to transform '/home/fareed/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcprov-jdk15on/1.69/91e1628251cf3ca90093ce9d0fe67e5b7dab3850/bcprov-jdk15on-1.69.jar' using Jetifier. Reason: IllegalArgumentException, message: Unsupported class file major version 59. (Run with --stacktrace for more details.)
Suggestions:
- Check out existing issues at https://issuetracker.google.com/issues?q=componentid:460323&s=modified_time:desc, it's possible that this issue has already been filed there.
- If this issue has not been filed, please report it at https://issuetracker.google.com/issues/new?component=460323 (run with --stacktrace and provide a stack trace if possible).
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
BUILD FAILED in 24s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
Note: /home/fareed/Data/Office/Alfabolt/DeNaio-Mobile-App/android/app/src/debug/java/com/denaio/ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDebugJavaResource'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Failed to transform bcprov-jdk15on-1.69.jar (org.bouncycastle:bcprov-jdk15on:1.69) to match attributes {artifactType=android-java-res, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for JetifyTransform: /home/fareed/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcprov-jdk15on/1.69/91e1628251cf3ca90093ce9d0fe67e5b7dab3850/bcprov-jdk15on-1.69.jar.
> Failed to transform '/home/fareed/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcprov-jdk15on/1.69/91e1628251cf3ca90093ce9d0fe67e5b7dab3850/bcprov-jdk15on-1.69.jar' using Jetifier. Reason: IllegalArgumentException, message: Unsupported class file major version 59. (Run with --stacktrace for more details.)
Suggestions:
- Check out existing issues at https://issuetracker.google.com/issues?q=componentid:460323&s=modified_time:desc, it's possible that this issue has already been filed there.
- If this issue has not been filed, please report it at https://issuetracker.google.com/issues/new?component=460323 (run with --stacktrace and provide a stack trace if possible).
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
BUILD FAILED in 24s
at makeError (/home/fareed/Data/Office/Alfabolt/DeNaio-Mobile-App/node_modules/execa/index.js:174:9)
at /home/fareed/Data/Office/Alfabolt/DeNaio-Mobile-App/node_modules/execa/index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async runOnAllDevices (/home/fareed/Data/Office/Alfabolt/DeNaio-Mobile-App/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)
at async Command.handleAction (/home/fareed/Data/Office/Alfabolt/DeNaio-Mobile-App/node_modules/react-native/node_modules/#react-native-community/cli/build/index.js:186:9)
I have a Gradle project that as a simple example looks similar to this:
root
|
|build.gradle.kts
|settings.gradle.kts
|config.yaml
|web/
|build.gradle.kts
|src/
|main/
|java....(etc)
The web project is a barebones Dropwizard app that does nothing other than declare a configuration and an application that uses it so that the server can start up.
In my root path, I have defined my subproject (:web in this case) in the settings.gradle.kts file. In my root build.gradle.kts, I have a implementation(project(":web")) dependency declared.
I have a run task and a fatJar task to run/build this app.
val run by tasks.getting(JavaExec::class) {
args("server", "config.yaml")
}
val fatJar = task("fatJar", type = Jar::class) {
manifest {
attributes["Implementation-Title"] = "Some API"
attributes["Main-Class"] = "my.package.web.HelloWorldApplication"
}
from(configurations.runtimeClasspath.get().map({ if (it.isDirectory) it else zipTree(it) }))
with(tasks.jar.get() as CopySpec)
}
tasks {
"build" {
dependsOn(fatJar)
}
}
I can build the fatJar and it contains what appears to be all the classes I expect (dependencies at root, dependencies of web, their transitive dependencies, etc).
However, when I run ./gradlew run I get an error starting the Dropwizard app due to multiple logging bindings found on the class path. Error is below:
./gradlew run
Starting a Gradle Daemon, 1 busy and 1 incompatible and 3 stopped Daemons could not be reused, use --status for details
> Task :run
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/me/.gradle/caches/5.4.1/generated-gradle-jars/gradle-api-5.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/me/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.2.3/7c4f3c474fb2c041d8028740440937705ebb473a/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.gradle.internal.logging.slf4j.OutputEventListenerBackedLoggerContext]
Exception in thread "main" java.lang.IllegalStateException: Unable to acquire the logger context
at io.dropwizard.logging.LoggingUtil.getLoggerContext(LoggingUtil.java:46)
at io.dropwizard.logging.BootstrapLogging.bootstrap(BootstrapLogging.java:52)
at io.dropwizard.logging.BootstrapLogging.bootstrap(BootstrapLogging.java:41)
at io.dropwizard.Application.bootstrapLogging(Application.java:38)
at io.dropwizard.Application.<init>(Application.java:26)
at my.package.web.HelloWorldApplication.<init>(HelloWorldApplication.java:15)
at my.package.web.HelloWorldApplication.main(HelloWorldApplication.java:17)
> Task :run FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':run'.
> Process 'command '/Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk/Contents/Home/bin/java'' 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
BUILD FAILED in 25s
13 actionable tasks: 1 executed, 12 up-to-date
I know I can remove logback from Dropwizard but I'd really rather figure out why gradle-api-5.4.1.jar is being bundled into my application. I can't for the life of me figure it out and don't understand why it would be pulled in.
Any direction would be appreciated.
Thanks
So my mistake in both asking this question and in what I was doing was that I failed to mention or realize that I was applying the kotlin-dsl plugin in my root script on accident. Once I removed this, everything worked as I expected.
You have to add the following in the dependency section of your build.gradle file.
dependencies {
compile('io.dropwizard:dropwizard-core:1.2.2') {
exclude group: 'org.slf4j', module: 'slf4j-api'
}
}
So my spring project on eclipse was working fine, I returned to my project a week ago and for some reason there are squiggly red lines every where, saying cannot resolve type all over the whole project. I have tried everything on the internet and dont know the way forward now.
This is what I see when I run gradle
Working Directory: /Users/deso/Documents/workspace-sts-3.9.1.RELEASE/dohinventoryfordoh
Gradle user home: /Users/deso/.gradle
Gradle Distribution: Gradle wrapper from target build
Gradle Version: 4.6
Java Home: /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home
JVM Arguments: None
Program Arguments: None
Build Scans Enabled: false
Offline Mode Enabled: false
Gradle Tasks: build
:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
> Could not find org.springframework.boot:spring-boot-starter-aop:.
Required by:
project :
> Could not find org.springframework.boot:spring-boot-starter-data-jpa:.
Required by:
project :
> Could not find org.springframework.boot:spring-boot-starter-web:.
Required by:
project :
> Could not find org.springframework.hateoas:spring-hateoas:.
Required by:
project :
* 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
BUILD FAILED in 0s
1 actionable task: 1 executed
I've followed build instructions from here:
https://boofcv.org/index.php?title=Tutorial_Camera_Calibration
and get this strange error message:
C:\boofcv\applications>gradle applicationsJar
Skipping integration/android because ANDROID_HOME has not been set! See integration/android/readme.txt
Skipping integration/boofcv-openkinect because boofcv-openkinect/libfreenect is missing! See integration/openkinect/readme.txt
Parallel execution is an incubating feature.
FAILURE: Build failed with an exception.
* What went wrong:
Failed to capture snapshot of input files for task ':applications:applicationsJar' property 'rootSpec$1$1$2$1' during up-to-date check.
> A Jar can only accept a file or directory that exists: C:\boofcv\applications\build\osgi-classes
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 10s
38 actionable tasks: 10 executed, 28 up-to-date
my boofcv version is 0.27.