gpt4 book ai didi

grails - 无法添加 qrcode grails 插件?

转载 作者:行者123 更新时间:2023-12-02 15:44:24 28 4
gpt4 key购买 nike

我启动了一个全新的 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'

}
}

当我 build

它说
|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 插件即可。旧版本可以。

谢谢您的帮助!

最佳答案

首先添加本地maven repo (mavenLocal())在 BuildConfig.groovy 中:

repositories {
inherits true
grailsPlugins()
mavenLocal()
mavenCentral()
}

然后在 BuildConfig.groovy 中添加依赖:
dependencies {
compile "org.grails.plugins:qrcode:0.7"
}

如果通过添加依赖项不起作用,则将其添加到插件中:
plugins {
compile(':qrcode:0.7')
}

您可以引用 repo这个插件,你可以看到可用的版本。

希望这对您有所帮助。

关于grails - 无法添加 qrcode grails 插件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51146917/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com