Как добавить или импортировать зависимости grails в micronaut

#grails #groovy #dependencies #micronaut

#grails #groovy #зависимости #micronaut

Вопрос:

 runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.8.2"
  

Не удалось добавить вышеупомянутую зависимость grails в приложение micronaut.

Отображается следующая ошибка :

 Could not determine the dependencies of task ':shadowJar'.
 > Could not resolve all dependencies for configuration ':runtimeClasspath'.
   > Could not find com.bertramlabs.plugins:asset-pipeline-grails:2.8.2.
     Required by:
         project : > sharedresourcesplugin:sharedresourcesplugin:6.0
  

Показан список зависимостей

 dependencies {
    testCompile "org.grails:grails-plugin-testing"
    testCompile "org.grails:grails-web-testing-support"
    testCompile "org.grails.plugins:hibernate5"
    testCompile "org.hibernate:hibernate-core:5.1.5.Final"
    testCompile "org.grails:grails-gorm-testing-support"

    compile "io.micronaut.configuration:micronaut-jdbc-tomcat"
    compile "io.micronaut.configuration:micronaut-hibernate-validator"
    compile "io.micronaut.configuration:micronaut-hibernate-gorm"
    compile "org.grails:grails-datastore-gorm-hibernate5:$gormVersion"

    compile "io.micronaut:micronaut-http-client"
    compile "io.micronaut:micronaut-http-server-netty"
    compile "io.micronaut:micronaut-runtime-groovy"
    compile "io.micronaut:micronaut-validation"
    compile "javax.annotation:javax.annotation-api"
    compileOnly "io.micronaut:micronaut-inject-groovy"
    runtime "ch.qos.logback:logback-classic:1.2.3"
    runtime "com.h2database:h2"
    runtime "org.apache.tomcat:tomcat-jdbc"
    testCompile "io.micronaut:micronaut-inject-groovy"
    testCompile("org.spockframework:spock-core") {
        exclude group: "org.codehaus.groovy", module: "groovy-all"
    }

    runtime "org.hibernate:hibernate-ehcache:5.1.9.Final"
    runtime group: 'mysql', name: 'mysql-connector-java', version: '8.0.13'
    testCompile "io.micronaut:micronaut-inject-java"
    testCompile "org.hamcrest:hamcrest-all:1.3"

    runtime group: 'com.bertramlabs.plugins', name: 'assest-pipeline-grails', version: '2.8.2'
    compile group: 'sharedresourcesplugin', name: 'sharedresourcesplugin', version: '6.0'
}
  

Несмотря на то, что зависимость добавлена в gradle.build, она по-прежнему выдает ту же ошибку.

Комментарии:

1. asset-pipeline.com/manual/#getting-started — также я думаю, что только ветка 3.x поддерживает grails 4 / micronaut

2. ap 3.x поддерживает Grails 3 и 4 — также у AP есть плагин grails — но вы можете использовать его в любом java-проекте (boot, micronaut, standalone и т.д.)

3.Я решил эту проблему, обновив версию grails, а также добавив assest-pipeline в buildScript . Но появилась другая ошибка, связанная с управлением зависимостями: Cannot resolve external dependency io.micronaut:micronaut-bom:1.0.4 because no repositories are defined io/spring/gradle/dependencymanagement/DependencyManagementExtension Сбой сборки

Ответ №1:

Вам нужно будет включить плагин asset-pipeline gradle, а затем использовать зависимость asset-pipeline micronaut

 plugins {
    id "com.bertramlabs.asset-pipeline" version "3.0.8"
}

dependencies {
  runtime 'com.bertramlabs.plugins:asset-pipeline-micronaut:3.0.8'
  //Example LESS or Sass Integration
  //assets 'com.bertramlabs.plugins:less-asset-pipeline:3.0.8'
  //assets 'com.bertramlabs.plugins:sass-asset-pipeline:3.0.8'
}
  

Дополнительная информация здесь: http://www.asset-pipeline.com/manual/#getting-started-4

Комментарии:

1.Добавив это, моя ошибка была изменена на : Caused by: java.lang.NoClassDefFoundError: io/spring/gradle/dependencymanagement/DependencyManagementExtension at org.springframework.boot.gradle.dependencymanagement.DependencyManagementPluginFeatures.apply(DependencyManagementPluginFeatures.java:45) at org.springframework.boot.gradle.plugin.SpringBootPlugin.apply(SpringBootPlugin.java:49)

2. Я сталкиваюсь с такой же проблемой, вы нашли решение ubaid?