I'm not familiar with Spring eco and to run gradle to install required modules.
I just cloned this spring boot repo and tried to run it
git#github.com:didinj/springboot-mongodb-security.git
Plugin [id: 'org.springframework.boot', version: '2.1.7.RELEASE'] was not found in any of the following sources:
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'org.springframework.boot', version: '2.1.7.RELEASE'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'org.springframework.boot:org.springframework.boot.gradle.plugin:2.1.7.RELEASE')
Searched in the following repositories:
Gradle Central Plugin Repository
at .....
How come? Does this mean the 'org.springframework.boot', version: '2.1.7.RELEASE' is not in this world anymore? If so, the package management system is holly crap.
What should I do? I cloned bunch of git repos from the github and try to run gradle and always have this problem.
Java ecosystem is too broken. Unlike NPM or ruby gem which is so stable and no-brain to use.
Is there related to my gradle setting, java version, or anything else?
Use JDK 8. Change or config MongoDB at https://github.com/didinj/springboot-mongodb-security/blob/master/src/main/resources/application.properties
git clone https://github.com/didinj/springboot-mongodb-security.git
cd springboot-mongodb-security
gradlew bootRun
There is no 2.1.7.RELEASE version of this plugin available at Maven Central Repository (which is used in your build.gradle script), since this version is outdated. But it's still accessible at Gradle Plugin Repository (https://mvnrepository.com/artifact/org.springframework.boot/org.springframework.boot.gradle.plugin/2.1.17.RELEASE).
So you should either use least available plugin version from Central repository (2.2.0.RELEASE) or add Gradle Plugin Repository to the repositories section of your build.gradle
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
Related
For some unknown reason, when I pulled my project from GitHub, the Android Studio told me this:
"Plugin[id:com.android.application',version'7.3.2',apply:false]was not found in any of the following sources:
And in the build file build.gradle it's only this:
I repeat I just only pull my project from GitHub:
Also, I have this exception:
org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'com.android.application', version: '7.3.2', apply: false] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'com.android.application:com.android.application.gradle.plugin:7.3.2')
Searched in the following repositories:
Gradle Central Plugin Repository
Google
MavenRepo
I tried to update both android studio versions, but the problem was still there. I tried copying the manifest cause it was incomplete for some reason, and it only created more errors.
I'am using sonar preview mode in maven project, but when dependencies are downloaded , sonarsource use JFrog Jcenter repository as a mirror of our central repositories, but it doesn't contain all dependencies
logs:
[DEBUG] Using mirror x-maven-central (https://company-url.com/jcenter/) for central (https://company-url.com/x-mvn-delivered).
then I have a warnning:
[WARNING] The POM for com.x.x.http:com.x.as.keycloak.jaxrs.adapter:jar:4.0.6 is missing, no dependency information available
then I got errors for missing dependencies like:
Could not find artifact x.x.x.as.keycloak.jaxrs.adapter:jar:4.0.6 in maven-central (https://company-url.com/jcenter/)
is there a way to disable using this mirror?
Check your maven settings.xml for what mirrors or repos you have.
Normally this file can be found at ~/.m2/settings.xml
or if you download / unzip maven it would be something like:
apache-maven-3.5.0/conf/settings.xml
You can also try to run the dependency resolve on the command line manually:
mvn dependency:resolve
I have a grails plugin project and want to make a jar which I then include into my grails project.
Here is the plugin project: https://github.com/ticketbis/grails-groobalize
I did:
grails package-plugin --binary
To get the file: grails-plugin-groobalize-0.1.12.jar.
In my grails project's BuildConfig.groovy I did:
dependencies {
compile "com.ticketbis:groobalize:0.1.12"
}
When I run grails refresh-dependencies I get the following error:
Error |
There was an error loading the BuildConfig: Bad artifact coordinates :groobalize:0.1.12, expected format is <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version> (Use --stacktrace to see the full trace)
How do I install the locale plugin jar into ma grails project correctly?
There are a few ways of doing this.
You can use the release plugin: https://grails.org/plugin/release
Add this plugin to your grails plugin and then do a publish. The plugin will then be added to your local maven repo.
The you could add the dependency in your main grails project as you
have already done.
Other way around is to checkout the plugin project, include the location in your main grails project like below.
BuildConfig.groovy
grails.plugin.location.'your-plugin' = "<location-your-plugin>"
This line will compile your plugin every time you compile your main grails project.
There may be other ways too.
I am trying to maintain the same repository on my filesystem for maven and gradle. But I am running into some problems.
I have the following in my build.gradle file.
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
compile group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.3.9'
runtime group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.3.9'
runtime 'org.xerial:sqlite-jdbc:3.8.7'
}
GRADLE_HOME is D:\Programming\Java\gradle-2.2.1
GRADLE_USER_HOME is D:\Programming\Java\.m2
My gradle home is the same as my Maven repository.
But when the dependencies are downloaded via gradle they are being downloaded into the GRADLE_USER_HOME\cache instead of the repository folder. What configuration am I missing?
EDIT
I have checked the chapter on dependency management of the book Gradle In Action. Nothing. I have checked the dependency management on gradle's website but it also just says that cache is used.
It seems that there is no such option available in gradle. Can someone confirm?
There is no setting to change that. There is no gradle repository as such. Also, it seems like a bad idea to have gradle use the repository's folder as dependency cache because of the clutter.
If you are trying to publish artifacts built by gradle to said maven repository, you should probably take a look at the maven-publish plugin.
If you are trying to use artifacts from that repository in your build, the way to go would be to add mavenLocal() to your repositories and then just use the compile function in your dependencies.
Yes, I read the source code and just confirmed There is no setting to change that.
Here is my solution:
install a local maven repository manager like Nexus.
config gradle using that repository.
I have following build.gradle file:
apply plugin: 'java'
apply plugin: 'eclipse'
sourceCompatibility = 1.7
version = '1.0'
repositories {
mavenCentral()
}
dependencies {
compile 'org.springframework:spring-core:4.1.1.RELEASE'
compile 'org.springframework:spring-context:4.1.1.RELEASE'
testCompile group: 'junit', name: 'junit', version: '4.+'
}
I run following command:
$ gradle --refresh-dependencies
But it does nothing. The dependencies do not get updated and do not reflect on classpath. The output from command is:
:help
Welcome to Gradle 2.1.
To run a build, run gradle <task> ...
To see a list of available tasks, run gradle tasks
To see a list of command-line options, run gradle --help
BUILD SUCCESSFUL
Total time: 5.999 secs
Doing this via Eclipse gradle plugin is working though.
gradle --refresh-dependencies <task>
I am using Gradle 2.9 and I use this for force refresh:
gradle build --refresh-dependencies
You should first clean with gradle clean and then gradle eclipse finally go to project in eclipse and refresh the project, it works for my.
for gradle refresh to perform , run the below command via command prompt
gradle --refresh-dependencies clean build
If you want to fetch dependencies without running build (or all the tasks), you could use dependency-verification:
gradle --write-verification-metadata sha256 help
Note that as explained here:
it’s an approximation of what dependencies could be downloaded during
a build. In particular, if a task uses what we call a “detached
configuration” (a dynamic dependency graph at execution time), then
those dependencies will not be downloaded, because they are opaque to
Gradle.
If you have multiple projects then and want to execute only on one project the clean-eclipse (without quotation marks)
gradle 'project name':clean 'project name':eclipse --refresh-dependencies
after you just refresh the project in your IDE.