Building app with spring-boot + Cassandra, getting "Unable to load class 'com.datastax.oss.driver.api.mapper.entity.naming.GetterStyle'" - spring-boot

Facing isssue while integration with datastax with cassandra
gradle file :
plugins {
id 'org.springframework.boot' version '2.3.12.RELEASE'
id 'io.spring.dependency-management' version '1.0.13.RELEASE'
id 'java'
id 'org.sonarqube' version '3.2.0'
}
group = 'in.demo'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
def javaDriverVersion ='4.14.1'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation ('org.springframework.boot:spring-boot-starter')
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation('org.springframework.boot:spring-boot-starter-web') {
exclude module: 'spring-boot-starter-tomcat'
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-annotations'
}
implementation('org.springframework.boot:spring-boot-starter-jetty')
implementation('org.springframework.boot:spring-boot-starter-webflux')
runtimeOnly('org.springframework.boot:spring-boot-devtools')
// datastax driver
implementation group: 'com.datastax.oss', name: 'java-driver-core', version: javaDriverVersion
implementation group: 'com.datastax.oss', name: 'java-driver-query-builder', version: javaDriverVersion
//implementation group: 'com.datastax.oss', name: 'java-driver-mapper-runtime', version: javaDriverVersion
implementation group: 'com.datastax.oss', name: 'native-protocol', version: '1.5.0'
annotationProcessor group: 'com.datastax.oss', name: 'java-driver-mapper-processor', version: javaDriverVersion
//compileOnly group: 'com.datastax.oss', name: 'java-driver-mapper-processor', version: '4.14.1'
compileOnly group: 'com.datastax.oss', name: 'java-driver-mapper-runtime', version: javaDriverVersion
implementation 'org.mapstruct:mapstruct:1.3.1.Final'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.3.1.Final'
}
tasks.named('test') {
useJUnitPlatform()
}
#Data
#AllArgsConstructor
#NoArgsConstructor
#Entity(defaultKeyspace = "quest_test")
public class TestTable {
private UUID id;
private String name;
}
import com.datastax.oss.driver.api.mapper.annotations.Dao;
import com.datastax.oss.driver.api.mapper.annotations.Select;
#Dao
public interface TestTableDao {
#Select
TestTable findById();
}
import com.datastax.oss.driver.api.mapper.annotations.DaoFactory;
import com.datastax.oss.driver.api.mapper.annotations.Mapper;
#Mapper
public interface TestTableMapper {
#DaoFactory
TestTableDao testTableDao();
}
getting error
Unable to load class 'com.datastax.oss.driver.api.mapper.entity.naming.GetterStyle'.
i tried to interaction with different project also but still not able to solve issue
. for testing part i added library mappstruct which is generation code on compile time

With drivers 4x+, you need to declare an annotation processor for the mappers code to be generated at build time.
Gradle file
dependencies {
annotationProcessor group: 'com.datastax.oss', name: 'java-driver-mapper-processor', version: javaDriverVersion
compile group: 'com.datastax.oss', name: 'java-driver-mapper-runtime', version: javaDriverVersion
}
Documentation
Here more code to work with Driver 4x
You might be interested in the full-fledged Spring PetClinic application running with your technical stack.

Related

Show Results/Outcomes Failed Asserts Junit, Cucumber on Console

I found this similar Question but is related to Eclipse, I'm using Visual Studio Code Version: 1.72.2 on macOS.
Here my build.gradle file
plugins {
id 'java'
}
group 'CursoUdemy'
version '1.0-SNAPSHOT'
sourceCompatibility = 13
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.9.1'
implementation group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '4.5.0'
implementation group: 'io.cucumber', name: 'cucumber-java', version: '7.8.1'
testImplementation group: 'io.cucumber', name: 'cucumber-junit', version: '7.8.1'
testImplementation group: 'org.slf4j', name: 'slf4j-simple', version: '2.0.3'
}
I found that is possible to share... but I would like only to see the local Outcomes in my console.
Is this related to version of some dependency? In that case... Which?
Some clue in order to show the results in my console?
https://code.visualstudio.com/docs/languages/java#_testing
https://www.tapqa.com/html-tables-cucumber-datatables/

