Grails可以';无法加载maven发布服务器

Grails可以';无法加载maven发布服务器,grails,maven-2,maven-plugin,grails-2.3,Grails,Maven 2,Maven Plugin,Grails 2.3,我正在尝试向Grails(2.3.6)插件添加maven publisher,如下所示: dependencies { compile 'org.mongodb.morphia:morphia:0.107' compile ":maven-publisher:0.8.1" } 当我运行grails compile时,我得到: | Error There was an error loading the BuildConfig: Bad artifact coordinates

我正在尝试向Grails(2.3.6)插件添加
maven publisher
,如下所示:

dependencies {
    compile 'org.mongodb.morphia:morphia:0.107'
    compile ":maven-publisher:0.8.1"
}
当我运行
grails compile
时,我得到:

| Error There was an error loading the BuildConfig: Bad artifact coordinates
:maven-publisher:0.8.1, expected format is <groupId>:<artifactId>[:<extension>[
:<classifier>]]:<version> (Use --stacktrace to see the full trace)
|错误加载BuildConfig时出错:错误工件坐标
:maven publisher:0.8.1,预期格式为:[:[
:]]:(使用--stacktrace查看完整跟踪)

这是怎么回事?

不要使用
maven publisher
插件。它已经过时了。使用
release
插件-它应该已经在插件的
BuildConfig.groovy
中了。如果没有,下面是它的外观(去除不必要的积垢后):

正如@dmahapatro在他的评论中所说的,jar依赖项位于
依赖项
块中,而插件依赖项位于
插件
块中

还请注意,您应该保持
export=false
设置,以便插件在本地可用,但不会作为不必要的传递依赖项泄漏到包含应用程序中。

compile:maven publisher:0.8.1“
作为Grails插件,应该在
plugins{}下
而不是
依赖项{}
grails.project.work.dir = 'target'

grails.project.dependency.resolution = {

   inherits 'global'
   log 'warn'

   repositories {
      grailsCentral()
      mavenLocal()
      mavenCentral()
   }

   dependencies {
      compile 'org.mongodb.morphia:morphia:0.107'
   }

   plugins {
      build ':release:3.0.1', ':rest-client-builder:1.0.3', {
         export = false
      }
   }
}