Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.0
-
None
Description
@Grab annotations are baked into the .class files and executed when the class is loaded. They break if a custom @GrabResolver is used though because that information is lost. It would make sense to keep it.
E.g. try and compile this
@GrabResolver(name='spring-snapshot', root='http://repo.springframework.org/snapshot') @GrabConfig(systemClassLoader=true) @Grab("org.springframework:spring-context:3.2.2.BOOTSTRAP-SNAPSHOT") @GrabExclude("commons-logging:commons-logging") @Grab("org.slf4j:jcl-over-slf4j:1.6.1") @Grab("org.slf4j:slf4j-jdk14:1.6.1") class BootstrapGrapes { }
Then blow away your ~/.groovy/grapes/org.springframework and try and load the class:
$ mv ~/.groovy/grapes ~/tmp $ rm -rf ~/.m2/repository/org/springframework/spring-context $ groovysh > "BootstrapGrapes" as Class ...<bang!>