Database migration plugin error in grails4 - gradle

I am working on a grails project version 4
And whenever I am running the project or performing gradle build or clean
I am getting the following error
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find org.grails.plugins:database-migration:3.1.0.BUILD-SNAPSHOT.
Searched in the following locations:
- https://repo.grails.org/grails/core/org/grails/plugins/database-migration/3.1.0.BUILD-SNAPSHOT/maven-metadata.xml
- https://repo.grails.org/grails/core/org/grails/plugins/database-migration/3.1.0.BUILD-SNAPSHOT/database-migration-3.1.0.BUILD-SNAPSHOT.pom
- https://repo.grails.org/grails/core/org/grails/plugins/database-migration/3.1.0.BUILD-SNAPSHOT/database-migration-3.1.0.BUILD-SNAPSHOT.jar
Required by:
project :

Seems like all of the plugin repos return 404 right now, examples:
https://repo.grails.org/grails/core/org/grails/plugins/database-migration/3.1.0.BUILD-SNAPSHOT/database-migration-3.1.0.BUILD-SNAPSHOT.pom
https://repo.grails.org/grails/core/gradle/plugin/com/gorylenko/gradle-git-properties/gradle-git-properties/2.2.4/gradle-git-properties-2.2.4.pom
not sure whats going on, but if you are using grails 3+ you can try to add https://grails.jfrog.io/grails/core to your repositories closure (as a temporary fix), like so:
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
maven { url "https://grails.jfrog.io/grails/core"}
}
Although I would like to know whats going on with the official repo, maybe hear from the grails guys about this.
I hope they resolve it soon at least, because its not as easy to fix with our old grails 2 apps.

https://grails.jfrog.io/grails/core
Works for me by using grails 4! Thanks!
I hope the repo.grails.org-guys will fix this problem as soon.

They fixed the problem teporary on "https://repo.grails.org/grails/core".
The link will forwart on "https://repo.grails.org/artifactory/core/" which has all repositories.
Good luck!

Related

RSocket dependency issue using Gradle6.3 with Spring boot 2.2..6.Release in Apache Archiva

My issue is similar to https://github.com/spring-projects/spring-boot/issues/20348 but still, I am not able to find the appropriate solution.
I am using apache archiva2.2.5, Gradle 6.3, and Spring boot 2.2.6.Release.
When I try to build the project, it tries to download "rsocket-bom-1.0.0-RC6.module" from my remote repository and it fails. I checked the file "rsocket-bom-1.0.0-RC6.module" doesn't exist in my remote repo neither it exists in maven central repository.
How do I resolve the issue?
Always use a stable version for development. Its just a matter of time that it will be fixed in springboot. Its nothing to do with gradle though.
try this in your build.gradle file:
repositories {
maven {
url "https://.... your url here .../artifactory/maven-all"
metadataSources {
mavenPom()
artifact()
ignoreGradleMetadataRedirection()
}
}
}
It worked for me :-)

Gradle cannot resolve dependency for spring framework uaa client?

I have just started using gradle, and facing same issue in multiple gradle projects. The dependency for 'org.springframework.uaa.client:1.0.1.RELEASE'
is not resolved.
I checked and the repository used, contains the given artifact but still gradle reports an error like below:
Could not resolve all dependencies for configuration ':compile'.
> Could not resolve org.springframework.uaa:org.springframework.uaa.client:1.0.1.RELEASE.
I googled a lot and found similar problems being faced by others, but no particular solution.
Here Gradle Discussion it is discussed that the problem maybe due to the 'relativePath' in the pom, which is not resolved by gradle. And that it might be a problem in the pom, and not with gradle.
But what is the exact solution at the present, or any work around to resolve this issue ?
Note : 1. An issue has been open in reference to the above gradle discussion but it's still marked as un-resolved !!
2. The project I am trying to run are using a gradle wrapper 'gradle-1.0-bin.zip'
EDIT 1
I am trying to run the gormish project from GIT and I have faced same issue in another gradle project for using gorm-stadalone here
The repository used is :
repositories {
mavenCentral()
mavenRepo name: "Grails", url: "http://repo.grails.org/grails/repo/"
}

Could not find dependency declared in Gradle buildscript block via Artifactory