Upgrade from oracle-r2dbc version 0.4.0 to 1.0.0 is resulting in class cast exception while update

I was trying to upgrade R2DBC from 0.4.0 to 1.0.0.
while doing that I am getting error in update which was working fine in version 0.4.0.
Build.gradle that I am using
plugins {
id 'org.springframework.boot' version '2.7.2'
id 'io.spring.dependency-management' version '1.0.12.RELEASE'
id 'java'
}
group = '<group>'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
repositories {
maven {
url "https://nexus/repository/maven-public/"
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
dependencies {
implementation ('org.springframework.boot:spring-boot-starter-actuator:2.7.4') {
exclude group: 'org.springframework.boot', module: 'spring-boot'
}
implementation 'org.springframework.boot:spring-boot:2.7.4'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa:2.7.4'
implementation ('org.springframework.boot:spring-boot-starter-data-r2dbc:2.7.4') {
exclude group: 'io.r2dbc', module: 'r2dbc-spi'
exclude group: 'io.r2dbc', module: 'r2dbc-pool'
exclude group: 'org.springframework.data', module: 'spring-data-r2dbc'
exclude group: 'io.projectreactor', module: 'reactor-core'
exclude group: 'org.springframework.boot', module: 'spring-boot-starter'
}
implementation 'io.r2dbc:r2dbc-spi:1.0.0.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter:2.7.4'
implementation ('io.r2dbc:r2dbc-pool:1.0.0.RC1') {
exclude group: 'io.projectreactor', module: 'reactor-core'
}
implementation ('org.springframework.data:spring-data-r2dbc:1.5.3') {
exclude group: 'org.springframework', module: 'spring-r2dbc'
exclude group: 'io.r2dbc', module: 'r2dbc-spi'
exclude group: 'io.projectreactor', module: 'reactor-core'
exclude group: 'org.springframework.data', module: 'spring-data-commons'
exclude group: 'org.springframework.data', module: 'spring-data-relational'
exclude group: 'org.springframework', module: 'spring-tx'
exclude group: 'org.springframework', module: 'spring-context'
exclude group: 'org.springframework', module: 'spring-beans'
exclude group: 'org.springframework', module: 'spring-core'
}
implementation 'org.springframework.data:spring-data-commons:2.7.3'
implementation 'org.springframework.data:spring-data-relational:2.4.3'
implementation 'org.springframework:spring-tx:5.3.23'
implementation 'org.springframework:spring-context:5.3.23'
implementation 'org.springframework:spring-beans:5.3.23'
implementation 'org.springframework:spring-core:5.3.23'
implementation ('org.springframework:spring-r2dbc:5.3.23') {
exclude group: 'io.r2dbc', module: 'r2dbc-spi'
exclude group: 'io.projectreactor', module: 'reactor-core'
}
implementation 'io.projectreactor:reactor-core:3.4.23'
implementation ('com.oracle.database.r2dbc:oracle-r2dbc:1.0.0') {
exclude group: 'com.oracle.database.jdbc', module: 'ojdbc11'
exclude group: 'io.projectreactor', module: 'reactor-core'
}
implementation ('org.springframework.boot:spring-boot-starter-webflux') {
exclude group: 'io.projectreactor', module: 'reactor-core'
exclude group: 'org.springframework.boot', module: 'spring-boot-starter'
}
implementation files('./lib/eagle_commons-0.0.1-SNAPSHOT-plain.jar')
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.projectlombok:lombok'
implementation ('sg.com.gic:crypto-lib:1.0.5') {
exclude group: 'slf4j', module: 'slf4j-api'
exclude group: 'ch.qos.logback', module: 'logback-core'
exclude group: 'ch.qos.logback', module: 'logback-classic'
}
implementation group: 'com.oracle.database.jdbc', name: 'ojdbc11', version: '21.7.0.0'
implementation group: 'org.springdoc', name: 'springdoc-openapi-webflux-ui', version: '1.6.11'
implementation group: 'org.modelmapper', name: 'modelmapper', version: '3.1.0'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.projectreactor:reactor-test'
}
tasks.named('test') {
useJUnitPlatform()
}
Below is the SQL Update Query from R2dbcRepository Repository:
#Modifying
#Query(value = "UPDATE <Table_name> SET PARAM_VALUE=:paramValue WHERE BATCH_ID=:batchId and PARAM_NAME=:paramName")
Mono<Integer> updateODADateParam(String paramValue, String batchId, String paramName);
Error Log:
2022-10-05 09:47:37,080 DEBUG [ForkJoinPool.commonPool-worker-3] org.springframework.r2dbc.core.DefaultDatabaseClient$DefaultGenericExecuteSpec: Executing SQL statement [UPDATE <table_name> SET PARAM_VALUE=:P0_paramValue WHERE BATCH_ID=:P1_batchId and PARAM_NAME=:P2_paramName]
2022-10-05 09:47:37,121 ERROR [ForkJoinPool.commonPool-worker-7] com.gic.eagle.txnHld.handler.RESIBatchDateHandler: Error [class java.lang.Long cannot be cast to class java.lang.Integer (java.lang.Long and java.lang.Integer are in module java.base of loader 'bootstrap')]
java.lang.ClassCastException: class java.lang.Long cannot be cast to class java.lang.Integer (java.lang.Long and java.lang.Integer are in module java.base of loader 'bootstrap')
at java.base/java.util.stream.Collectors.lambda$summingInt$19(Collectors.java:673)
at reactor.core.publisher.MonoStreamCollector$StreamCollectorSubscriber.onNext(MonoStreamCollector.java:132)
at reactor.core.publisher.FluxFlatMap$FlatMapMain.tryEmit(FluxFlatMap.java:543)
at reactor.core.publisher.FluxFlatMap$FlatMapInner.onNext(FluxFlatMap.java:984)
at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:200)
at reactor.core.publisher.FluxConcatArray$ConcatArrayDelayErrorSubscriber.onNext(FluxConcatArray.java:364)
at reactor.core.publisher.FluxFilterFuseable$FilterFuseableSubscriber.onNext(FluxFilterFuseable.java:118)
at reactor.core.publisher.FluxMapFuseable$MapFuseableConditionalSubscriber.onNext(FluxMapFuseable.java:299)
at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2398)
at reactor.core.publisher.FluxMapFuseable$MapFuseableConditionalSubscriber.request(FluxMapFuseable.java:360)
at reactor.core.publisher.FluxFilterFuseable$FilterFuseableSubscriber.request(FluxFilterFuseable.java:191)
at reactor.core.publisher.FluxConcatArray$ConcatArrayDelayErrorSubscriber.request(FluxConcatArray.java:461)
at reactor.core.publisher.FluxPeek$PeekSubscriber.request(FluxPeek.java:138)
at reactor.core.publisher.FluxFlatMap$FlatMapInner.onSubscribe(FluxFlatMap.java:964)
at reactor.core.publisher.FluxPeek$PeekSubscriber.onSubscribe(FluxPeek.java:171)
at reactor.core.publisher.FluxConcatArray$ConcatArrayDelayErrorSubscriber.onSubscribe(FluxConcatArray.java:350)
at reactor.core.publisher.FluxFilterFuseable$FilterFuseableSubscriber.onSubscribe(FluxFilterFuseable.java:87)
at reactor.core.publisher.FluxMapFuseable$MapFuseableConditionalSubscriber.onSubscribe(FluxMapFuseable.java:265)
at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:55)
at reactor.core.publisher.Flux.subscribe(Flux.java:8466)
at reactor.core.publisher.FluxConcatArray$ConcatArrayDelayErrorSubscriber.onComplete(FluxConcatArray.java:443)
at reactor.core.publisher.FluxConcatArray.subscribe(FluxConcatArray.java:73)
at reactor.core.publisher.Flux.subscribe(Flux.java:8466)
at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:426)
at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539)
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:122)
at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onNext(MonoFlatMapMany.java:250)
at reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.onNext(FluxUsingWhen.java:345)
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:200)
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:122)
at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.onNext(FluxConcatArray.java:201)
at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onNext(MonoFlatMapMany.java:250)
at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2398)
at reactor.core.publisher.MonoFlatMapMany$FlatMapManyMain.onSubscribeInner(MonoFlatMapMany.java:150)
at reactor.core.publisher.MonoFlatMapMany$FlatMapManyMain.onNext(MonoFlatMapMany.java:189)
at reactor.core.publisher.MonoCreate$DefaultMonoSink.success(MonoCreate.java:172)
at oracle.r2dbc.impl.AsyncLock.lambda$get$2(AsyncLock.java:167)
at oracle.r2dbc.impl.AsyncLock.unlock(AsyncLock.java:125)
at oracle.r2dbc.impl.AsyncLock$UsingConnectionSubscriber.terminate(AsyncLock.java:516)
at oracle.r2dbc.impl.AsyncLock$UsingConnectionSubscriber.onComplete(AsyncLock.java:502)
at reactor.core.publisher.StrictSubscriber.onComplete(StrictSubscriber.java:123)
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onComplete(Operators.java:2058)
at org.reactivestreams.FlowAdapters$FlowToReactiveSubscriber.onComplete(FlowAdapters.java:221)
at oracle.jdbc.internal.CompletionStageUtil$IteratorSubscription.emitComplete(CompletionStageUtil.java:804)
at oracle.jdbc.internal.CompletionStageUtil$IteratorSubscription.emitItems(CompletionStageUtil.java:751)
at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Originally raised the issue here:
https://github.com/oracle/oracle-r2dbc/issues/97
Got the information from Oracle team that the issue could be same as
https://github.com/oracle/oracle-r2dbc/issues/89
If anybody can point out what is wrong with dependency version, would be helpful.
Thanks
Don't mess around with overrides and manually managing your dependencies. That will only lead to issues. Also using Spring Data R2DBC is tied to specific versions of R2DBC so you cannot simply upgrade, you have to wait for a version that supports that specific version.
If you want to override versions follow the documented approach instead of all the excludes and overrides.
plugins {
id 'org.springframework.boot' version '2.7.4'
id 'io.spring.dependency-management' version '1.0.12.RELEASE'
id 'java'
}
group = '<group>'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
repositories {
maven {
url "https://nexus/repository/maven-public/"
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
ext['oracle-database.version']='21.7.0.0'
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-data-r2dbc'
implementation 'com.oracle.database.r2dbc:oracle-r2dbc'
implementation files('./lib/eagle_commons-0.0.1-SNAPSHOT-plain.jar')
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.projectlombok:lombok'
implementation 'sg.com.gic:crypto-lib:1.0.5'
implementation group: 'com.oracle.database.jdbc', name: 'ojdbc11'
implementation group: 'org.springdoc', name: 'springdoc-openapi-webflux-ui', version: '1.6.11'
implementation group: 'org.modelmapper', name: 'modelmapper', version: '3.1.0'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.projectreactor:reactor-test'
}
tasks.named('test') {
useJUnitPlatform()
}
This will fix all the excludes and incompatible versions. You cannot use R2DBC 1.0.0 with Spring BOot 2.7 (AFAIK) you would need to upgrade to Spring Boot 3.0.0 (as that includes the proper Spring Data version and R2DBC version which isn't compatible with Spring Boot 2.7 as it requires Spring Framework 6, java 17 etc.).
If you want to upgrade, modify the Spring Boot plugin version and everything else should be included automatically.
R2dbc 1.0.0 introduces several breaking changes, esp. some aggregate functions, eg. count returns Long instead of Integer.
I do not think the Spring Boot 2.7.x managed Spring Data R2dbc is ready for R2dbc 1.0.0. The latest Spring Data R2dbc(aligned to R2dbc 1.0.0) is upgraded to Spring Boot 3.0 code base.
Keep to use Spring Boot 2.7.5 and built-in Spring Data R2dbc.
if you want to use the latest R2dbc 1.0.0, consider Spring Boot 3.0.0-RC2, Spring Boot 3.0 is close to GA status.

What is the proper syntax of excluding transient dependencies in gradle, name or module?

I have come across two different variations of syntax to exclude a transient dependency in gradle
One uses name and another uses module. Which one is correct?
For eg:
name:
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation group: 'org.springframework', name: 'spring-context', version: '5.3.19'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation('org.springframework.boot:sprin g-boot-starter-web') {
exclude group: 'org.springframework', name: 'spring-context'
}
}
OR module:
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation group: 'org.springframework', name: 'spring-context', version: '5.3.19'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation('org.springframework.boot:sprin g-boot-starter-web') {
exclude group: 'org.springframework', module: 'spring-context'
}
}
The current documentation (7.4.2) shows module:
https://docs.gradle.org/7.4.2/userguide/dependency_downgrade_and_exclude.html
implementation('commons-beanutils:commons-beanutils:1.9.4') {
exclude group: 'commons-collections', module: 'commons-collections'
}
name is probably a legacy naming. Go with what the current documentation has, module.

