Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: 1.3.5
-
Fix Version/s: 2.0 final
-
Component/s: None
-
Labels:None
Description
Plugin A has a dependency to plugin B. Plugin B is an inplac plugin.
Now if you have defined the following dependency to your inplace plugin in your BuildConfig.groovy like this:
def dependsOn = ["plugin-b":"0.1"]
you get:
Error: The following plugins failed to load due to missing dependencies: [pluginA]
- Plugin: pluginA
- Dependencies:
- plugin-b (Required: 0.1, Found: 0.1)
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
Still a problem in some cases. I'll try to create an app and attach it.
The main problem is that the behaviour is changing each time I run or test my sample app.
First run: everything fine
Second run: Error: The following plugins failed to load due to missing dependencies
Thrid run: runs fine or error
The dependsOn field should have "pluginB" rather than "plugin-b". Hopefully dependsOn will be deprecated for 1.4 because it doesn't fit in well with the other dependency management features/techniques in Grails. In the meantime, try changing the dependency name as I've suggested.
Can I use grails.project.dependency.resolution to resolve an inplace-plugin?
No. You can only declare in-place plugins via grails.plugin.location.*.
Thank you Peter! Your suggestion to use "pluginB" rather than "plugin-b" seems to work for me.
How about creating a feature request: Declare in-place plugins in grails.project.dependency.resolution.plugins?
This would simplify the usage of in-place plugins.
Feel fre to raise that as an issue, but be warned it won't be a high priority for us. The in-place mechanism is currently implemented in a very different way to the normal dependencies, hence why the associated configuration is outside of the dependency resolution closure.
Ok but I do not agree to drop dependsOn in 1.4 while there is no real alternative solution for in-place plugins.
dependsOn and the in-place plugin mechanism are orthogonal, i.e. not connected to each other.
Actually, there is one situation where you want both, although it's debatable whether it's sensible or not. The only purpose that the dependsOn serves in your example is to affect the generated POM for the plugin so that it includes the plugin as a declared dependency. You can remove the dependsOn and your app will still work.
Tricky. That would be a fairly significant change for 1.4. Definitely deserves a separate JIRA.
I still have a similar problem to Malte:
In my XyzGrailsPlugin.groovy file:
def dependsOn = [grailsUi:'1.2-SNAPSHOT']
In my BuildConfig.groovy file:
grails.plugin.location.xyz='C:/equifax/xyz'
Error: The following plugins failed to load due to missing dependencies: [xyz]
- Plugin: xyz
- Dependencies:
! grailsUi (Required: 1.2-SNAPSHOT, Found: Not Installed) [INVALID]
If I declare dependsOn in a 1.3.6 app or plugin, grails tries to resolve a .jar file org.grails.plugins#searchable;[0.5.5,]: not found artifact org.grails.plugins#searchable;[0.5.5,]!searchable.jar.
How do you mean? You can't declare dependsOn in an application.
Sorry, my mistake. I meant the plugin only. Here is my setup: The application contains an in-place plugin Xy
XyGrailsPugin.groovy contains:
def dependsOn = ['searchable': "0.5.5"]
plugin.xml:
<dependencies>
<plugin name='searchable' version='0.5.5 > *' />
</dependencies>
Now grails tries to download a .jar file and not the plugin's .zip.
:::: WARNINGS
module not found: org.grails.plugins#searchable;[0.5.5,]
==== grailsPlugins: tried
-- artifact org.grails.plugins#searchable;[0.5.5,]!searchable.jar:
D:\Projekte\ALSA_Shop-2009\trunk\alsa-store-integration/lib/searchable-[0.5.5,].jar
C:\Users\Malte.INNOBOX\.grails\1.3.6\projects\alsa-store-integration\plugins\camel-0.3-RC2/lib/searchable-[0.5.5,].jar
C:\Users\Malte.INNOBOX\.grails\1.3.6\projects\alsa-store-integration\plugins\hibernate-1.3.6/lib/searchable-[0.5.5,].jar
C:\Users\Malte.INNOBOX\.grails\1.3.6\projects\alsa-store-integration\plugins\jms-0.5-RC3/lib/searchable-[0.5.5,].jar
C:\Users\Malte.INNOBOX\.grails\1.3.6\projects\alsa-store-integration\plugins\searchable-0.5.5/lib/searchable-[0.5.5,].jar
C:\Users\Malte.INNOBOX\.grails\1.3.6\projects\alsa-store-integration\plugins\spring-events-1.0/lib/searchable-[0.5.5,].jar
C:\Users\Malte.INNOBOX\.grails\1.3.6\projects\alsa-store-integration\plugins\tomcat-1.3.6/lib/searchable-[0.5.5,].jar
==== grailsHome: tried
D:\dev\grails-1.3.6\lib/searchable-[0.5.5,].xml
-- artifact org.grails.plugins#searchable;[0.5.5,]!searchable.jar:
D:\dev\grails-1.3.6\lib/searchable-[0.5.5,].jar
==== grailsHome: tried
D:\dev\grails-1.3.6\dist/searchable-[0.5.5,].xml
-- artifact org.grails.plugins#searchable;[0.5.5,]!searchable.jar:
D:\dev\grails-1.3.6\dist/searchable-[0.5.5,].jar
==== grailsHome: tried
-- artifact org.grails.plugins#searchable;[0.5.5,]!searchable.jar:
D:\dev\grails-1.3.6/plugins/grails-searchable-[0.5.5,].jar
==== grailsCentral: tried
-- artifact org.grails.plugins#searchable;[0.5.5,]!searchable.jar:
http://svn.codehaus.org/grails-plugins/grails-searchable/tags/RELEASE_[0_5_5,]/grails-searchable-[0.5.5,].jar
==== grailsCore: tried
-- artifact org.grails.plugins#searchable;[0.5.5,]!searchable.jar:
http://svn.codehaus.org/grails/trunk/grails-plugins/grails-searchable/tags/RELEASE_[0_5_5,]/grails-searchable-[0.5.5,].jar
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.grails.plugins#searchable;[0.5.5,]: not found
::::::::::::::::::::::::::::::::::::::::::::::
When I remove dependsOn it's the same result. I have to do a grails package-plugin -> now the dependency is removed from plugin.xml and it works as expected.
I'll try to setup the dependency in grails.project.dependency.resolution. The whole thing has something to do with in-place mechanism as it doesn't happen when I run or compile the plugin itself.
Ok, I figured it out now. This issue might also have to do soemthing with absolute and relative (transitive) in-place plugins an their paths. When I completely change the in-place plugin paths to a relative one everything seems to behave like it should. It's really hard to track down in a complex project structure.
Not sure if this is directly related, but I have a problem where using an in-place plugin results in the war file missing the jar files in the plugin's lib directory.
In my BuildConfig I have:
grails.plugin.location.myPlugin= "../myPlugin"
I also have myJar.jar under myPlugin/lib
When I build the war file, myJar.jar is not in WEB-INF/lib
I'm using grails 1.3.4. Is there a conflict between using in-place plugins and declaring dependencies in BuildConfig.groovy? Or between in-place plugins and declaring other plugins in application.properties?
Same problem as Malte:
My plugin has a dependency on jquery, but my grails app using the plugin can't resolve jquery when using the "grails.plugin.location.X" mechanism unless it's an absolute path. I would never have figured this out if it were not for Malte's comment above. The docs on specifying plugin locations (12.2) use a relative path in the example... which is what i used and works... only if your plugin itself does not have further dependencies (e.g. jquery).
Grails plugin: A
Grails application using plugin: B
Both A and B projects reside under same directory: /Users/admin/Documents/workspace
Plugin class for A (AGrailsPlugin.groovy):
... def dependsOn = ['jquery':'1.4 > *'] ...
BuildConfig.groovy for B:
grails.plugin.location.A = "../A"
Results in the following error on run-app for B:
Running script /Users/admin/Applications/springsource/grails-1.3.6/scripts/RunApp.groovy
Environment set to development
[groovyc] Compiling 1 source file to /Users/admin/Documents/workspace/B/target/classes
- Plugin: A
- Dependencies:
! jquery (Required: 1.4 > *, Found: Not Installed) [INVALID]
When i change the BuildConfig parameter to use an absolute path, it works.
Revised BuildConfig.groovy for B:
grails.plugin.location.A = "/Users/admin/Documents/workspace/A"
Not sure why a difference in absolute/relative path for an apps plugin resolution would affect dependency resolution for that plugins' dependency resolution (jquery).
I can't reproduce this relative path in-place plugin issue with Grails 2.0 Final. So, I recommend closing this issue.
grails create-app foo
grails create-plugin bar
Edit: foo/grails-app/BuildConfig.groovy
Add this line: grails.plugin.location.'bar' = "../bar"
Edit: bar/BarGrailsPlugin.groovy
Add this line: def dependsOn = ['jquery':'1.7 > *']
Everything works (compile and run-app) successfully.
Thanks,
Bobby
I think this jira can be closed. I found out that in my plugin I had some "old" files: build.xml, ivy.xml and ivysettings.xml. New plugins don't contain those files. Afert I deleted them everything now works as expected again.