What I'm trying to do is to publish a Jar file into the Azure DevOps artifact using Gradle but I got this error massage:
FAILURE: Build failed with an exception.
What went wrong: Task 'publish' not found in root project 'Project1'.
Try: Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 1s
and the Build.gradle file is this:
apply plugin: 'java'
apply plugin: 'maven-publish'
publishing {
publications {
myPublication(MavenPublication) {
groupId 'soft'
artifactId 'crypto-utils'
version '5.2.0'
artifact 'C:\Users\d\Desktop\Project1\crypto-utils-5.2.0.jar'
}
}
// Repositories *to* which Gradle can publish artifacts
repositories {
maven {
url 'https://pkgs.dev.azure.com/soft/pm/_packaging/myFeed/maven/v1'
credentials {
username "myFeed"
//The Azure DevOps Services build system will use the "SYSTEM_ACCESSTOKEN" to authenticate to Azure DevOps Services feeds
password System.getenv("AZURE_ARTIFACTS_ENV_ACCESS_TOKEN") != null ? System.getenv("AZURE_ARTIFACTS_ENV_ACCESS_TOKEN") : vstsMavenAccessToken
}
}
}
}
// Repositories *from* which Gradle can download dependencies; it's the same as above in this example
repositories {
maven {
url 'https://pkgs.dev.azure.com/soft/pm/_packaging/myFeed/maven/v1'
credentials {
username "myFeed"
//The Azure DevOps Services build system will use the "SYSTEM_ACCESSTOKEN" to authenticate to Azure DevOps Services feeds
password System.getenv("AZURE_ARTIFACTS_ENV_ACCESS_TOKEN") != null ? System.getenv("AZURE_ARTIFACTS_ENV_ACCESS_TOKEN") : vstsMavenAccessToken
}
}
}
Any help please