running app as jar gives fileNotFoundException

Im attempting to run my spring app as a jar, but i get the below error
java.io.FileNotFoundException: class path resource [org/springframework/web/socket/config/annotation/AbstractWebSocketMessageBrokerConfigurer.class] cannot be opened because it does not exist
It runs fine from intelij(as in my main class can runs using the play button). I find the file under project structure --> Libraries and under external libraries (albeit depracted)
Ive tried to look into it, but everywhere (list of examples below) seem to talk about xml files instead of a class
Spring ClassPathResource - cannot be opened because it does not exist
Class path resource cannot be opened because it does not existHow to avoid "class path resource [...] cannot be opened because it does not exist" in a spring boot application?
java.io.FileNotFoundException: class path resource can't be opened
java.io.FileNotFoundException: class path resource cannot be opened because it does not exist
My gradle file:
plugins {
id 'org.springframework.boot' version '2.2.4.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'war'
id 'groovy'
// id 'java'
}
war {
enabled = true
}
jar {
manifest {
attributes 'Main-Class': 'co.za.ebucks.HandlingRewardsFormSubmission'
}
}
group = 'co.za.ebucks'
version = '1.0.0'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
}
ext {
seleniumVersion = '3.141.59'
}
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
}
test {
useTestNG()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-tomcat'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
// implementation 'org.springframework.session:spring-session-core'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-integration'
implementation 'org.springframework.boot:spring-boot-starter-websocket'
implementation 'org.springframework:spring-messaging'
implementation 'org.springframework.integration:spring-integration-file'
implementation group: 'org.webjars.bower', name: 'angular-ui-router', version: '0.2.8'
implementation group: 'org.webjars', name:'angularjs', version: '1.3.0-beta.11'
implementation group: 'org.webjars', name: 'bootstrap', version: '3.1.1-1'
// implementation 'org.webjars.bower:angular-ui-router'//, version: '1.0.20'
implementation 'commons-io:commons-io'//, version: '2.4'
implementation 'org.apache.commons:commons-dbcp2'//, version: '2.7.0'
implementation 'org.hibernate.validator:hibernate-validator'//, version: '6.1.2.Final'
// implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect'//, version: '2.4.1'
implementation 'javax.servlet:javax.servlet-api'//, version: '4.0.1'
// compile group: 'org.apache.tomcat', name: 'tomcat-jni', version: '9.0.33'
implementation group: 'de.codecentric', name: 'spring-boot-admin-starter-client', version: '2.2.2'
implementation group: 'de.codecentric', name: 'spring-boot-admin-server', version: '2.2.2'
implementation group: 'org.testng', name: 'testng', version: '7.1.0'
implementation group: 'org.codehaus.groovy', name: 'groovy-all', version: '3.0.0'
implementation group: 'com.google.inject', name: 'guice', version: '4.2.2'
implementation group: 'com.google.guava', name: 'guava', version: '28.1-jre'
implementation group: 'cglib', name: 'cglib', version: '3.3.0'
implementation group: 'org.postgresql', name: 'postgresql', version: '42.2.10'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation 'io.projectreactor:reactor-test'
implementation "org.seleniumhq.selenium:selenium-support:${seleniumVersion}"
implementation group: 'io.appium', name: 'java-client', version: '7.3.0'
implementation group: 'org.seleniumhq.selenium', name: 'selenium-java', version: "${seleniumVersion}"
implementation group: 'org.seleniumhq.selenium', name: 'selenium-server', version: "${seleniumVersion}"
implementation group: 'org.seleniumhq.selenium', name: 'selenium-chrome-driver', version: "${seleniumVersion}"
testImplementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.13.0'
testImplementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.13.0'
testImplementation group: 'org.testng', name: 'testng', version: '7.1.0'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
}
And what Im sure is the class in question:
import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import org.springframework.web.socket.config.annotation.StompEndpointRegistry
import org.springframework.web.socket.server.support.DefaultHandshakeHandler;
#Configuration
#EnableWebSocketMessageBroker
class WebSocketDefaultConfig extends AbstractWebSocketMessageBrokerConfigurer {
#Override
void configureMessageBroker(MessageBrokerRegistry config) {
// config.enableStompBrokerRelay("/topic/", "/queue/");
config.enableSimpleBroker("/topic/", "/queue/");
config.setApplicationDestinationPrefixes("/app");
}
#Override
void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/tailfilesep")
// .setAllowedOrigins("*")
// .setHandshakeHandler(new DefaultHandshakeHandler())
.withSockJS()
}
}
Kindly assist me, this has passed frustration. Why is that class not in the jar?
The only thing that worked was creating a new project - copy and pasted all the code, build files everything... lol and its fine.
Intelij corruption somewhere along the line

