Issue Details (XML | Word | Printable)

Key: GRAILS-4586
Type: Bug Bug
Status: Closed Closed
Resolution: Not A Bug
Priority: Major Major
Assignee: Graeme Rocher
Reporter: Kenji Nakamura
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Grails

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

Created: 20/May/09 01:30 AM   Updated: 21/May/09 04:30 AM   Resolved: 21/May/09 04:30 AM
Return to search
Component/s: Plugins
Affects Version/s: 1.1, 1.1.1
Fix Version/s: 1.1.2

Time Tracking:
Not Specified

Patch Submitted: Yes


 Description  « Hide

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")


Graeme Rocher added a comment - 21/May/09 04:30 AM

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


Graeme Rocher made changes - 21/May/09 04:30 AM
Field Original Value New Value
Resolution Not A Bug [ 6 ]
Fix Version/s 1.1.2 [ 15289 ]
Status Open [ 1 ] Closed [ 6 ]