Spring Tool Suite
  1. Spring Tool Suite
  2. STS-1506

installing a plugin that pulls in another plugin looks to have issues

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.2.RELEASE
    • Fix Version/s: 2.6.0.M1
    • Component/s: GRAILS
    • Labels:
      None

      Description

      From forum post: http://forum.springsource.org/showthread.php?t=101376

      It appears we have a problem with installing a plugin that pulls in another plugin. As an example, try to install multi-tenant-core which will pull in falcone-util. If you install via the prompt, it is fine. If you try to install via the plugin manager you get an error like the one shown below.

      See how application.properties is considered out of sync. Did we not refresh the resource for application.properties in eclipse after updating it with a line for multi-tenant-core?

      Exception thrown when trying to update 'application.properties'
      Resource is out of sync with the file system: '/myproject/application.properties'.
      
      See below...on a new project called test the first time I try and install plugins I get the following stack trace. 
      Exception thrown when trying to update 'application.properties'
      Command failed, see details for output.
      ------System.out:-----------
      Welcome to Grails 1.3.6 - http://grails.org/
      Licensed under Apache Standard License 2.0
      Grails home is set to: C:\springsource2\grails-1.3.6\
      
      Base Directory: C:\workspace3\test
      Resolving dependencies...
      Dependencies resolved in 1742ms.
      Running script C:\springsource2\grails-1.3.6\scripts\Compile.groovy
      Environment set to development
      Setting non-interactive mode
      Plugin [multi-tenant-core-1.0.3] not installed. ...
      Resolving new plugins. Please wait... ...
      Installing zip C:\Users\Dad\.ivy2\cache\org.grails.plugins\multi-tenant-core\zips\multi-tenant-core-1.0.3.zip... ...
      [mkdir] Created dir: C:\Users\Dad\.grails\1.3.6\projects\test\plugins\m ulti-tenant-core-1.0.3
      [unzip] Expanding: C:\Users\Dad\.ivy2\cache\org.grails.plugins\multi-tenant-core\zips\multi-tenant-core-1.0.3.zip into C:\Users\Dad\.grails\1.3.6\projects\test\plugins\m ulti-tenant-core-1.0.3
      Installed plugin multi-tenant-core-1.0.3 to location C:\Users\Dad\.grails\1.3.6\projects\test\plugins/multi-tenant-core-1.0.3. ...
      Plugin dependency [falconeUtil] not found. Attempting to resolve... ...
      Resolving plugin falcone-util. Please wait...
      
      Installing zip C:\Users\Dad\.ivy2\cache\org.grails.plugins\falcon e-util\zips\falcone-util-1.0.zip... ...
      [mkdir] Created dir: C:\Users\Dad\.grails\1.3.6\projects\test\plugins\f alcone-util-1.0
      [unzip] Expanding: C:\Users\Dad\.ivy2\cache\org.grails.plugins\falcon e-util\zips\falcone-util-1.0.zip into C:\Users\Dad\.grails\1.3.6\projects\test\plugins\f alcone-util-1.0
      Installed plugin falcone-util-1.0 to location C:\Users\Dad\.grails\1.3.6\projects\test\plugins/falcone-util-1.0. ...
      Executing falcone-util-1.0 plugin post-install script ...
      Plugin falcone-util-1.0 installed
      [delete] Deleting directory C:\workspace3\test\web-app\WEB-INF\classes
      [delete] Deleting directory C:\workspace3\test\target\classes
      [delete] Deleting directory C:\Users\Dad\.grails\1.3.6\projects\test\plugin-classes
      [delete] Deleting directory C:\Users\Dad\.grails\1.3.6\projects\test\resources
      Resolving plugin JAR dependencies ...
      Executing multi-tenant-core-1.0.3 plugin post-install script ...
      Plugin multi-tenant-core-1.0.3 installed
      Plugin provides the following new scripts:
      ------------------------------------------
      grails create-data-source-map
      grails create-dns-map
      Executing . plugin uninstall script ...
      [delete] Deleting directory C:\Users\Dad\.grails\1.3.6\projects\test\plugins\f alcone-util-1.0
      [mkdir] Created dir: C:\Users\Dad\.grails\1.3.6\projects\test\plugin-classes
      [groovyc] Compiling 33 source files to C:\Users\Dad\.grails\1.3.6\projects\test\plugin-classes
      [groovyc] org.codehaus.groovy.control.MultipleCompilationErr orsException: startup failed:
      [groovyc] Compile error during compilation with javac.
      [groovyc] C:\Users\Dad\.grails\1.3.6\projects\test\plugins\m ulti-tenant-core-1.0.3\src\java\grails\plugin\multitenant\core\Curr entTenantThreadLocal.java:3: package com.infusion.util.event does not exist
      [groovyc] import com.infusion.util.event.EventBroker;
      [groovyc] ^
      [groovyc] C:\Users\Dad\.grails\1.3.6\projects\test\plugins\m ulti-tenant-core-1.0.3\src\java\grails\plugin\multitenant\core\Curr entTenantThreadLocal.java:20: cannot find symbol
      [groovyc] symbol : class EventBroker
      [groovyc] location: class grails.plugin.multitenant.core.CurrentTenantThread Local
      [groovyc] private EventBroker eventBroker;
      [groovyc] ^
      [groovyc] C:\Users\Dad\.grails\1.3.6\projects\test\plugins\m ulti-tenant-core-1.0.3\src\java\grails\plugin\multitenant\core\Curr entTenantThreadLocal.java:62: cannot find symbol
      [groovyc] symbol : class EventBroker
      [groovyc] location: class grails.plugin.multitenant.core.CurrentTenantThread Local
      [groovyc] public void setEventBroker(EventBroker eventBroker)
      [groovyc] ^
      [groovyc] 3 errors
      [groovyc] 
      [groovyc] 
      [groovyc] 1 error
      ... done
      Error executing script Compile: : Compilation Failed
      : Compilation Failed
      at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:39 1)
      at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:41 5)
      at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
      at gant.Gant.withBuildListeners(Gant.groovy:427)
      at gant.Gant.this$2$withBuildListeners(Gant.groovy)
      at gant.Gant$this$2$withBuildListeners.callCurrent(Un known Source)
      at gant.Gant.dispatch(Gant.groovy:415)
      at gant.Gant.this$2$dispatch(Gant.groovy)
      at gant.Gant.invokeMethod(Gant.groovy)
      at gant.Gant.executeTargets(Gant.groovy:590)
      at gant.Gant.executeTargets(Gant.groovy:589)
      Caused by: : Compilation Failed
      at org.codehaus.groovy.ant.Groovyc.compile(Groovyc.ja va:910)
      at org.codehaus.groovy.ant.Groovyc.execute(Groovyc.ja va:605)
      at org.apache.tools.ant.UnknownElement.execute(Unknow nElement.java:288)
      at org.apache.tools.ant.dispatch.DispatchUtils.execut e(DispatchUtils.java:106)
      at _GrailsCompile_groovy$_run_closure4_closure10.doCa ll(_GrailsCompile_groovy:117)
      at _GrailsCompile_groovy$_run_closure4_closure10.doCa ll(_GrailsCompile_groovy)
      at _GrailsSettings_groovy$_run_closure10.doCall(_Grai lsSettings_groovy:280)
      at _GrailsSettings_groovy$_run_closure10.call(_Grails Settings_groovy)
      at _GrailsCompile_groovy$_run_closure4.doCall(_Grails Compile_groovy:104)
      ^
      
      

        Activity

        Hide
        Kris De Volder (c) added a comment - - edited

        I tried this. I do not get the 'out of synch error'. I do get the compilation errors from Grails.

        The reason why this doesn't appear to work, is that Grails compile is failing after the plugin was added to application.properties.

        From comments in the forum made by Andy, I gather that these errors are due to the fact that the plugin that we are attempting to install is depedendent on another plugin which isn't being installed.

        I implemented something that detects error during install and reverts the changes... so the changes are being reverted, leaving the plugin not installed. I guess this is probably better than installing a plugin that would otherwise cause the project to be broken. But of course it is very frustrating that you can't install the plugin, the error messages aren't very informative about why the plugin can't be installed.

        Show
        Kris De Volder (c) added a comment - - edited I tried this. I do not get the 'out of synch error'. I do get the compilation errors from Grails. The reason why this doesn't appear to work, is that Grails compile is failing after the plugin was added to application.properties. From comments in the forum made by Andy, I gather that these errors are due to the fact that the plugin that we are attempting to install is depedendent on another plugin which isn't being installed. I implemented something that detects error during install and reverts the changes... so the changes are being reverted, leaving the plugin not installed. I guess this is probably better than installing a plugin that would otherwise cause the project to be broken. But of course it is very frustrating that you can't install the plugin, the error messages aren't very informative about why the plugin can't be installed.
        Hide
        Kris De Volder (c) added a comment -

        Given this problem, and also the other recent issue https://issuetracker.springsource.com/browse/STS-1502, both of which seem to be caused by the 'hacky' solution of having our plugin manager having install plugin be done by directly modifying application.properties instead of calling the 'install-plugin' command, I think it may be a good idea to go back to a solution that is less hacky, slower when installing multiple plugins, but more reliable.

        I tried the route of using the command prompt to install this plugin by doing
        "install-plugin multi-tenant-core" and that worked fine. It also pulled in the dependent plugin "falcone-util" without any problems.

        This will be slower when installing multiple plugins at once, but at least it will work more reliably.

        Show
        Kris De Volder (c) added a comment - Given this problem, and also the other recent issue https://issuetracker.springsource.com/browse/STS-1502 , both of which seem to be caused by the 'hacky' solution of having our plugin manager having install plugin be done by directly modifying application.properties instead of calling the 'install-plugin' command, I think it may be a good idea to go back to a solution that is less hacky, slower when installing multiple plugins, but more reliable. I tried the route of using the command prompt to install this plugin by doing "install-plugin multi-tenant-core" and that worked fine. It also pulled in the dependent plugin "falcone-util" without any problems. This will be slower when installing multiple plugins at once, but at least it will work more reliably.
        Hide
        Kris De Volder (c) added a comment -

        This is now fixed, I replaced the 'application.properties' hack by something that works more like the 'old way' just using install/uninstall commands.

        It is slower but more reliable. Also if some plugins have issues, it will still install/uninstall the other plugins if the user is trying to do a "multiple (un)install".

        I didn't quite revert to the old code, but made a nice clean implementation of this, and integrated some in place plugin related fixes from the 'application.properties' version that weren't in the original.

        I also added a regression test for the 'plugin with a dependent plugin' case.

        Show
        Kris De Volder (c) added a comment - This is now fixed, I replaced the 'application.properties' hack by something that works more like the 'old way' just using install/uninstall commands. It is slower but more reliable. Also if some plugins have issues, it will still install/uninstall the other plugins if the user is trying to do a "multiple (un)install". I didn't quite revert to the old code, but made a nice clean implementation of this, and integrated some in place plugin related fixes from the 'application.properties' version that weren't in the original. I also added a regression test for the 'plugin with a dependent plugin' case.

          People

          • Assignee:
            Kris De Volder (c)
            Reporter:
            Andy Clement (c)
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              First Response Date: