2014-12-03 47 views
0

我知道類似的問題已經被問到,但我已經非常徹底地瀏覽它們。Grails掛在'配置類路徑'

我下載了ggts包並使用Eclipse創建了一個名爲GrailsExample的項目。當我嘗試運行groovy應用程序時,它掛在'刷新依賴(33%)'上。最後一個日誌輸出是'配置類路徑'。當我從DOS提示符運行任何grails命令時也會發生同樣的情況。

我在防火牆後面。當我嘗試使用'grails add-proxy'命令時,它會在同一步驟中掛起。

我將日誌級別改爲冗長,沒有任何變化。

我從我的BuildConfig.groovy文件中註釋了一些存儲庫,同樣的問題。

我試着運行grails clean --offline,這也掛在同一點上。

我試圖註釋掉一對夫婦的存儲庫(見下文)

當我運行「Grails的清潔-offline --stacktrace」我得到以下錯誤:

| Error Resolve error obtaining dependencies: Failed to read artifact descriptor for xalan:serializer:jar:2.7.1 
| Error Required Grails build dependencies were not found. This is normally due to internet connectivity issues (such as a misconfigured proxy) or missing repositories in grails-app/conf/BuildConfig.groovy. Please verify your configuration to continue. 

我不知道現在該做什麼。我被卡住了,就像grails一樣。下面

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" 

grails.project.fork = [ 
    // configure settings for compilation JVM, note that if you alter the Groovy version forked compilation is required 
    // compile: [maxMemory: 256, minMemory: 64, debug: false, maxPerm: 256, daemon:true], 

    // configure settings for the test-app JVM, uses the daemon by default 
    test: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, daemon:true], 
    // configure settings for the run-app JVM 
    run: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false], 
    // configure settings for the run-war JVM 
    war: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false], 
    // configure settings for the Console UI JVM 
    console: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256] 
] 

grails.project.dependency.resolver = "maven" // or ivy 
grails.project.dependency.resolution = { 
    // inherit Grails' default dependencies 
    inherits("global") { 
     // specify dependency exclusions here; for example, uncomment this to disable ehcache: 
     // excludes 'ehcache' 
    } 
    log "verbose" // 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.29' 
     // runtime 'org.postgresql:postgresql:9.3-1101-jdbc41' 
     test "org.grails:grails-datastore-test-support:1.0.2-grails-2.4" 
    } 

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

     // plugins for the compile step 
     compile ":scaffolding:2.1.2" 
     compile ':cache:1.1.8' 
     compile ":asset-pipeline:1.9.9" 

     // plugins needed at runtime but not for compilation 
     runtime ":hibernate4:4.3.6.1" // or ":hibernate:3.6.10.18" 
     runtime ":database-migration:1.4.0" 
     runtime ":jquery:1.11.1" 

     // Uncomment these to enable additional asset-pipeline capabilities 
     //compile ":sass-asset-pipeline:1.9.0" 
     //compile ":less-asset-pipeline:1.10.0" 
     //compile ":coffee-asset-pipeline:1.8.0" 
     //compile ":handlebars-asset-pipeline:1.3.0.3" 
    } 
} 
+0

你是否輸入完整的命令爲'grails add-proxy client --host = proxy-server --port = nnnn' ?假設你的代理有正確的值。檢查官方的Grails參考http://grails.org/doc/2.0.0/ref/Command%20Line/set-proxy.html – 2014-12-03 19:51:55

+0

是的。我從命令行嘗試了幾種不同的方式,每次打印「配置類路徑」後都會掛起。 – 2014-12-04 15:16:18

+0

ARGHHH,想通了!如果我在包含grails項目的文件夾中運行該命令,它會掛起並炸燬。我需要在通用文件夾中運行「添加代理」。 – 2014-12-04 15:22:40

回答

1

我BuildConfig.groovy來自薩爾瓦多的提示後想通了這一點。我最初運行的是創建應用程序並進入該文件夾。正是在那時我試圖運行'add-proxy'命令。它保持懸掛,並最終與上面提到的'xalan:serializer:jar:2.7.1'錯誤一起爆炸。

您需要在項目文件夾之外運行此命令。它看起來'配置類路徑'後採取的行動取決於你所在的文件夾上下文。