nebula-plugins / gradle-ospackage-plugin

Gradle plugin for constructing linux packages, specifically RPM and DEBs.
Apache License 2.0
369 stars 129 forks source link

Unable to set "version" property in gradle 8.0.1 #422

Closed tomerarazy closed 1 year ago

tomerarazy commented 1 year ago

It used to work in Gradle 7.6, we've now trying to upgrade to 8.0.1 and we're now getting an exception.

In my build.gradle file I'm doing something like this:

plugins {
    id "nebula.ospackage" version "9.1.1"
}

task deb(type: Deb, dependsOn: 'bootJar') {
    packageName = 'my package'
    packageDescription = "my description"
    version = "${version}-${application.profile}-${server.profile}"
}

And getting this exception:

Caused by: org.gradle.api.InvalidUserDataException: You can't map a property that does not exist: propertyName=version
    at org.gradle.internal.extensibility.ConventionAwareHelper.map(ConventionAwareHelper.java:59)
    at org.gradle.internal.extensibility.ConventionAwareHelper.map(ConventionAwareHelper.java:76)
    at com.netflix.gradle.plugins.packaging.SystemPackagingTask$_applyConventions_closure1.doCall(SystemPackagingTask.groovy:93)
    at com.netflix.gradle.plugins.packaging.SystemPackagingTask$_applyConventions_closure1.call(SystemPackagingTask.groovy)
    at org.gradle.internal.deprecation.DeprecationLogger.whileDisabled(DeprecationLogger.java:264)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at com.netflix.gradle.plugins.utils.DeprecationLoggerUtils.whileDisabled(DeprecationLoggerUtils.groovy:20)
    at com.netflix.gradle.plugins.packaging.SystemPackagingTask.applyConventions(SystemPackagingTask.groovy:86)
    at com.netflix.gradle.plugins.deb.Deb.applyConventions(Deb.groovy:56)
    at com.netflix.gradle.plugins.deb.DebPlugin$1.execute(DebPlugin.groovy:41)
    at com.netflix.gradle.plugins.deb.DebPlugin$1.execute(DebPlugin.groovy)
mricciuti commented 1 year ago

You need to upgrade to latest version of this plugin (currently version 11.0.0), which is compatible with Gradle 8+. Be careful : the plugin id has changed from nebula.ospackage to com.netflix.nebula.ospackage, see https://plugins.gradle.org/plugin/com.netflix.nebula.ospackage

tomerarazy commented 1 year ago

Thanks @mricciuti , working now :)