Gradle cannot resolve dependency for spring framework uaa client? - spring

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/"
}

Related

Database migration plugin error in grails4

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!

Could not able resolve javax.inject: javax.inject:1.0 - Gradle

I am getting below error while running Gradle build in Unix terminal.
Could not resolve all files for configuration ':imcalmsvc-service:compileClasspath'.
Could not find javax.inject:javax.inject:1.0.
Searched in the following locations:
- https://jcenter.bintray.com/javax/inject/javax.inject/1.0/javax.inject-1.0.pom
- https://repo.maven.apache.org/maven2/javax/inject/javax.inject/1.0/javax.inject-1.0.pom
However, there is no error while doing Eclipse-> Gradle refresh.
The error means the dependency wasn't found in either JCenter or Maven Central. When you are usure about the exact name of dependency or which repositories it is uploaded to, I recommend a search engine like mvnrepository.com. It aggregates metadata from a lot of different Maven repositories and even shows you how to use them in Gradle.
In your case, you can find the javax.inject library here. Notice that the only published version is simply 1 and not 1.0. Change this and it should work.

AEM Mocks missing artifact for latest version

I have added the latest version of AEM Mocks (2.7.2) as a Maven dependency in my AEM project. When I try to build my project, I get an error saying that this artifact cannot be found: com.day.commons:day-commons-gfx:jar:2.1.28. So I looked online, found it and added it as a dependency. But now I get the same error when trying to build. Does this artifact still exist? When trying various recent versions of AEM Mocks, I found that they all depend on this missing artifact.
For now, I downgraded to version 2.3.0, which works fine without that artifact but I would like to use the most recent version if possible.
Can anyone please help? Thanks!
This artifact is defined as a workaround, it is explained here in comment:
https://github.com/wcm-io/wcm-io-testing/blob/develop/aem-mock/core/pom.xml#L254:
Workaround for AEM 6.5: The new uber-jar does no longer contain the package com.day.imageio.plugins
It works without any issues for me, so I would check if you have correctly configured Maven repositories. To do it, in your Maven project root type:
mvn help:evaluate
and then:
${project.repositories}
It should list your project effective repositories. Ensure that there is Central Repository (https://repo.maven.apache.org/maven2/) listed. If it is there, then maybe your corporate network cuts requests to external repositories or it was temporarily down.

Adding org.apache.kafka to dependencies with Gradle

I started a Gradle project with gradle init --type java-application using Kotlin as the build script DSL, and I just wanted to add org.apache.kafka library
dependencies {
// This dependency is used by the application.
implementation("com.google.guava:guava:28.0-jre")
implementation("org.apache.kafka:kafka_2.10:0.8.0")
// Use JUnit test framework
testImplementation("junit:junit:4.12")
}
But gradle build returned this:
* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find jmxtools.jar (com.sun.jdmk:jmxtools:1.2.1).
Searched in the following locations:
https://jcenter.bintray.com/com/sun/jdmk/jmxtools/1.2.1/jmxtools-1.2.1.jar
> Could not find jmxri.jar (com.sun.jmx:jmxri:1.2.1).
Searched in the following locations:
https://jcenter.bintray.com/com/sun/jmx/jmxri/1.2.1/jmxri-1.2.1.jar
What's this about? Conflicts with JCenter?
As already mentioned in the comments upgrading the kafka version will solve the problem (probs go to #cricket_007).
The root cause for that problem is actually not kafka itself but it's transitive dependency log4j in a version 1.2.15. This log4j version requires jmxtools and jmxri. Due to some licensing issues these artifacts are NOT available on maven central and jcenter. The good news is: You most likely don't need it at all. You simply override the log4j dependency to use 1.2.16 (or above) or exclude jmxtools and jmxri.
You can also find some more insights in this blog article: http://unitstep.net/blog/2009/05/18/resolving-log4j-1215-dependency-problems-in-maven-using-exclusions/
So 3 ways to solve this issue:
use a more recent kafka-version OR
use a log4j version > 1.2.15 OR
exclude jmxtools and jmxri
Hope that helps and make things more clear

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

Resources