我在我的 BuildConfig.groovy 文件的块中定义了以下自定义解析器,repositories{...}
以便我可以获得在我的 Grails 项目中使用 JAI 所需的 jar。
mavenRepo "http://www.mygrid.org.uk/maven/repository"
def jbossResolver = new org.apache.ivy.plugins.resolver.URLResolver()
jbossResolver.addArtifactPattern("https://repository.jboss.org/nexus/content/groups/public-jboss/com/sun/media/[module]/[revision]/[artifact]-[revision].[ext]")
jbossResolver.addArtifactPattern("https://repository.jboss.org/nexus/content/groups/public-jboss/javax/media/[module]/[revision]/[artifact]-[revision].[ext]")
jbossResolver.setName("AwesomestJbossResolverEver")
resolver jbossResolver
但是,每当我运行时grails refresh-dependencies
,我都会收到此错误:
compile (
"net.java.dev.jai-imageio:jai-imageio-core-standalone:1.2-pre-dr-b04-2013-04-23",
"javax.media:jai-core:1.1.3",
"com.sun.media:jai-codec:1.1.3"
)
jai-imageio-core-standalone 从http://www.mygrid.org.uk/maven/repository位置解析得很好,但是 jai-core 和 jai-codec 文件一直抛出这个错误:
| Error Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):
- javax.media:jai-core:1.1.3
- com.sun.media:jai-codec:1.1.3
通过一些详细的日志记录,我发现了这个错误:
tried https://repository.jboss.org/nexus/content/groups/public-jboss/com/sun/media/jai-codec/1.1.3/jai-codec-1.1.3.jar
null: no ivy file found for com.sun.media#jai-codec;1.1.3: using default data
problem occurred while resolving dependency: com.sun.media#jai-codec;1.1.3 {compile=[default]} with null: java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:394)
at java.util.Properties.setProperty(Properties.java:143)
at org.apache.ivy.core.cache.DefaultRepositoryCacheManager.saveResolvers(DefaultRepositoryCacheManager.java:422)
at org.apache.ivy.core.cache.DefaultRepositoryCacheManager.originalToCachedModuleDescriptor(DefaultRepositoryCacheManager.java:875)
......long stack trace here.........
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:234)
at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:262)