Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Eclipse 创建我的第一个liferay portlet(maven)时,我在部署时遇到了一个错误_Eclipse_Maven_Liferay_Portlet - Fatal编程技术网

Eclipse 创建我的第一个liferay portlet(maven)时,我在部署时遇到了一个错误

Eclipse 创建我的第一个liferay portlet(maven)时,我在部署时遇到了一个错误,eclipse,maven,liferay,portlet,Eclipse,Maven,Liferay,Portlet,我是liferay的新手,我已经创建了我的第一个liferay portlet 但是,当我右键单击我的项目并转到 Liferay>Maven>Liferay:部署 我得到这个错误 [INFO] Scanning for projects... [ERROR] [ERROR] Some problems were encountered while processing the POMs: [ERROR] 'dependencies.dependency.version' for com.lif

我是liferay的新手,我已经创建了我的第一个liferay portlet

但是,当我右键单击我的项目并转到

Liferay>Maven>Liferay:部署

我得到这个错误

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'dependencies.dependency.version' for com.liferay.portal:portal-service:jar must be a valid version but is '${liferay.version}'. @ line 55, column 13
[ERROR] 'dependencies.dependency.version' for com.liferay.portal:util-bridges:jar must be a valid version but is '${liferay.version}'. @ line 61, column 13
[ERROR] 'dependencies.dependency.version' for com.liferay.portal:util-taglib:jar must be a valid version but is '${liferay.version}'. @ line 67, column 13
[ERROR] 'dependencies.dependency.version' for com.liferay.portal:util-java:jar must be a valid version but is '${liferay.version}'. @ line 73, column 13
[ERROR] 'build.plugins.plugin.version' for com.liferay.maven.plugins:liferay-maven-plugin must be a valid version but is '${liferay.maven.plugin.version}'. @ line 15, column 14
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.example.plugins:try:1.0.0-SNAPSHOT (C:\Users\otaibit.ENDLAB\workspace\try\pom.xml) has 5 errors
[ERROR]     'dependencies.dependency.version' for com.liferay.portal:portal-service:jar must be a valid version but is '${liferay.version}'. @ line 55, column 13
[ERROR]     'dependencies.dependency.version' for com.liferay.portal:util-bridges:jar must be a valid version but is '${liferay.version}'. @ line 61, column 13
[ERROR]     'dependencies.dependency.version' for com.liferay.portal:util-taglib:jar must be a valid version but is '${liferay.version}'. @ line 67, column 13
[ERROR]     'dependencies.dependency.version' for com.liferay.portal:util-java:jar must be a valid version but is '${liferay.version}'. @ line 73, column 13
[ERROR]     'build.plugins.plugin.version' for com.liferay.maven.plugins:liferay-maven-plugin must be a valid version but is '${liferay.maven.plugin.version}'. @ line 15, column 14
[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/ProjectBuildingException

这显然以某种方式缺少
${liferay.version}
属性。您可以在父POM、您的POM或常规设置中进行设置-所有这些都带有完整的父POM示例,链接到进一步的文档


我知道不鼓励只链接到这里的文档,但我相信这个答案后面会有另一个关于liferay maven插件更多配置的问题,镜像这里的文档太多了

您需要创建Maven配置文件。 它应该在pom.xml或Maven/Settings/conf.xml中定义

我的个人资料之一的示例

<profile>
<id>lr7</id>
<properties>
 <liferay.version>7.0.0</liferay.version>
 <liferay.maven.plugin.version>7.0.0</liferay.maven.plugin.version>
 <liferay.auto.deploy.dir>E:\lr-train\DXP\liferay-dxp-digital-enterprise-7.0-ga1\deploy</liferay.auto.deploy.dir>
 <liferay.app.server.deploy.dir>E:\lr-train\DXP\liferay-dxp-digital-enterprise-7.0-ga1\tomcat-8.0.32\webapps</liferay.app.server.deploy.dir>
 <liferay.app.server.lib.global.dir>E:\lr-train\DXP\liferay-dxp-digital-enterprise-7.0-ga1\tomcat-8.0.32\lib\ext</liferay.app.server.lib.global.dir>
 <liferay.app.server.portal.dir>E:\lr-train\DXP\liferay-dxp-digital-enterprise-7.0-ga1\tomcat-8.0.32\webapps\ROOT</liferay.app.server.portal.dir>
</properties>
</profile>

lr7
7.0.0
7.0.0
E:\lr train\DXP\liferay-DXP-digital-enterprise-7.0-ga1\deploy
E:\lr train\DXP\liferay-DXP-digital-enterprise-7.0-ga1\tomcat-8.0.32\webapps
E:\lr train\DXP\liferay-DXP-digital-enterprise-7.0-ga1\tomcat-8.0.32\lib\ext
E:\lr train\DXP\liferay-DXP-digital-enterprise-7.0-ga1\tomcat-8.0.32\webapps\ROOT
现在,您可以在部署时指定概要文件 i、 e mvn清理包liferay:deploy-PprofileName

或者您可以设置活动配置文件

<activeProfiles>
    <activeProfile>alwaysActiveProfile</activeProfile>
  </activeProfiles>