加载BuildConfig时出错:对于输入字符串:“true” [英] error loading the BuildConfig: For input string: "true"

查看:135
本文介绍了加载BuildConfig时出错:对于输入字符串:“true”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的BuildConfig.groovy文件

  grails.servlet.version =3.0//根据目标容器合规性2.5或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 = [
//配置编译JVM的设置,请注意,如果您更改Groovy版本,则需要分叉编译
//编译:[maxMemory:256,minMemory:64,debug:false,maxPerm:256,守护进程:true],

//为测试应用程序JVM配置设置,默认使用守护程序
test:[maxMemory:768,minMemory:64,debug:false,maxPerm:256 ,daemon:true],
//配置设置为运行应用程序JVM
运行:[maxMemory:768,minMemory:64,debug:false,maxPerm:256,forkReserve:false],
//配置运行JVM的设置
war:[maxMemory:768,minMemory:64,debug:false,maxPerm:256,forkReserve:false],
//配置Console UI的设置JVM
console:[maxMemory:768 ,minMemory:64,debug:false,maxPerm:256]
]

grails.project.dependency.resolver =maven//或ivy
grails.project.dependency .resolution = {
//继承Grails的默认依赖关系
inherits(global){
//在此指定依赖项排除;例如,取消注释以禁用ehcache:
//排除'ehcache'
}
日志错误// Ivy解析器的日志级别,'error','warn',' info','debug'或'verbose'
checksums true //是否验证解析
上的校验和legacyResolve false //是否在插件安装时执行二级解析,不建议并且为了向后兼容

repositories {
inherits true //是否从插件继承存储库定义
$ b grailsPlugins()
grailsHome()
mavenLocal()
grailsCentral()
mavenCentral()
//取消注释这些(或添加新的)以启用公共Maven仓库中的远程依赖项解析
// mavenRepohttp:// repository。 codehaus.org
// mavenRepohttp://download.java.net/maven/2/
// mavenRepohttp://repository.jboss.com/maven2/
}

依赖关系{
//在'构建','编译','运行时','测试'或'提供的'范围下指定依赖关系。
// runtime'mysql:mysql-connector-java:5.1.24'
}

plugins {
//仅用于构建系统的插件
build:tomcat:7.0.42

//编译步骤的插件
compile:scaffolding:2.0.0
compile:cache:1.1.1 '

//运行时需要的插件,但不用于编译
runtime:hibernate:3.6.10.1//或:hibernate4:4.1.11.1
runtime: database-migration:1.3.5
runtime:jquery:1.10.2
runtime:resources:1.2
//取消注释(或添加新注释)以启用其他资源
// runtime:zipped-resources:1.0.1
// runtime:cached-resources:1.1
// runtime:yui-minify-resources:0.1。 5
}
}

我正在使用windows xp和我处于通过身份验证的代理连接。是因为连接的问题吗? 1 test将创建一个全新的项目,该项目将具有默认的buildconfig。然后尝试刷新依赖关系,甚至添加一个新的插件,看看你是否得到相同的问题



编辑添加:



http://lalitagarw.blogspot.co.uk/2011/06/ grails-configuration-proxy-settings.html



GRAILS配置 - 代理设置
在GRAILS中有两个设置代理的命令。 p>

 添加代理 - 在proxysettings.groovy文件中添加代理服务器设置
设置代理 - 设置代理设置中的当前代理。 groovy文件。

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



例如:

  grails add-proxy myproxy --host = internet --port = 8085 
grails set-proxy myproxy

如果您使用的是Windows控制台,那么您需要用双引号括起参数。

  grails add-proxy myproxy--host = internet--port = 8085
grails set-proxy myproxy

然后可以在proxysettings.groovy文件中验证设置。这个文件可以位于.grails文件夹中。



这是从上面的链接,将它添加到帖子的原因,因为它解决了迄今为止的一些问题,并且知道网络来来去去。所以最好把它作为答案的一部分包含在这里,希望它仍然适用于所有人。


my BuildConfig.groovy file

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 "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.42"

        // plugins for the compile step
        compile ":scaffolding:2.0.0"
        compile ':cache:1.1.1'

        // plugins needed at runtime but not for compilation
        runtime ":hibernate:3.6.10.1" // or ":hibernate4:4.1.11.1"
        runtime ":database-migration:1.3.5"
        runtime ":jquery:1.10.2"
        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"
    }
}

i am using windows xp and i'm under authenticated proxy connection. Is the problem because of the connection?

解决方案

1 test would be to create a brand new project which will have a default buildconfig. Then to try refresh dependencies and even add a new plugin to see if you get same issue

Edited to add:

http://lalitagarw.blogspot.co.uk/2011/06/grails-configuration-proxy-settings.html

GRAILS Configuration -- Proxy Settings There are two commands to set proxy in GRAILS.

Add Proxy - adds a proxy server setting in proxysettings.groovy file
Set Proxy - sets the current proxy in the proxysettings.groovy file.

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

For example:

grails add-proxy myproxy --host=internet --port=8085
grails set-proxy myproxy

If you are using windows console then you will need to enclose parameters with double quotes.

grails add-proxy myproxy "--host=internet" "--port=8085"
grails set-proxy myproxy

Settings can then be verified in the proxysettings.groovy file. This file can be located in the .grails folder.

This was from above link, reason for adding it to post, since it has resolved a few issues so far and knowing the net things come and go. So best to include it as part of the answer here in the hope it will remain available for all.

这篇关于加载BuildConfig时出错:对于输入字符串:“true”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