Grails

Plugin lookup defined in "dependsOn" fails if plugin name contains "-" or "s"

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Not A Bug
  • Affects Version/s: 1.1, 1.1.1
  • Fix Version/s: 1.1.2
  • Component/s: Plugins
  • Labels:
    None
  • Patch Submitted:
    Yes

Description

Steps to reproduce:

1. In a plugin's main class, define "dependsOn" with a plugin name containing "-".

def dependsOn = ["portlets-pluto":"0.1 > * ", "portlets":"0.2 > * "]

2. package-plugin, and install the plugin in a project, and you should get an error message like below.

Plugin dependency [portlets-pluto] not found. Attempting to resolve... ...
Reading remote plugin list ...
Reading remote plugin list ...
Reading remote plugin list ...
Plugin 'portletspluto' was not found in repository. If it is not stored in a configured repository you will need to install it manually. Type 'grails list-plugins' to find out what plugins are available.

The cause of the problem is the value returned by "GrailsNameUtils.getScriptName(depName)" is used to lookup plugin in "findPlugin" closure in "_PluginDependencies.groovy". I confirmed with 1.1, but the code seems to be identical in 1.1.1. Here is the patch to fix the issue.

Index: _PluginDependencies.groovy
===================================================================
--- _PluginDependencies.groovy  (revision 9003)
+++ _PluginDependencies.groovy  (working copy)
@@ -769,7 +769,7 @@
                     event("StatusUpdate", ["Plugin dependency [$depName] not found. Attempting to resolve..."])
                     // recursively install dependent plugins
                     def upperVersion =  GrailsPluginUtils.getUpperVersion(depVersion)
-                    def release = cacheKnownPlugin(depDirName, upperVersion == '*' ? null : upperVersion)
+                    def release = cacheKnownPlugin(depName, upperVersion == '*' ? null : upperVersion)
 
                     ant.copy(file:"${pluginsBase}/grails-${release}.zip",tofile:"${pluginsDirPath}/grails-${release}.zip")

Activity

Hide
Graeme Rocher added a comment -

You have to specify it with camel case like "portletsPluto" and its not changeable right now as other plugins depend on this convention

Show
Graeme Rocher added a comment - You have to specify it with camel case like "portletsPluto" and its not changeable right now as other plugins depend on this convention
Hide
Ford Guo added a comment -

I have the same problem.is there other way exclude camel naming ?

Show
Ford Guo added a comment - I have the same problem.is there other way exclude camel naming ?

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: