2

新しい grails 2.3 サンプル プロジェクトを作成しました。

依存関係の更新またはアプリの実行中にエラーが発生しています

Loading Grails 2.3.0.M1
| Configuring classpath
| Error org.sonatype.aether.collection.DependencyCollectionException: Failed to collect dependencies for [xalan:serializer:jar:2.7.1 (compile), org.grails:grails-bootstrap:jar:2.3.0.M1 (compile), org.grails:grails-scripts:jar:2.3.0.M1 (compile), org.grails.plugins:tomcat:zip:7.0.39 (compile)]
| Error     at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:258)
| Error     at org.sonatype.aether.impl.internal.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:308)
| Error     at org.codehaus.groovy.grails.resolve.maven.aether.AetherDependencyManager.collectDependencies(AetherDependencyManager.groovy:389)
| Error     at org.codehaus.groovy.grails.resolve.maven.aether.AetherDependencyManager.resolve(AetherDependencyManager.groovy:262)
| Error     at grails.util.BuildSettings.doResolve(BuildSettings.groovy:505)
| Error     at grails.util.BuildSettings.doResolve(BuildSettings.groovy)
| Error     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
| Error     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error     at java.lang.reflect.Method.invoke(Method.java:601)
| Error     at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
| Error     at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
| Error     at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085)
| Error     at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
| Error     at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
| Error     at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1030)
| Error     at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
| Error     at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
| Error     at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
| Error     at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
| Error     at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
| Error     at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
| Error     at grails.util.BuildSettings$_getDefaultBuildDependencies_closure16.doCall(BuildSettings.groovy:756)
| Error     at grails.util.BuildSettings$_getDefaultBuildDependencies_closure16.doCall(BuildSettings.groovy)
| Error     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
| Error     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error     at java.lang.reflect.Method.invoke(Method.java:601)
| Error     at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272)
| Error     at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:64)
| Error     at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
| Error     at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
| Error     at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
| Error     at grails.util.BuildSettings.getDefaultBuildDependencies(BuildSettings.groovy:750)
| Error     at grails.util.BuildSettings.getBuildDependencies(BuildSettings.groovy:655)
| Error     at org.codehaus.groovy.grails.cli.support.ClasspathConfigurer.getClassLoaderUrls(ClasspathConfigurer.java:107)
| Error     at org.codehaus.groovy.grails.cli.support.ClasspathConfigurer.configuredClassLoader(ClasspathConfigurer.java:70)
| Error     at org.codehaus.groovy.grails.cli.GrailsScriptRunner.initializeState(GrailsScriptRunner.java:618)
| Error     at org.codehaus.groovy.grails.cli.GrailsScriptRunner.initializeState(GrailsScriptRunner.java:601)
| Error     at org.grails.ide.api.impl.GrailsConnectorImpl.ensureInitialized(GrailsConnectorImpl.java:127)
| Error     at org.grails.ide.api.impl.GrailsConnectorImpl.executeCommand(GrailsConnectorImpl.java:141)
| Error     at org.grails.ide.eclipse.longrunning.process.GrailsProcess.run(GrailsProcess.java:126)
| Error     at org.grails.ide.eclipse.longrunning.process.GrailsProcess.main(GrailsProcess.java:89)
| Error     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
| Error     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error     at java.lang.reflect.Method.invoke(Method.java:601)
| Error     at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:235)
| Error     at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:263)
| Error Caused by: org.sonatype.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for xalan:serializer:jar:2.7.1
| Error     at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:296)
| Error     at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:186)
| Error     at org.sonatype.aether.impl.internal.DefaultDependencyCollector.process(DefaultDependencyCollector.java:412)
| Error     at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:240)
| Error     ... 48 more
| Error Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not transfer artifact xalan:serializer:pom:2.7.1 from/to grailsCentral (http://repo.grails.org/grails/plugins): null to http://repo.grails.org/grails/plugins/xalan/serializer/2.7.1/serializer-2.7.1.pom
| Error     at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
| Error     at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
| Error     at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:193)
| Error     at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:281)
| Error     ... 51 more
| Error Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact xalan:serializer:pom:2.7.1 from/to grailsCentral (http://repo.grails.org/grails/plugins): null to http://repo.grails.org/grails/plugins/xalan/serializer/2.7.1/serializer-2.7.1.pom
| Error     at org.sonatype.aether.connector.async.AsyncRepositoryConnector$3.wrap(AsyncRepositoryConnector.java:1546)
| Error     at org.sonatype.aether.connector.async.AsyncRepositoryConnector$3.wrap(AsyncRepositoryConnector.java:1537)
| Error     at org.sonatype.aether.connector.async.AsyncRepositoryConnector$GetTask.flush(AsyncRepositoryConnector.java:1035)
| Error     at org.sonatype.aether.connector.async.AsyncRepositoryConnector.get(AsyncRepositoryConnector.java:409)
| Error     at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:457)
| Error     ... 54 more
| Error Caused by: java.net.ConnectException: null to http://repo.grails.org/grails/plugins/xalan/serializer/2.7.1/serializer-2.7.1.pom
| Error     at com.ning.http.client.providers.netty.NettyConnectListener.operationComplete(NettyConnectListener.java:95)
| Error     at org.jboss.netty.channel.DefaultChannelFuture.notifyListener(DefaultChannelFuture.java:381)
| Error     at org.jboss.netty.channel.DefaultChannelFuture.addListener(DefaultChannelFuture.java:148)
| Error     at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.doConnect(NettyAsyncHttpProvider.java:945)
| Error     at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.execute(NettyAsyncHttpProvider.java:776)
| Error     at com.ning.http.client.AsyncHttpClient.executeRequest(AsyncHttpClient.java:484)
| Error     at org.sonatype.aether.connector.async.AsyncRepositoryConnector$GetTask.run(AsyncRepositoryConnector.java:891)
| Error     at org.sonatype.aether.connector.async.AsyncRepositoryConnector.get(AsyncRepositoryConnector.java:402)
| Error     ... 55 more
| Error Caused by: java.nio.channels.UnresolvedAddressException
| Error     at sun.nio.ch.Net.checkAddress(Net.java:85)
| Error     at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:597)
| Error     at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:140)

