我是Liferay的新手,所以我开始使用官方开发者网站(https://dev.liferay.com/develop/learning-paths/mvc/-/knowledge_base/6-2/writing-your-first-liferay-application)上的教程。
当我创建我的第一个portlet时,我收到下面的Build Failed错误:
Buildfile: E:\phmathieu\liferay-plugins-sdk-6.2\portlets\build.xml
[get] Getting: http://mirrors.lax.liferay.com/cdn.repository.liferay.com/nexus/content/repositories/liferay-snapshots-ce/com/liferay/org.apache.ivy/2.4.0.LIFERAY-PATCHED-1-SNAPSHOT/org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar
[get] To: C:\Users\TEMP\.liferay\mirrors\cdn.repository.liferay.com\nexus\content\repositories\liferay-snapshots-ce\com\liferay\org.apache.ivy\2.4.0.LIFERAY-PATCHED-1-SNAPSHOT\org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar
[get] Error getting http://mirrors.lax.liferay.com/cdn.repository.liferay.com/nexus/content/repositories/liferay-snapshots-ce/com/liferay/org.apache.ivy/2.4.0.LIFERAY-PATCHED-1-SNAPSHOT/org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar to C:\Users\TEMP\.liferay\mirrors\cdn.repository.liferay.com\nexus\content\repositories\liferay-snapshots-ce\com\liferay\org.apache.ivy\2.4.0.LIFERAY-PATCHED-1-SNAPSHOT\org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar
[get] Getting: http://cdn.repository.liferay.com/nexus/content/repositories/liferay-snapshots-ce/com/liferay/org.apache.ivy/2.4.0.LIFERAY-PATCHED-1-SNAPSHOT/org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar
[get] To: C:\Users\TEMP\.liferay\mirrors\cdn.repository.liferay.com\nexus\content\repositories\liferay-snapshots-ce\com\liferay\org.apache.ivy\2.4.0.LIFERAY-PATCHED-1-SNAPSHOT\org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar
[get] Error getting http://cdn.repository.liferay.com/nexus/content/repositories/liferay-snapshots-ce/com/liferay/org.apache.ivy/2.4.0.LIFERAY-PATCHED-1-SNAPSHOT/org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar to C:\Users\TEMP\.liferay\mirrors\cdn.repository.liferay.com\nexus\content\repositories\liferay-snapshots-ce\com\liferay\org.apache.ivy\2.4.0.LIFERAY-PATCHED-1-SNAPSHOT\org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar
建立失败
E:... \ liferay-plugins-sdk-6.2 \ portlets \ build.xml:5:执行此行时发生以下错误:
E:... \ liferay-plugins-sdk-6.2 \ build-common-plugins.xml:5:执行此行时发生以下错误:
E:... \ liferay-plugins-sdk-6.2 \ build-common.xml:60:执行此行时发生以下错误:
E:... \ liferay-plugins-sdk-6.2 \ build-common-ivy.xml:130:执行此行时发生以下错误:
E:... \ liferay-plugins-sdk-6.2 \ build-common-ivy.xml:81:java.net.ConnectException:连接被拒绝:连接
总时间:1秒
我不知道为什么我收到此消息,因为我基本上按照教程中的步骤操作。我在网上查找了类似的案例,但它还没有用。
修改
build-common-ivy.xml第81行会发生什么:(第81行是/>结束第二个 get )
<if>
<equals arg1="@{trylocalnetwork}" arg2="true" />
<then>
<trycatch>
<try>
<get
dest="${mirrors.cache.artifact.dir}"
ignoreerrors="@{ignoreerrors}"
src="${mirrors.src}"
verbose="@{verbose}"
/>
</try>
<catch>
<get
dest="${mirrors.cache.artifact.dir}"
ignoreerrors="@{ignoreerrors}"
src="@{src}"
verbose="@{verbose}"
/>
</catch>
</trycatch>
</then>
<else>
<get
dest="${mirrors.cache.artifact.dir}"
ignoreerrors="@{ignoreerrors}"
src="@{src}"
verbose="@{verbose}"
/>
</else>
</if>
答案 0 :(得分:0)
我使用两种方法来创建Lifery项目。走轻松的道路
下载所需内容
从此处下载Liferay IDE或Eclipse插件
https://www.liferay.com/downloads/liferay-projects/liferay-ide
下载SDK或整个插件(我更喜欢这最后一个选项)
https://github.com/liferay/liferay-plugins/releases
选择与您的Liferay匹配的那个
当您打开liferay IDE时,它会询问您的SDK。放入sdk路径(或插件文件夹)
创建项目
只需转到新的Liferay项目,然后选择项目类型。我个人总是去做maven项目。
然后你应该好好去
更复杂的方式
转到portlet文件夹的解压缩插件路径(如果你的意图是一个porlet)并调用create.sh命令
liferay-plugins-6.2.0-ga1/portlets$ ./create.sh myPortlet
Buildfile: /home/jimmy/Liferays/plugins-src/liferay-plugins-6.2.0-ga1/portlets/build.xml
create:
[copy] Copying 9 files to /home/jimmy/Liferays/plugins-src/liferay-plugins-6.2.0-ga1/portlets/myPortlet-portlet
[mkdir] Created dir: /home/jimmy/Liferays/plugins-src/liferay-plugins-6.2.0-ga1/portlets/myPortlet-portlet/docroot/WEB-INF/tld
[copy] Copying 7 files to /home/jimmy/Liferays/plugins-src/liferay-plugins-6.2.0-ga1/portlets/myPortlet-portlet/docroot/WEB-INF/tld
BUILD SUCCESSFUL
Total time: 1 second
然后将其导入您喜欢的ide,因为您有许多插件,您可以将其用作自定义portlet的参考。
希望有所帮助