Gradle Not Resolving org.springframework.cloud:spring-cloud-aws-messaging - amazon-web-services

Good day all, I'm having problems with gradle pulling the org.springframework.cloud spring-cloud-dependencies.
gradle.properties:
springBootVersion=2.7.5
springCloudVersion=2021.0.5
log4j2Version=2.17.2
slf4jVersion=1.7.30
build.gradle:
dependencies {
annotationProcessor 'org.springframework.boot:spring-boot-configuration-
processor'
annotationProcessor 'org.projectlombok:lombok'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation('org.springframework.cloud:spring-cloud-aws-messaging') {
exclude group: 'org.springframework.cloud', module: 'spring-cloud-aws-
autoconfigure'
}
implementation 'com.fasterxml.jackson.core:jackson-annotations'
implementation 'io.swagger:swagger-annotations:1.6.0'
implementation 'org.openapitools:jackson-databind-nullable:0.2.1'
implementation "javax.annotation:jsr250-api:1.0"
implementation('org.springframework.boot:spring-boot-starter-hateoas') {
exclude module: 'spring-boot-starter'
}
implementation 'org.springframework:spring-beans'
implementation 'org.springframework:spring-context'
implementation 'org.springframework:spring-tx'
implementation 'org.springframework:spring-aspects'
implementation 'com.amazonaws:aws-java-sdk-dynamodb'
implementation 'com.amazonaws:aws-java-sdk-sqs'
implementation 'io.micrometer:micrometer-registry-prometheus'
runtimeOnly 'com.amazonaws:aws-java-sdk-cloudwatchmetrics'
// Remediation of Log4j implementation
implementation "org.apache.logging.log4j:log4j-api:${log4j2Version}"
implementation "org.apache.logging.log4j:log4j-core:${log4j2Version}"
implementation "org.apache.logging.log4j:log4j-slf4j-impl:${log4j2Version}"
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
// Required if generating JSR-303 annotations
compile 'javax.validation:validation-api'
// Required if generating Jackson 2 annotations
compile 'com.fasterxml.jackson.core:jackson-databind'
annotationProcessor 'org.projectlombok:lombok'
implementation 'com.fasterxml.jackson.core:jackson-annotations'
compileOnly 'org.projectlombok:lombok'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'com.fasterxml.jackson.core:jackson-databind'
testImplementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
implementation project(":crew-java-app-notify-flight-contract")
implementation project(":crew-java-app-notify-flight-jaxb")
implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
According to the documentation the spring cloud and boot versions should be compatible. I'm getting the following errors: * What went wrong:
Execution failed for task ':crew-java-app-notify-flight-service:compileJava'.
Could not resolve all files for configuration ':crew-java-app-notify-flight-service:compileClasspath'.
Could not find org.springframework.cloud:spring-cloud-aws-messaging:.
Required by:
project :crew-java-app-notify-flight-service
Could not find com.amazonaws:aws-java-sdk-dynamodb:.
Required by:
project :crew-java-app-notify-flight-service
Could not find com.amazonaws:aws-java-sdk-sqs:.
Required by:
project :crew-java-app-notify-flight-service (edited)

Related

How to fix Android NDK app crash with UnsatisfiedLinkError when loading protobuf-lite.so on Android 6.0?

I have created an Android application with a custom C++ library that depends on Google's protobuf-lite library. It works fine on all the recent devices I have tried to run it on (under Android 7, 8 and 8.1). However, I found that on older devices running Android 6.0.1 or 6.0 (Asus Nexus 7 and some old Motorola phone), the application crashes on loading the libprotobuf-lite.so dependency.
Here is the stacktrace I get:
E/AndroidRuntime: FATAL EXCEPTION:
main Process: com.mycompany.core, PID: 11582 java.lang.UnsatisfiedLinkError:
dlopen failed: cannot locate symbol "__aeabi_memmove8" referenced by "/data/app/com.mycompany.core-2/lib/arm/libprotobuf-lite.so"...
at java.lang.Runtime.loadLibrary(Runtime.java:372)
at java.lang.System.loadLibrary(System.java:1076)
at com.mycompany.core.CameraTestActivity.<clinit>(CameraTestActivity.java:46)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1067)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2317)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)$
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
This is really weird because the missing symbol "__aeabi_memmove8" appears to be a low-level standard library feature and I do not really grasp why it would not be found on Android 6.
In addition, I am quite confident that the issue comes from protobuf-lite not linking correctly because previous versions of my app, which were not using protobuf, ran fine on these Android 6 devices.
Below are some details on my config.
Protobuf version: 3.6.1
Lib package cross-compiled from source using Cmake GUI, NDK r18 toolchain and MinGW
Devices' ABI: armeabi-v7a
Android SDK compile version: API 28
Application build toolchain : Gradle + CMake.
Android Studio 3.1.3
Here is my build.gradle file:
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.mycompany.core"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags "-frtti -fexceptions"
}
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
ndk{
abiFilters "arm64-v8a", "armeabi-v7a"
}
}
debug {
ndk{
abiFilters "arm64-v8a", "armeabi-v7a"
}
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "android.arch.lifecycle:extensions:1.1.0"
implementation "android.arch.lifecycle:viewmodel:1.1.0"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
And here is my CMakeLists.txt file:
cmake_minimum_required(VERSION 3.4.1)
include_directories(src/main/cpp/protobuf/include)
file(GLOB SRCS
"src/main/cpp/core/*.cpp"
)
file(GLOB JNI_SRCS
"src/main/cpp/jni/*.cpp"
)
add_library(mycorelib SHARED ${SRCS} ${JNI_SRCS})
find_library(log-lib log)
add_library(libprotobuf-lite SHARED IMPORTED)
set_target_properties(libprotobuf-lite
PROPERTIES IMPORTED_LOCATION
${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libprotobuf-lite.so)
target_link_libraries(mycorelib
android
jnigraphics
${log-lib}
libprotobuf-lite)
Has anyone run into this problem before? Any hint on how to fix this would be greatly appreciated.
This is https://android.googlesource.com/platform/ndk/+/master/docs/user/common_problems.md#cannot-locate-symbols.
Your protobuf library was built for a higher minSdkVersion than the rest of your app, and cannot run on the device you're using.
You need to change the version of the NDK that you are using. The article below suggests that moving to NDK 22 or newer will fix this.
unable to run on Android 6.0 after 7b77c0acedf708749b68304cc5f0ac469c9d7136

How to create separate tests with Gradle and Kotlin?

I am working on a Kotlin project with Gradle that includes unit tests. I want to add some integration tests (or functional tests, never understood the difference between the two), but I want to be able to run them independently. Ideally, the source of the tests are in different folders.
I am using Gradle 4.5 and my build.gradle file looks something like this :
buildscript {
ext.kotlin_version = '1.2.21'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'kotlin'
apply plugin: 'application'
mainClassName = 'xyz.bobdudan.myproject.AppKt'
repositories {
maven { url "http://maven.stardog.com" }
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
testCompile 'io.kotlintest:kotlintest:2.0.7'
}
I have tried the method described here for java, but it doesn't work : the task also runs the unit tests, but they can't be found, and the integration tests are not executed at all.
What can i do ?
Edit :
Here is the result of gradle clean integTest with the solution of #lance-java:
:clean
:compileIntegTestKotlin
:compileIntegTestJava NO-SOURCE
:processIntegTestResources NO-SOURCE
:integTestClasses UP-TO-DATE
:integTest NO-SOURCE
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.5/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 1s
2 actionable tasks: 2 executed
So nothing is executed (I make sure that the tests are supposed to fail)
Note: I'm not a kotlin dev so will write in groovy.
You can add another SourceSet which will automatically add a JavaCompile task for the SourceSet and also a few Configuration instances to the model (eg integTestCompile, integTestCompileOnly, integTestRuntime etc)
sourceSets {
integTest {
java.srcDir 'src/integTest/java'
resources.srcDir 'src/integTest/resources'
}
}
configurations {
integTestCompile.extendsFrom compile
}
Then you can add another Test task
task integTest(type: Test) {
testClassesDir = sourceSets.integTest.output.classesDir
classpath = sourceSets.integTest.runtimeClasspath
}
You may wish to wire the integTest task into the normal DAG, or perhaps you'll leave this off and call it explicitly
check.dependsOn integTest
To tell long story short you have to:
create separate source sets,
create testTask for each test source,
set it up,
define order these tasks should be executed during build/check
and you are good to go.
Here is a guide in an answer to another question about how to do this for project using JUnit5 and Kotlin Spek test framework.

I wrote a android app using aws mobile hub for usersign using facebook and google, but getting error

I'am using Aws Mobile Hub to build an android application which provides facebook and Googlelogin button. I added these features using Aws mobile hub and downloaded a Sample App.When I run the application i'm getting the below mentioned error.
E/SignInView: Couldn't construct the object. Class com.amazonaws.mobile.auth.facebook.FacebookButton is not found. Please import the appropriate dependencies: com.amazonaws.mobile.auth.facebook.FacebookButton
java.lang.NoSuchMethodException: <init> [class android.content.Context]
at java.lang.Class.getConstructor0(Class.java:2204)
at java.lang.Class.getConstructor(Class.java:1683)
at com.amazonaws.mobile.auth.ui.SignInView.createDependencyObject(SignInView.java:420)
at com.amazonaws.mobile.auth.ui.SignInView.addSignInButtonsToView(SignInView.java:502)
at com.amazonaws.mobile.auth.ui.SignInView.setUpSignInButtons(SignInView.java:282)
at com.amazonaws.mobile.auth.ui.SignInView.<init>(SignInView.java:317)
at com.amazonaws.mobile.auth.ui.SignInView.<init>(SignInView.java:159)
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
at android.view.LayoutInflater.createView(LayoutInflater.java:652)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:794)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:734)
at android.view.LayoutInflater.inflate(LayoutInflater.java:496)
at android.view.LayoutInflater.inflate(LayoutInflater.java:427)
at android.view.LayoutInflater.inflate(LayoutInflater.java:378)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at com.amazonaws.mobile.auth.ui.SignInActivity.onCreate(SignInActivity.java:113)
at android.app.Activity.performCreate(Activity.java:6955)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
E/SignInView: Cannot construct an object of SignInButton com.amazonaws.mobile.auth.facebook.FacebookButton
E/SignInView: Couldn't construct the object. Class com.amazonaws.mobile.auth.google.GoogleButton is not found. Please import the appropriate dependencies: com.amazonaws.mobile.auth.google.GoogleButton
java.lang.NoSuchMethodException: <init> [class android.content.Context]
at java.lang.Class.getConstructor0(Class.java:2204)
at java.lang.Class.getConstructor(Class.java:1683)
at com.amazonaws.mobile.auth.ui.SignInView.createDependencyObject(SignInView.java:420)
at com.amazonaws.mobile.auth.ui.SignInView.addSignInButtonsToView(SignInView.java:502)
at com.amazonaws.mobile.auth.ui.SignInView.setUpSignInButtons(SignInView.java:282)
at com.amazonaws.mobile.auth.ui.SignInView.<init>(SignInView.java:317)
at com.amazonaws.mobile.auth.ui.SignInView.<init>(SignInView.java:159)
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
at android.view.LayoutInflater.createView(LayoutInflater.java:652)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:794)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:734)
at android.view.LayoutInflater.inflate(LayoutInflater.java:496)
at android.view.LayoutInflater.inflate(LayoutInflater.java:427)
at android.view.LayoutInflater.inflate(LayoutInflater.java:378)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at com.amazonaws.mobile.auth.ui.SignInActivity.onCreate(SignInActivity.java:113)
at android.app.Activity.performCreate(Activity.java:6955)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
E/SignInView: Cannot construct an object of SignInButton com.amazonaws.mobile.auth.google.GoogleButton
I have added all the dependencies perfectly. Below is build.gradle file
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile fileTree(include: ['*.jar'], dir: 'app/libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//Ormlite
compile('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
//compile files('libs/YouTubeAndroidPlayerApi.jar')
//compile 'com.github.nisrulz:screenshott:2.0.0'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.android.support:mediarouter-v7:26.1.0'
compile 'com.android.support:animated-vector-drawable:26.1.0'
//compile 'com.android.support:percent:26.1.0'
compile 'com.android.support:customtabs:26.1.0'
compile 'com.android.support:preference-v7:26.1.0'
compile 'com.android.support:preference-v14:26.1.0'
compile 'com.google.firebase:firebase-messaging:11.6.2'
compile 'com.google.firebase:firebase-core:11.6.2'
compile 'com.google.firebase:firebase-database:11.6.2'
compile 'com.google.firebase:firebase-auth:11.6.2'
compile 'com.google.firebase:firebase-config:11.6.2'
compile 'com.google.firebase:firebase-ads:11.6.2'
compile 'com.facebook.android:facebook-android-sdk:4.25.0'
compile 'com.facebook.android:audience-network-sdk:4.25.0'
compile 'com.google.android.gms:play-services-auth:11.6.2'
//compile 'com.google.android.gms:play-services-awareness:11.6.2'
compile 'com.android.support:multidex:1.0.2'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.blankj:utilcode:1.5.1'
compile 'com.j256.ormlite:ormlite-android:5.0'
compile 'com.j256.ormlite:ormlite-core:5.0'
compile 'com.airbnb.android:lottie:2.2.5'
compile 'com.github.lsjwzh.RecyclerViewPager:lib:v1.1.2#aar'
//compile 'com.github.lsjwzh.RecyclerViewPager:tablayoutsupport:v1.1.2#aar'
compile 'com.evernote:android-job:1.2.1'
compile 'com.makeramen:roundedimageview:2.2.1'
annotationProcessor 'com.jakewharton:butterknife:8.8.1'
compile 'com.jakewharton:butterknife:8.8.1'
compile 'com.mindorks:placeholderview:0.7.2'
compile 'jp.wasabeef:glide-transformations:2.0.2'
/*compile 'com.specyci:residemenu:1.6+'*/
//compile 'me.biubiubiu.justifytext:library:1.1'
compile 'com.haozhang.libary:android-slanted-textview:1.2'
//compile 'com.southernbox:RippleLayout:0.1.0'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.squareup.okhttp3:okhttp:3.8.1'
//compile 'com.fivehundredpx:blurringview:1.0.0'
compile 'pub.devrel:easypermissions:1.0.1'
compile 'com.github.jd-alexander:LikeButton:0.2.3'
testCompile 'junit:junit:4.12'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation project(':nineoldandroids-library-2.4.0')
//Cognito Related dependencies
compile 'com.amazonaws:aws-android-sdk-core:2.6.+'
compile 'com.amazonaws:aws-android-sdk-pinpoint:2.6.+'
compile('com.amazonaws:aws-android-sdk-mobile-client:2.6.+#aar')
{ transitive = true; }
compile('com.amazonaws:aws-android-sdk-auth-core:2.6.+#aar') {
transitive = true;
}
compile('com.amazonaws:aws-android-sdk-auth-ui:2.6.+#aar') {
transitive = true;
}
compile('com.amazonaws:aws-android-sdk-auth-facebook:2.6.+#aar') {
transitive = true;
}
compile('com.amazonaws:aws-android-sdk-auth-google:2.6.+#aar') {
transitive = true;
}
I even checked in the issue section of github repository of AWS, but couldn't find anything. Also i googled the issue, but no luck. Could you please help me to resolve this issue.

Slow build gradle in android

I checked all of the questions with answers about slow gradle build . (For Example here , here and ...) .but build gradle in my project is too slow . sometimes which building takes about 5-8 minuets , i searched in many sites , and now im tired
Build.gradle :
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "..."
minSdkVersion 14
targetSdkVersion 24
versionCode 1
versionName "1.0"
jackOptions {
enabled true
additionalParameters('jack.incremental': 'true')
}
dexOptions {
incremental true
javaMaxHeapSize "4g"
}
}
compileOptions {
incremental true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12'
compile files('libs/TelegramNewApiLibrary.jar')
compile files('libs/TelegramNewConvert.jar')
}
repositories {
mavenCentral()
}
build.gradle(Module app):
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
gradle.properties :
org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.daemon = true
my Anti-Virus is disabled and work offline is enable in project.
System Ram : 4G
System CPU : 3.10 GH
Android Studio Version : 2.2.3
any one can help me ?
Try to update AndroidStudio to 3.0, upgrade gradle gradle:2.2.3 => gradle:3.0.0 and buildtools buildToolsVersion '25.0.2' => buildToolsVersion '26.0.2'
Understand that Gradle Build has nothing to do with your CPU Speed or RAM. The reason why the Build gets slower in your PC is due to your Internet Connection. The build can take nearly ~100 MB approx. of data to complete it's process. Even if your Internet Connection is fast and your connection's PING speed is slow, it takes more time. Thanks for your time.

Sonarqube task in Gradle does not produce test coverage

I have multi-project Gradle script. I added to the root project:
buildscript {
repositories{
...
}
dependencies { classpath("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.2.1") }
}
apply plugin: org.sonarqube.gradle.SonarQubePlugin
sonarqube {
properties {
property "sonar.junit.reportsPath", "$projectDir/build/test-results/test"
property "sonar.host.url", "http://localhost:9000"
property "sonar.verbose", "true"
}
}
Sonarqube shows the correct number of tests, but coverage is 0.
I use Gradle 3.0, Java 1.8.0_45, Sonarqube 6.1.
Gradle console shows many "Class not found" messages.
Gradle console also shows message:
"Reports path contains no files matching TEST-.*.xml :
myPath\build\test-results\test"
, which is correct, since that particular project does not have any tests.
In my child project, I have:
apply plugin: 'java'
apply plugin: "jacoco"
jacocoTestReport {
reports {
xml.enabled = true
}
}
check.dependsOn jacocoTestReport
Run Gradle task "sonarqube" of the root project.
No SonarQube Analyzer or plugin executes your tests or the coverage calculation for you. You must do those things before analysis and feed the resulting report(s) into your analysis.