我启动了一个全新的grails 2.2应用程序。我想添加qrcode插件。
https://plugins.grails.org/plugin/technipelago/qrcode
文档说Grails 2应用程序使用
grails.project.dependency.resolution = {
// ...
plugins {
compile ':qrcode:0.7'
// ...
}
}
这是添加qrcode插件后的buildconfig
grails.servlet.version = "2.5" // 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.target.level = 1.6
grails.project.source.level = 1.6
//grails.project.war.file = "target/${appName}-${appVersion}.war"
// uncomment (and adjust settings) to fork the JVM to isolate classpaths
//grails.project.fork = [
// run: [maxMemory:1024, minMemory:64, debug:false, maxPerm:256]
//]
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()
grailsCentral()
mavenCentral()
// uncomment these (or add new ones) to enable remote dependency resolution from public Maven repositories
//mavenRepo "http://snapshots.repository.codehaus.org"
//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.20'
}
plugins {
runtime ":hibernate:$grailsVersion"
runtime ":jquery:1.8.3"
runtime ":resources:1.1.6"
build ":tomcat:$grailsVersion"
runtime ":database-migration:1.2.1"
compile ':cache:1.0.1'
compile ':qrcode:0.7'
}
}
建造时
说
|Loading Grails 2.2.0
|Configuring classpath
Error |
Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):
- org.grails.plugins:qrcode:0.7
我非常感谢您提供有关集成qrcode插件的帮助。我不需要最新版本。我只需要使qrcode插件起作用即可。旧版本可以。
感谢您的帮助!
答案 0 :(得分:0)
首先在BuildConfig.groovy中将本地Maven存储库(mavenLocal())
添加到您的计算机中:
repositories {
inherits true
grailsPlugins()
mavenLocal()
mavenCentral()
}
然后在BuildConfig.groovy中添加依赖项:
dependencies {
compile "org.grails.plugins:qrcode:0.7"
}
如果通过添加依赖项不起作用,则将其添加到插件:
plugins {
compile(':qrcode:0.7')
}
您可以参考此插件的repo,在其中可以看到可用的版本。
希望这对您有所帮助。
答案 1 :(得分:0)
尝试0.7.1版
我看起来
它也适用于Grails 2.x,应该像您一样将其放在select itemno, code,
sum(qtyOnHand) as SumQtyOnHand,
sum(qtyOnSale) as SumQtyOnSale,
sum(qtyOnPurchase) as SumQtyOnPurchase
from (
select itemno, code, qty as qtyOnHand, null as qtyOnSale, null as qtyOnPurchase from dbo.onhand
union all select itemno, code, null, qty, null from dbo.sale
union all select itemno, code, null, null, qty from dbo.purchase
) t
group by itemno, code
部分中即可正常加载。