I am trying to use springdoc-openapi-ui using gradle dependency.
Maven
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.4.3</version>
</dependency>
Gradle
plugins {
id 'org.springframework.boot' version '2.3.1.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
}
group = 'fete.bird'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '14'
compileJava {
options.compilerArgs += ["--enable-preview"]
}
repositories {
jcenter()
mavenCentral()
}
ext {
set('springCloudVersion', "Hoxton.SR6")
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-rest'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
implementation 'org.springdoc:springdoc-openapi-ui'
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
implementation 'org.springframework.cloud:spring-cloud-starter-config'
implementation 'org.springframework.kafka:spring-kafka'
implementation 'org.projectlombok:lombok'
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
test {
useJUnitPlatform()
}
Error
Could not find org.springdoc:springdoc-openapi-ui:.
Required by:
project :
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
What is the repository for the gradle?
Try adding the library with latest version in your project
implementation("org.springdoc:springdoc-openapi-ui:1.4.6")
implementation 'org.springdoc:springdoc-openapi-ui' fail with following error Could not find org.springdoc:springdoc-openapi-ui
While following worked
implementation 'org.springdoc:springdoc-openapi-ui:1.6.6'
Related
Hello ladies and gentlemen,
so i was just trying to get a executable for my Spring application by using Spring Native.
My build.gradle:
plugins {
id 'org.springframework.boot' version '2.5.4'
id 'io.spring.dependency-management' version '1.0.10.RELEASE'
id 'java'
id 'org.springframework.experimental.aot' version '0.10.3'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa:2.5.4'
implementation 'org.springframework.boot:spring-boot-starter-web:2.5.4'
compileOnly 'org.projectlombok:lombok:1.18.20'
annotationProcessor 'org.projectlombok:lombok:1.18.20'
testImplementation 'org.springframework.boot:spring-boot-starter-test:2.5.4'
implementation group: 'org.postgresql', name: 'postgresql', version: '42.2.14'
implementation group: 'org.apache.poi', name: 'poi', version: '4.1.2'
implementation group: 'org.apache.poi', name: 'poi-ooxml', version: '4.1.2'
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.14.6'
implementation group: 'org.json', name: 'json', version: '20180813'
}
test {
useJUnitPlatform()
}
and my settings.gradle:
rootProject.name = 'demo'
after adding the 'org.springframework.experimental.aot' version '0.10.3' plugin to the build.gradle as seen above (doing whats told in the documentary under 2.1.2 https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#getting-started), i get following error:
org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'org.springframework.experimental.aot', version: '0.10.3'] 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.experimental.aot:org.springframework.experimental.aot.gradle.plugin:0.10.3')
Searched in the following repositories:
Gradle Central Plugin Repository
The person who commented is right, though I think unnecessarily rude given that the tutorial is out of order, and they tell you to apply the plugin prior to giving you instructions how to install.
More specifically, you need to add the spring release maven repo to your settings.gradle.kts in order to source the plugin
pluginManagement {
repositories {
gradlePluginPortal()
maven { url = uri("https://repo.spring.io/release") }
mavenLocal()
}
}
and then also add the repository to your build.gradle.kts in order to source the dependencies
repositories {
maven { url = uri("https://repo.spring.io/release") }
}
I'm trying to set up a nested multi module project with gradle.
I have the following structure:
stock-client-root
|-- settings.gradle
|-- build.gradle
|-- stock-client
| |-- build.gradle
|-- stock-ui
|-- build.gradle
The problem is, that I cannot import any dependencies that are declared in the build.gradle files except spring boot related things.
Example: I want to use javafx. I declared it in the stock-ui/build.gradle file but when I want to import it in the module, intelliJ tells me, it cannot resolve that dependency.
I tried almost everything to solve this:
Reload the project via gradle
Restart the IDE
Invalidate cache + rebuild project
Created a new project with that structure and tried it again
Can anyone point out, where the problem might be?
And here is the content of the files:
stock-client-root/settings.gradle
rootProject.name = 'stock-client-root'
include 'stock-client'
include 'stock-ui'
stock-client-root/build.gradle
subprojects {
apply plugin: 'java'
group = 'com.demo'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
}
stock-client/build.gradle
plugins {
id 'org.springframework.boot' version '2.4.3'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}
group = 'com.demo'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-webflux'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.projectreactor:reactor-test'
}
test {
useJUnitPlatform()
}
stock-ui/build.gradle
plugins {
id 'org.springframework.boot' version '2.4.3'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}
group = 'com.demo'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
}
dependencies {
implementation group: 'org.openjfx', name: 'javafx-graphics', version: '13.0.1'
implementation 'org.springframework.boot:spring-boot-starter'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
test {
useJUnitPlatform()
}
Am not able to add the spring-cloud-netflix-eureka-server as dependencies in gradle project (IDE Intellij)
please find my build.gradle file below.
plugins {
id 'org.springframework.boot' version '2.3.1.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
id 'war'
}
group = 'com.lti.mod.services'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation('io.jsonwebtoken:jjwt:0.9.1')
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-data-rest'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.liquibase:liquibase-core'
/*compile group: 'io.jsonwebtoken', name: 'jjwt', version: '0.9.1'*/
compile('org.springframework.cloud:spring-cloud-netflix-eureka-server:2.1.5.RELEASE')
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'mysql:mysql-connector-java'
annotationProcessor 'org.projectlombok:lombok'
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation 'org.springframework.security:spring-security-test'
}
test {
useJUnitPlatform()
}
Please find the gradle build messages below.
> Configure project : The compile configuration has been deprecated for dependency declaration. This will fail with an error in Gradle 7.0. Please use the implementation configuration instead. Consult the upgrading guide for further information: https://docs.gradle.org/6.4.1/userguide/upgrading_version_5.html#dependencies_should_no_longer_be_declared_using_the_compile_and_runtime_configurations
at build_5fewyf5k4gqf0wzmewce4q3ow$_run_closure3.doCall(D:\AngularCourse\core-services\build.gradle:30)
(Run with --stacktrace to get the full stack trace of this deprecation warning.)
compile configuration is deprecated in the Gradle 7.0 as your error message says. Please use implementation instead.
Check the docs - https://docs.gradle.org/current/userguide/java_plugin.html#tab:configurations
I am using apollo graphql client in java code. My gradle file is
plugins {
id 'org.springframework.boot' version '2.2.6.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
maven {
url 'http://dl.bintray.com/apollographql/android'
}
}
dependencies {
implementation "com.apollographql.apollo:apollo-android-support:1.0.0"
implementation "com.apollographql.apollo:apollo-runtime:1.0.0"
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
test {
useJUnitPlatform()
}
I have followed the docs mentioned in https://github.com/apollographql/apollo-android
I got stuck at step 4 and 5.
Not able to add
generateKotlinModels.set(false)
}
in gradle file and while executing the command
gradlew generateApollo its getting error as
Task 'generateApolloSources' not found in root project 'testProject'
Could anyone please help
You will need to apply the Apollo plugin:
plugins {
id 'org.springframework.boot' version '2.2.6.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
id 'com.apollographql.apollo' version '2.1.0'
}
You should also bump the Apollo dependencies to '2.1.0' as '1.0.0' is pretty old.
I am facing following issue while building spring boot project with gradle
What went wrong:
A problem occurred evaluating settings 'ConfigurationManager'.
Could not find method pluginManagement() for arguments [settings_4czoxeapfgxghi54ogzhrlgs9$_run_closure1#6e5e4ee] on settings 'ConfigurationManager' of type org.gradle.initialization.DefaultSettings.
Content of settings.gradle is as follows
pluginManagement {
repositories {
gradlePluginPortal()
}
}
rootProject.name = 'ConfigurationManager'
Content of gradle-wrapper.properties is as follows
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Content of build.gradle is as follows
plugins {
id 'org.springframework.boot' version '2.1.6.RELEASE'
id 'java'
id 'war'
}
apply plugin: 'io.spring.dependency-management'
group = 'demo.comp.dept'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-data-ldap'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-web'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
}