I am using Artifactory as my artifact store, and have set this up so that it is being used as a proxy and cache for jcenter. This generally is working fine apart from for dependencies declared in the buildscript block in my main build.gradle.
My block looks like
buildscript {
repositories {
//proxies jcenter
maven {
url "https://<myArtiInstance>/artifactory/repo"
credentials {
username artifactory_reader_username
password artifactory_reader_password
}
}
}
dependencies {
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.1.1"
classpath "com.android.tools.build:gradle:2.1.2"
}
}
which gives the error when running gradlew clean build (2.10)
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find builder.jar (com.android.tools.build:builder:2.1.2).
Searched in the following locations:
https://<myArtiInstance>/artifactory/repo/com/android/tools/build/builder/2.1.2/builder-2.1.2.jar
If I wack the above url into my (authenticated) browser, I get the jar and can see its put into the arti cache.
All my other proxied dependencies seem to work so I am a bit confused as to whats going on.
At present I am wondering if this is a bug with Gradle 2.10 or something, as this used to work as I can see previous cached versions of that artifact in my arti box.
Thanks for any help or pointers :)
EDIT: If I roll back to com.android.tools.build:gradle:2.1.0 which is not in my cached repo either, build completes fine and it caches it. For some reason it does not like 2.1.2, I wonder why?!
EDIT2: Still having issues, now its taken issue with https://<myArtiInstance>/artifactory/repo/com/google/guava/guava/15.0/guava-15.0.jar which gives a similar error to the above
* What went wrong:
A problem occurred configuring root project '<name>'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find guava.jar (com.google.guava:guava:15.0).
Searched in the following locations:
https://<myAriInstance>/artifactory/repo/com/google/guava/guava/15.0/guava-15.0.jar
This is again from a dependecency specified inside the buildscript block. Any ideas whats going on? This time is transative so I cant just swap the version. The only strange thing I notice from the error messages is that its looking for guava.jar at the url ending in guava-15.0.jar...
So it turns out inspecting the output of gradlew clean build --debug for a second time, I noticed everything was being obtained from the local ~/.gradle/cache, apart from the failing jars above. rm the cache and everything works fine, and the transitive dependencies can be obtained from the url given in the error msg. Subsequent builds which retreive from local cache work fine. Seems to me that something had corrupted the local cache (maybe partial download of complete resources i.e. pom, jar etc for the dependency) and that the gradle error msg was incorrect.
EDIT: testing just deleting the jar from cache and still compiles fine...

Resource nexus-maven-repository-index.properties does not exist in IntelliJ

While experimenting with Grails 3 under IntelliJ I found the following warning:
Unindexed remote maven repositories found. Disable...
The following repositories used in your gradle projects were not indexed yet:
https://repo.grails.org/grails/core
If you want to use dependency completion for these repositories artifacts,
Open Repositories List, select required repositories and press "Update" button (show balloon)
If I am trying to resolve an issue, I get next error:
FileNotFoundException: Resource nexus-maven-repository-index.properties does not exist in IntelliJ
I would prefer to know, what does it mean? If repository is marked as "remote", then why the problem is absence of some (local?) file?
UPDATE
I think this is not related with Grails actually.
How to know more details on error, occurring in Indexed Maven Repositories Window in IntelliJ on Update button?
The popup message says
Resource nexus-maven-repository-index.properties does not exist in IntelliJ
If you're using your custom repository
AND it is Nexus 3.x
chances are high that you forgot to set up a Task to publish your maven repository indexes.
Log in via browser.
Go to Administration/System/Tasks/Create Task/Create Publish Maven indexes Task
Set it for an hourly publish. Done.
For me the solution was to delete the folder ~/.m2/repository. This made Maven to re-index everything correctly.
Failed trials, that may work for someone else:
Build, Execution, Deployment → Build Tools → Maven → Repositories : Selecting the repositories and click updates.
Build, Execution, Deployment → Build Tools → Maven: Giving more memory JVM
Delete folder ~/.IntelliJIdea2016.3/system/caches
You can try using grails/repo and grails/plugins instead of grails/core.
For example, in build.gradle:
repositories {
mavenLocal()
maven { url 'http://repo.grails.org/grails/repo' }
maven { url 'http://repo.grails.org/grails/plugins' }
}
I tested on IntelliJ Community 15 with Grails 3.0.9, JVM Version: 1.8.0_45, Apache Maven 3.3.9 and Gradle 2.3.
The same error occurs for Artifactory users. Solved with sanya's hint. Make sure the local repositories are included.
After that the repo works:
I've had faulty indexes after fresh install (from Snap ubuntu).
It has been solved by changing the MAVEN HOMe PATH
I've switched from "bundled" to "/usr/share/maven"
None of the solutions aforementioned solved my issue in my case

Grails 2.2.1 app cannot resolve dependencies

I am running into problems setting up an existing grails (2.2.1) project on a new mbp. I get dependency resolution errors whenever I try to run any grails command. It seems that it cannot resolve any grails plugins that are marked with the compile phase like below.
compile ":cache:1.0.0"
I've taken a look at the org.grails.plugins repository to make sure the plugins exist, and they all appear to be there. I cannot for the life of me figure out why it cannot resolve these plugins. A coworker said he upgraded to grails 2.4, got the dependencies to resolve and download to his local cache, then went back to grails 2.2.1 to run the app. I'd rather figure this out than have to do that.
Anyone seen something like this before?
Recently I faced the same problem with Grails 2.2.0.
I've fixed it by adding this repository to BuildConfig.groovy:
mavenRepo 'https://repo.grails.org/grails/plugins'
http://grails.1312388.n4.nabble.com/Grails-central-repo-seemingly-missing-plugin-versions-td4658720.html

Resources