-1

我正在尝试maven-publisher像这样添加到 Grails (2.3.6) 插件中:

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)

这里发生了什么?

4

1 回答 1

1

不要使用maven-publisher插件。它已经过时且已被弃用。使用release插件 - 它应该已经在你插件的BuildConfig.groovy. 如果没有,它应该是这样的(在去除不必要的杂物之后):

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
      }
   }
}

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

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

于 2014-04-02T18:21:14.330 回答