| | org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:103) でのエラー | org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:60) でのエラー | org.jboss.netty.handler.codec.http.HttpClientCodec.handleDownstream(HttpClientCodec.java:82) でのエラー | org.jboss.netty.handler.stream.ChunkedWriteHandler.handleDownstream(ChunkedWriteHandler.java:115) でのエラー | org.jboss.netty.channel.Channels.connect(Channels.java:541) でのエラー | org.jboss.netty.channel.AbstractChannel.connect(AbstractChannel.java:210) でのエラー | org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:227) でのエラー | org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188) でのエラー | com.ning.http.client.providers.netty でのエラー。NettyAsyncHttpProvider.doConnect(NettyAsyncHttpProvider.java:902) | エラー ... 59 件以上

そして、私の BuildConfig.groovy は次のとおりです。

    grails.servlet.version = "3.0" // Change depending on target container
      compliance (2.5 or 3.0) grails.project.class.dir = "target/classes"
    grails.project.test.class.dir = "target/test-classes"
    grails.project.test.reports.dir = "target/test-reports"
    grails.project.work.dir = "target/work" grails.project.target.level =
     1.6 grails.project.source.level = 1.6 //grails.project.war.file = "target/${appName}-${appVersion}.war"

     forkConfig = [maxMemory: 1024, minMemory: 64, debug: false, maxPerm:
     256] grails.project.fork = [    test: forkConfig, // configure
     settings for the test-app JVM    run: forkConfig, // configure
     settings for the run-app JVM    war: forkConfig, // configure settings
     for the run-war JVM    console: forkConfig // configure settings for
     the Swing console JVM ]

     grails.project.dependency.resolver = "maven" // or ivy
     grails.project.dependency.resolution = {

System.setProperty("http.proxyHost", "10.20.30.40"); System.setProperty("http.proxyPort", "80");

// inherit Grails' default dependencies
inherits("global") {
    // specify dependency exclusions here; for example, uncomment this to disable ehcache:
    // excludes 'ehcache'
}
log "error" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
checksums true // Whether to verify checksums on resolve
legacyResolve false // whether to do a secondary resolve on plugin installation, not advised and here for backwards compatibility

repositories {
    inherits true // Whether to inherit repository definitions from plugins

    grailsPlugins()
    grailsHome()
    mavenLocal()
    grailsCentral()
    mavenCentral()
    // uncomment these (or add new ones) to enable remote dependency resolution from public Maven repositories
    //mavenRepo "http://repository.codehaus.org"
    //mavenRepo "http://download.java.net/maven/2/"
    //mavenRepo "http://repository.jboss.com/maven2/"
}

dependencies {
    // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
    // runtime 'mysql:mysql-connector-java:5.1.24'
}

plugins {
    // plugins for the build system only
    build ":tomcat:7.0.39"

    // plugins for the compile step
    compile ":scaffolding:1.0.0"
    compile ':cache:1.0.1'

    // plugins needed at runtime but not for compilation
    runtime ":hibernate:3.6.10.M3" // or ":hibernate4:4.1.11.BUILD-SNAPSHOT"
    runtime ":database-migration:1.3.3"
    runtime ":jquery:1.9.1"
    runtime ":resources:1.2"
    // Uncomment these (or add new ones) to enable additional resources capabilities
    //runtime ":zipped-resources:1.0.1"
    //runtime ":cached-resources:1.1"
    //runtime ":yui-minify-resources:0.1.5"
} }
4

4 に答える 4

5

user2264997が言ったように、Grails 2.3 のグローバル プロキシを構成するadd-proxyために使用できます。set-proxy

http://grails.org/doc/latest/ref/Command%20Line/add-proxy.html

grails add-proxy client --host=proxy-server --port=4300 --username=guest --password=guest

そのコマンドを実行すると${HOME}/.grails/ProxySettings.groovy、プロキシ情報を含む grails が作成されます。心ゆくまで設定を微調整できます。

注意すべきことの 1 つはgrails add-proxy、プロジェクト ディレクトリから実行しないでください。プロキシを設定する前に、不足している依存関係を解決しようとするからです。ディレクトリをバックアップして実行しました。

于 2013-10-30T20:15:24.583 に答える
5

彼らがmavenの何が問題なのかを理解できるまで

BuildConfig で grails.project.dependency.resolver = "maven" を grails.project.dependency.resolver = "ivy" に変更します。

依存関係を更新することを忘れないでください

于 2014-02-10T14:57:11.593 に答える
0

現在の Maven キャッシュ ディレクトリ ($HOME/.m2) を削除することで、この同じ問題を解決できました。なぜこれが問題を解決したのか、私は掘り下げていません。

于 2014-05-10T17:16:10.777 に答える