nemerosa / versioning

Gradle plug-in to generate version information from the SCM branch (Git or Svn)
MIT License
200 stars 40 forks source link

MissingMethodException (No signature of method) #78

Closed josephlim75 closed 3 years ago

josephlim75 commented 4 years ago

I have download latest release 2.13.1 source and compile with gradle 4.10.2 as per gradle wrapper. Compiled successfully. When using in the project with ./gradlew versionDisplay, I got the following error:-

* What went wrong:
Execution failed for task ':versionDisplay'.
> No signature of method: static net.nemerosa.versioning.git.GitInfoService.getGitDirectory() 
is applicable for argument types: (net.nemerosa.versioning.VersioningExtension_Decorated, 
org.gradle.api.internal.project.DefaultProject_Decorated) 
values: [extension 'versioning', root project 'demo-app']

build.gradle

I have the following versioning tag to point to the root directory of my source working directory

versioining {
  gitRepoRoorDir = '../'
}

Fix some annotation issue in VersionFileTask.groovy

josephlim75 commented 4 years ago

I finally figure out the issue. If I am using the Gradle 2.1 method as plugins {}, then there is no issue. But I am using the buildscript {}, therefore, i need to include classpath for grgit and svnkit in order for this plugin to work. After adding the following, everything works.

I am not sure why the original 2.7.1 located in plugin m2 do not require the 2 classpath whereas the one I compiled manually need to.

buildscript {
   repositories {
      maven {
         url "https://plugins.gradle.org/m2/"
       }
   }
   dependencies {
      classpath 'net.nemerosa:versioning:2.13.1'
      classpath 'org.ajoberstar.grgit:grgit-core:4.0.1'
      classpath 'org.tmatesoft.svnkit:svnkit:1.8.12'
   }
}

apply plugin: 'net.nemerosa.versioning'