невозможно добавить плагин qrcode grails? - PullRequest
0 голосов
/ 03 июля 2018

Я запустил совершенно новое приложение Grails 2.2. Я хочу добавить плагин qrcode.

https://plugins.grails.org/plugin/technipelago/qrcode

В документации сказано, что приложение Grails 2 используется

grails.project.dependency.resolution = {
  // ...
  plugins {
    compile ':qrcode:0.7'
    // ...
  }
}

вот мой buildconfig после добавления плагина qrcode

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 для работы. Старая версия подойдет.

Спасибо за помощь!

1 Ответ

0 голосов
/ 03 июля 2018

Сначала добавьте локальный репозиторий Maven (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 этого плагина, где вы можете увидеть доступные версии.

Надеюсь, это поможет вам.

...