【问题标题】:How to create a plugin with Service Builder by Liferay Maven?如何使用 Liferay Maven 的 Service Builder 创建插件?
【发布时间】:2015-01-13 09:10:19
【问题描述】:

我正在使用 Liferay 6.2.0 我从http://oss.sonatype.org/content/repositories/releases/com/liferay/maven/archetypes/添加原型的远程存储库

我可以在里面创建一个portlet,但是我想创建一个Service Builder插件引用的选项是空的,所以它不能创建service.xml

我尝试手动创建 service.xml 并使用 maven 构建它,但错误消息说我找不到插件!

我已经尝试过 Rushikesh Thakkar 建议我的教程,来自 http://www.cignex.com/articles/building-liferay-service-using-maven-sdk 但是eclipse没有让我选择插件来创建服务构建器。

我手动创建了 service.xml 并尝试构建它,但出现错误:

[ERROR] No plugin found for prefix 'liferay' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/matteo/.m2/repository), central (http://repo.maven.apache.org/maven2)] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException

【问题讨论】:

  • 有很多关于这个要求的文章(例如cignex.com/articles/building-liferay-service-using-maven-sdk)。在发布到 StackOverflow 之前,您需要进行足够的研究/谷歌搜索。
  • 足够的研究将给出答案:) 我们想要找到答案。所以需要一些研究和一些尝试。无论如何,您是否尝试过使用 maven 错误:[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 此外,如果可能,请尝试提供您的 service.xml
  • 您找到解决方案了吗?如果您能在这里分享信息,那就太好了!我也有同样的问题。
  • @RushikeshThakkar 该指南在底部说"I assume that the valid service.xml file is already exist"。我和其他新手可能不知道该文件是什么,如果有关于此事的更广泛的文档会有所帮助,例如在开始使用指南之前的要求列表,例如I assume you know what services is, if not check _here_。那会很棒,并且会大大简化研究。 StackOverflow 问答永远不会有害。如果这个问题能得到解决,那将对我有很大帮助。
  • @Nenotlep,我和 Prakash(见他的评论)建议做一些研究的原因是为了海报的最佳利益,也为了 stackoverflow。但是,由于您认为有关此主题的文档不足,因此我发布了答案。

标签: java maven liferay


【解决方案1】:

这个错误意味着:当你运行“mvn liferay:build-service”时,Maven 无法理解“liferay”在这里的含义。这可能是因为 Maven 无法在您的本地存储库或远程存储库(如果您已配置)中找到 Liferay portlet 插件。大多数情况下,如果原型选择不正确,或者创建 Portlet 时出现错误,就会发生这种情况。

以下是一些描述如何使用 Maven 构建 portlet 的链接:

  1. Liferay 文档:http://www.liferay.com/documentation/liferay-portal/6.2/development/-/ai/developing-plugins-using-maven-liferay-portal-6-2-dev-guide-02--2
  2. 博客文章解释相同,但简单明了:http://michi-path.blogspot.com.au/2013/06/liferay-with-maven-deploying-simple.html

Service builder 是 Liferay 的一项功能,用于为您的 portlet 构建后端。 Liferay 有很好的关于如何使用 Service Builder 的文档。它从编写 service.xml 文件开始。请查看以下链接以更好地理解它:

  1. 关于服务构建器的 Liferay 文档:http://www.liferay.com/documentation/liferay-portal/6.2/development/-/ai/what-is-service-builder-liferay-portal-6-2-dev-guide-04--2
  2. 解释如何构建具有 service.xml 的 maven portlet 的博客文章:http://michi-path.blogspot.com.au/2013/06/liferay-with-maven-service-builder.html

希望这会有所帮助!

【讨论】:

  • 虽然此链接可能会回答问题,但最好在此处包含答案的基本部分并提供链接以供参考。如果链接页面发生更改,仅链接的答案可能会失效。
  • 嗨@Mouser,我不可能发布整个教程(或两个 - 在这种情况下)以获得最初不需要的答案。希望你能理解。
  • 正如 Mouser 之前提到的。将链接作为答案发布是个坏主意。链接不再起作用了。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-08-21
  • 2018-02-03
  • 1970-01-01
  • 2014-08-08
  • 1970-01-01
  • 2016-09-09
相关资源
最近更新 更多