@@ -160,10 +160,14 @@ private static void installHelloWorldPlugin() {
160160 }
161161
162162 public static void checkThatGroovyIsOnClasspath () {
163- if ( isGroovyOnClasspath ()) return ;
163+ final File oldGroovyLibrary = new File ( LIVEPLUGIN_LIBS_PATH + File . separator + "groovy-all-2.0.6.jar" ) ;
164164
165165 NotificationListener listener = new NotificationListener () {
166166 @ Override public void hyperlinkUpdate (@ NotNull Notification notification , @ NotNull HyperlinkEvent event ) {
167+ if (oldGroovyLibrary .exists ()) {
168+ FileUtil .delete (oldGroovyLibrary );
169+ }
170+
167171 boolean downloaded = downloadFile ("http://repo1.maven.org/maven2/org/codehaus/groovy/groovy-all/2.2.1/" , "groovy-all-2.2.1.jar" , LIVEPLUGIN_LIBS_PATH );
168172 if (downloaded ) {
169173 notification .expire ();
@@ -174,6 +178,18 @@ public static void checkThatGroovyIsOnClasspath() {
174178 }
175179 }
176180 };
181+
182+ if (oldGroovyLibrary .exists ()) {
183+ livePluginNotificationGroup .createNotification (
184+ "There is old version of groovy library on LivePlugin classpath" ,
185+ "It might work incorrectly. <a href=\" \" >Click here to update groovy to 2.2.1</a> (~6Mb)" ,
186+ NotificationType .ERROR ,
187+ listener
188+ ).notify (null );
189+ }
190+
191+ if (isGroovyOnClasspath ()) return ;
192+
177193 livePluginNotificationGroup .createNotification (
178194 "LivePlugin didn't find Groovy libraries on classpath" ,
179195 "Without it plugins won't work. <a href=\" \" >Download Groovy libraries</a> (~6Mb)" ,
0 commit comments