我有一个名为 Media 的插件,它应该负责图像大小调整等。
它有这些依赖:
dependencies {
compile group: 'org.ccil.cowan.tagsoup',
name: 'tagsoup',
version: '1.2'
runtime group: 'org.codehaus.groovy.modules.http-builder',
name: 'http-builder',
version: '0.5.2'
compile group: 'org.imgscalr',
name: 'imgscalr-lib',
version:'4.2'
compile group: 'org.apache.tika',
name: 'tika-core',
version: '1.3'
}
当我将插件作为独立应用程序运行时,一切正常。
然后我创建了一个应用程序并将就地插件依赖项添加到我的 BuildConfig.groovy 文件中。
// there is grails.project.dependency.resolution closure above
grails.plugin.location.Media = "../../plugins/Media";
当我运行我的应用程序时,我收到此错误:
| Error Compilation error: startup failed:
/home/grails/plugins/Media/grails-app/controllers/frod/media/ImageServiceController.groovy: 14: unable to resolve class org.imgscalr.Scalr
@ line 14, column 1.
import org.imgscalr.Scalr
^
/home/grails/plugins/Media/src/groovy/frod/media/download/CachedContentDownloader.groovy: 3: unable to resolve class org.apache.http.HttpResponse
@ line 3, column 1.
import org.apache.http.HttpResponse
^
/home/grails/plugins/Media/src/groovy/frod/media/download/ContentDownloader.groovy: 3: unable to resolve class org.apache.http.HttpResponse
@ line 3, column 1.
import org.apache.http.HttpResponse
^
/home/grails/plugins/Media/src/groovy/frod/media/download/ContentDownloader.groovy: 4: unable to resolve class org.apache.http.client.HttpClient
@ line 4, column 1.
import org.apache.http.client.HttpClient
^
/home/grails/plugins/Media/src/groovy/frod/media/download/ContentDownloader.groovy: 6: unable to resolve class org.apache.http.impl.client.DefaultHttpClient
@ line 6, column 1.
import org.apache.http.impl.client.DefaultHttpClient
^
/home/grails/plugins/Media/src/groovy/frod/media/download/ContentDownloader.groovy: 5: unable to resolve class org.apache.http.client.methods.HttpGet
@ line 5, column 1.
import org.apache.http.client.methods.HttpGet
^
/home/grails/plugins/Media/src/groovy/frod/media/download/DownloadedContent.groovy: 3: unable to resolve class org.apache.http.HttpEntity
@ line 3, column 1.
import org.apache.http.HttpEntity
^
/home/grails/plugins/Media/src/groovy/frod/media/download/IContentDownloader.groovy: 3: unable to resolve class org.apache.http.HttpResponse
@ line 3, column 1.
import org.apache.http.HttpResponse
^
/home/grails/plugins/Media/src/groovy/frod/media/image/thumbnail/adjustment/crop/CropProcessor.groovy: 5: unable to resolve class org.imgscalr.Scalr
@ line 5, column 1.
import org.imgscalr.Scalr
^
/home/grails/plugins/Media/src/groovy/frod/media/image/thumbnail/adjustment/resize/IResizeAdjustment.groovy: 3: unable to resolve class org.imgscalr.Scalr
@ line 3, column 1.
import org.imgscalr.Scalr
^
/home/grails/plugins/Media/src/groovy/frod/media/image/thumbnail/adjustment/resize/IResizeAdjustment.groovy: 16: unable to resolve class Scalr.Mode
@ line 16, column 5.
public Scalr.Mode getMode();
^
/home/grails/plugins/Media/src/groovy/frod/media/image/thumbnail/adjustment/resize/IResizeAdjustment.groovy: 18: unable to resolve class Scalr.Method
@ line 18, column 5.
public Scalr.Method getMethod();
^
// and many others
如您所见,它无法解析依赖项(您可以查看 http-builder imgscalr-lib)。
我搜索了很多,发现我可以尝试将 legacyResolve 设置为 true。我用这些设置尝试了所有组合(插件、应用程序、插件+应用程序),结果相同——上面的错误。
谁能帮我这个?
我的 grails 版本是 2.2.3
非常感谢
坦率