Here is my issue :
When i run my mainClass as java application everything goes good :
but when i run ./gradle run springboot dependencies not found in the classPath :
the build.gradle : GitHub Repository link to file
Can anyone try to fix with me the issue i ll be more than glad !!!
I managed to resolve the issue by adding this in the build.gradle :
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://nexus.gluonhq.com/nexus/content/repositories/releases'
}
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:2.0.30'
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.3.3.RELEASE"
}
}
apply plugin: 'application'
dependencies {
compile "org.springframework.cloud:spring-cloud-starter-feign:1.4.7.RELEASE"
}
And now when i run /.gradle run -> it shows
Related
I was trying to gradle build a plain Java Android project. It was an ADT project imported to Android Studio. To my astonishment, at one point Gradle tried to download the Kotlin compiler!
* What went wrong:
Execution failed for task ':app:lint'.
> Could not resolve all files for configuration ':app:lintClassPath'.
> Could not download kotlin-compiler.jar (com.android.tools.external.com-intellij:kotlin-compiler:26.2.0)
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/kotlin-compiler/26.2.0/kotlin-compiler-26.2.0.jar'.
> Read timed out
Why the heck did gradle attempt downloading a big package like the Kotlin compiler
How do I prevent that?
More generally, how do make gradle ask me before it tries to download anything or at least prevent it from downloading non-dependencies? Such things should be installed by my distro's package manager, after all!
1) Because Gradle supports linting Kotlin code, which requires parsing it, which is implemented using classes in the Kotlin compiler.
2) By not using the lint task I guess?
3) The Kotlin compiler is a dependency. Gradle requires a specific version of this dependency in a specific layout and in a specific location, and it can't use a version installed by your package manager.
change
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
to
buildscript {
repositories {
google()
maven {
url "https://maven2.google.com"
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
allprojects {
repositories {
google()
maven {
url "https://maven2.google.com"
}
jcenter()
}
}
I just updated to using Android Studio 3.0 Canary 2. Upon opening my project Android Studio suggested I update the gradle version to 3.0.0-alpha2. My goal is to use the "Enable advanced profiling" Run Configuration so I can run a realtime memory-analysis. However the instant my gradle version was updated, my project fails to build. I followed the update instructions here.
The only changes made were to my top-level build.gradle file and the gradle-wrapper.properties file.
My top-level build.gradle:
buildscript {
repositories {
jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
maven { url 'https://maven.google.com' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha2'
classpath 'com.github.Archinamon:GradleAspectJ-Android:2.3.0'
classpath 'me.tatarka:gradle-retrolambda:3.5.0'
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
maven { url 'https://repo.adobe.com/nexus/content/repositories/releases/' }
maven { url 'http://maven.localytics.com/public' }
}
}
And I updated the gradle-wrapper.properties distributionURL to:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-milestone-1-all.zip
The error I get is:
Failed to apply plugin [id'com.archinamon.aspectJ']
And here is the offending part of my app-level build.gradle file:
import java.text.SimpleDateFormat
apply plugin: 'com.android.application'
apply plugin: 'com.archinamon.aspectj'
aspectj {
includeAspectsFromJar 'Android_MTAgent'
}
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
....
}
So the problem seems to be with the aspectJ plugin. If I remove the plugin for aspectJ and the related aspectJ block (both shown above) then it compiles (I get a dimen error then though, but I already saw that mentioned elsewhere, so I guess that can be solved.)
I'd appreciate any pointers/ideas in regard to the above issue.
Change your project build.gradle:
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha2'
}
to
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha3'
}
and update your Archinamon classpath reference in the same build.gradle file to:
classpath 'com.github.Archinamon:GradleAspectJ-Android:3.0.2'
I am working on android (Java) and trying to consume websockets so I thought I would use this tutorial and they are using dependency org.java-websocket:Java-WebSocket:1.3.0 from this repo which has now become 1.3.1.
So I have in my modular build.gradle
dependencies {
...
compile 'org.java-websocket:Java-WebSocket:1.3.1'
...
}
and in my project / top level build.gradle I have
repositories {
jcenter()
maven { url 'http://clojars.org/repo' }
}
and I am getting error
Error:(49, 13) Failed to resolve: org.java-websocket:Java-WebSocket:1.3.1
Try it with lowercase:
compile 'org.java-websocket:java-websocket:1.3.1'
It worked for me.
Edit:
the project level gradle file:
buildscript {
repositories {
jcenter()
maven { url 'http://clojars.org/repo' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
}
}
allprojects {
repositories {
jcenter()
maven { url 'http://clojars.org/repo' }
}
}
I was also facing same issue ,I restarted Android Studio and sync again,it build successfully.
I'm facing this problem currently. The project did't have any build problems previously. Only today when I was trying to build it gives this error.
Gradle: A problem occurred configuring project ':Project'.
Could not resolve all dependencies for configuration ':Project:classpath'.
Could not download artifact 'org.ow2.asm:asm-analysis:4.0#jar'
Artifact 'org.ow2.asm:asm-analysis:4.0#jar' not found.
Seems like asm-analysis:4.0 is not found in maven repo.
(Is this link correct? http://search.maven.org/#browse%7C1692005229)
Inside my build.gradle file, I've set the repository to mavenCentral()
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
} }
I am not sure how to fix this problem, any suggestion is appreciated.
Thank you.
Faced the same problem, ow2.org has separate repository
buildscript {
repositories {
maven { url "http://repository.ow2.org/nexus/content/repositories/releases/" }
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
I've been looking for a liquibase gradle plugin and found gradle-liquibase-plugin from tlberglund.
Gradle version 1.2
build file:
apply plugin: 'java'
apply plugin: 'liquibase'
repositories {
mavenCentral()
}
dependencies {
compile('org.hsqldb:hsqldb:2.2.8')
compile('org.hsqldb:sqltool:2.2.8')
compile('com.h2database:h2:1.3.167')
compile('org.liquibase:liquibase-core:2.0.1')
compile('com.augusttechgroup:groovy-liquibase-dsl:0.7.3')
compile('postgresql:postgresql:9.1-901.jdbc4')
}
buildscript {
dependencies {
classpath 'com.augusttechgroup:gradle-liquibase-plugin:0.6.1'
}
}
databases {
postgre {
url = "${postgreBaseUrl}" + "${postgreDB}"
username = "${postgreUserName}"
password = "${postgreUserPassword}"
}
}
changelogs {
main {
file = file('src/main/liquibase/mainChanges.groovy')
}
}
task dbInit << {
databases.postgre.url = "${postgreBaseUrl}"
databases.postgre.username = "${postgreRootUserName}"
databases.postgre.password = "${postgreRootUserPassword}"
changelogs.main.file = file('src/main/liquibase/tablespaceChanges.groovy')
}
Runnin gradle build fails with the following error:
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':classpath'.
> Could not find group:com.augusttechgroup, module:gradle-liquibase-plugin, vers
ion:0.6.1.
Required by:
:demo:unspecified
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to
get more log output.
BUILD FAILED
Does anyone have experience with this plugin, I would really appreciate a working example.
The problem isn't related to the Liquibase plugin. You just need to declare a repository in the buildscript {} section. buildscript {} is completely separate from the rest of the script. You can almost think about it as a separate file.
Looking at the source on github (see the build.gradle file) it looks like the builds are posted on oss.sonatype.org. Try using adding "https://oss.sonatype.org/content/repositories/releases/" as a maven repository
So, your build.gradle may look like this:
buildscript {
repositories {
maven {
url uri('https://oss.sonatype.org/content/repositories/releases/')
}
mavenCentral()
}
dependencies {
classpath group:'net.saliman', name: 'gradle-liquibase-plugin', version: '1.0.0'
}
}
apply plugin: 'liquibase'