Closed jnehlmeier closed 9 years ago
Hehe, when I change the above to
allprojects {
version = rootProject.version.toString()
}
then the NexusPlugin works. However your plugin fails then because it expects inferredVersion
on the version field to be available during the release task.
:release FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':release'.
> No such property: inferredVersion for class: java.lang.String
Any suggestions?
Ok I should first try and then write here ;-)
subprojects {
version = rootProject.version.toString()
}
does work now as it does not change the version of the root project which is used by the release task as the plugin is only applied to the root project.
I'll open an issue on the NexusPlugin as Project.getVersion() can really return an Object and Gradle itself always uses Project.getVersion().toString() as stated in their docs. NexusPlugin fails to do so.
Right, Gradle allows version to be any Object. This plugin intentionally uses that capability to defer the inference of the version, so it's a pretty core necessity in my case. I agree that this an issue in the Nexus plugin, so I'll close it out here.
Gradle 2.2.1, Java7
I have added the SNAPSHOT strategy as follows:
When ever I run
gradlew release -Prelease.scope=PATCH -Prelease.stage=SNAPSHOT
(or any other stage) it fails withWhen I remove the
uploadArchives
task (provided by the maven plugin) from thetasks.release.dependsOn
configuration it works again.The stacktrace shows up the NexusPlugin used to deploy to OSS Sonatype and taken a look at their code it seems like they call endWidth() on project.version (https://github.com/bmuschko/gradle-nexus-plugin/blob/master/src/main/groovy/com/bmuschko/gradle/nexus/NexusPlugin.groovy#L82).
Could it be that your plugin does not set a string into the version field?