Gradle Multi Module Project: Apply module dependency to all subprojects except for itself

My application is a Gradle Multi Module Project, consisting of multiple services with one service-common module.
I´ve pulled all dependencies that all modules have in common out into the root build.gradle, and I also want to include the service-common module in all subprojects, which in theory works, but I´m getting a circular dependency issue because it is included in itself.
apply plugin: 'java'
group = 'com.myapplication'
ext {
set('springCloudVersion', "2.2.0.RELEASE")
set('springBootVersion', "2.2.2.RELEASE")
}
allprojects {
repositories {
jcenter()
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
}
}
buildscript {
ext {
springBootVersion = "2.2.2.RELEASE"
}
repositories {
maven { url 'https://repo.spring.io/plugins-snapshot' }
jcenter()
mavenCentral()
}
dependencies {
classpath 'io.spring.gradle:dependency-management-plugin:1.0.7.BUILD-SNAPSHOT'
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
subprojects {
version = '1.0'
apply plugin: 'org.springframework.boot'
apply plugin: "io.spring.dependency-management"
apply plugin: 'java'
ext {
springCloudVersion = "2.2.0.RELEASE"
springBootVersion = "2.2.2.RELEASE"
}
test {
useJUnitPlatform()
}
repositories {
mavenCentral()
jcenter()
maven { url 'https://repo.spring.io/milestone' }
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
dependencies {
compile group: 'org.springframework.boot', name: 'spring-boot-starter', version: "${springBootVersion}"
compile group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: "${springBootVersion}"
compile group: 'org.springframework.boot', name: 'spring-boot-starter-security', version: "${springBootVersion}"
compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: "${springBootVersion}"
compile group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc', version: "${springBootVersion}"
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: "${springBootVersion}"
compile group: 'org.springframework.boot', name: 'spring-boot-starter-logging', version: "${springBootVersion}"
compile group: 'org.springframework.cloud', name: 'spring-cloud-starter', version: "${springCloudVersion}"
compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-kubernetes', version: '1.1.1.RELEASE'
compile group: 'io.micrometer', name: 'micrometer-registry-prometheus', version: '1.3.2'
compile group: 'com.github.piomin', name: 'logstash-logging-spring-boot-starter', version: '1.2.2.RELEASE'
compile group: 'io.springfox', name: 'springfox-swagger2', version: '2.9.2'
compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.9.2'
compileOnly 'org.projectlombok:lombok:1.18.10'
annotationProcessor 'org.projectlombok:lombok:1.18.10'
testCompile group: 'com.h2database', name: 'h2', version: '1.4.200'
compile group: 'org.postgresql', name: 'postgresql', version: '42.2.9'
testCompile group: 'org.springframework.cloud', name: 'spring-cloud-stream-test-support', version: "${springCloudVersion}"
implementation project(":service-common")
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
How can I exclude implementation project(":service-common") for the service-common module?
You can do something like:
subprojects {
dependencies {
if (!project.name == "service-common") {
implementation(project(":service-common"))
}
}
}

Resources