grails - 无法添加 qrcode grails 插件?

标签 grails plugins qr-code grails-2.2

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

相关文章:

eclipse - Grails Assets 管道在Eclipse中显示错误的构建路径

Grails 卡在命令行上

Grails:常规 Groovy 类中的依赖注入(inject)

java - 自定义 Eclipse 透视图中的多个编辑器区域

android - 从画廊android中的图像扫描条形码

python - 如何使用 python 生成二维码并在扫描时使其打开定义的 url?

spring - 无法解决 Spring 安全性

java - 如何为 Android Studio 制作一个简单的插件来自定义鼠标悬停提示

javascript - scrollTo/localscroll.js 根本不工作

cordova-plugins - Ionic cordova-plugin-qrscanner没有相机预览