为自定义Grails插件创建GroupID和ArtifactID [英] Creating GroupID and ArtifactID for a custom Grails plugin
问题描述
我正在编写自己的Grails插件。
当我打包时,我看到一个pom.xml和plugin.xml被生成。其中 groupId
和 artifactId
是 org.grails.plugins
和 plugin-config
。
我想指定这些应该是什么,以便我的插件结束在美工的正确位置。
我该怎么做?
谢谢。
这是插件的默认设置 groupId
的作用。对于所有grails插件,它都是 org.grails.plugins
。
您可以通过在插件描述符中设置属性来修改 groupId
:
class PluginDemoGrailsPLugin {
//或def groupId = ...
def group =com.example.plugins
......
}
artifactId按惯例选择为好。例如:
项目名称 - > ArtifactId - >神器名称
-------------------------------------------- ---------
PluginDemo - > plugin-demo - > grails-plugin-demo.zip
PluginConfig - > plugin-config - > grails-plugin-config.zip
我还没有看到 artifactId
被自定义而没有集成Maven或Gradle等构建工具。使用这些构建工具,可以如何指定 groupId
和 artifactId
。
I am writing my own Grails Plugin.
When I package it, I see a pom.xml and plugin.xml are generated. In these, the groupId
and artifactId
are org.grails.plugins
and plugin-config
respectively.
I would like to specify what these should be so hat my plugin ends up in the correct place in artifactory.
How do I do this?
Thanks.
It is the job of release plugin to set the default groupId
for the plugin. For all grails plugin it is org.grails.plugins
.
You can modify groupId
by setting a property in plugin descriptor as:
class PluginDemoGrailsPLugin{
//or def groupId = ...
def group = "com.example.plugins"
......
}
The artifactId is chosen by convention as well. For example:
Project Name --> ArtifactId --> Artifact Name
-----------------------------------------------------
PluginDemo --> plugin-demo --> grails-plugin-demo.zip
PluginConfig --> plugin-config --> grails-plugin-config.zip
I have not seen the artifactId
being customized without integrating with build tools like Maven or Gradle. Using these build tools it is transparent as to how groupId
and artifactId
can be specified.
这篇关于为自定义Grails插件创建GroupID和ArtifactID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!