I have a gradle project that I need to do some automated releasing in and I am supposed to use the nebula-release-plugin. I have not tried to release with gradle before, so I am following this approach. When I try to add the nebula plugin, I get a Task with name 'release' not found in root project 'my-project-name'
. The documentation does not say anything about specifying a release task, so I don't know how to make one. I get that I need to specify a way to deploy the app, but it has been hard to find a way that works and is compatible with nebula.
My build.gradle
:
plugins {
id 'org.springframework.boot' version '2.5.2'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id 'com.github.bjornvester.wsdl2java' version '1.1'
id 'com.github.johnrengelman.shadow' version '7.0.0'
id 'maven-publish'
id 'nebula.release' version '13.2.1' // https://github.com/nebula-plugins/nebula-release-plugin
}
group = 'dk.dxc'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
repositories {
mavenCentral()
}
task unpack(type: Copy) {
dependsOn bootJar
from(zipTree(tasks.bootJar.outputs.files.singleFile))
into('build/dependency')
}
test {
useJUnitPlatform()
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = Project.getName()
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'soap-demo-gradle'
description = 'A template for soap services using gradle'
scm {
connection = 'scm:git:url/to/my/git/repo'
developerConnection = 'scm:git:url/to/my/git/repo'
url = 'scm:git:url/to/my/git/repo'
}
}
}
}
repositories {
maven {
def releasesRepoUrl = "url/to/my/nexus/repo"
def snapshotsRepoUrl = "url/to/my/nexus/repo"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
}