我在尝试制作 CRUD portlet 时遇到了 Service Builder 的问题。
首先,我创建了一个项目和 Liferay portlet("This is bla-bla-bla in view mode")。之后,我创建了new->new Service Builder
xml 文件。我在那里插入了以下代码:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.2.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_2_0.dtd">
<service-builder package-path="com.proliferay.sbuilder">
<author>Alexandr</author>
<namespace>crudportlet</namespace>
<entity name="Book" table="BOOK_PORTLET" local-service="true" remote-service="true">
<column name="bookId" type="long" primary="true" id-type="increment"/>
<column name="bookName" type="String" />
<column name="description" type="String" />
<column name="authorName" type="String" />
<column name="isbn" type="int" />
<column name="price" type="int" />
</entity>
接下来,我单击overview
选项卡并按下Build Service
按钮。5 秒后我得到了HTTP Authorization failure
错误。经过 5 个小时的谷歌搜索和 stackoverflow,我得出结论来评论这一行
#ivy.jar.url=http://cdn.repository.liferay.com/nexus/content/repositories/liferay-snapshots-ce/com/liferay/org.apache.ivy/${ivy.version}/org.apache.ivy-${ivy.version}.jar
并粘贴这一行
ivy.jar.url=https://repository.liferay.com/nexus/content/repositories/liferay-public-snapshots/com/liferay/org.apache.ivy/2.4.0.LIFERAY-PATCHED-1-SNAPSHOT/
正如他们在build.Sasha.properties
文件中的其他线程中所说的那样。但我现在的错误:
Unable to obtain resource from D:\LiferayWorkSpace\liferay-plugins-sdk- 6.2\.ivy\ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar: java.util.zip.ZipException: error in opening zip file
[taskdef] Unable to obtain resource from D:\LiferayWorkSpace\liferay-plugins-sdk-6.2\.ivy\ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar:
...
[taskdef] Could not load definitions from resource org/apache/ivy/ant/antlib.xml. It could not be found.
BUILD FAILED
我应该怎么办 ??请帮我!为了使用 Service Builder 创建最简单的 CRUD portlet,我应该怎么做?
我使用 Liferay 6.2 GA5,sdk 6.2。
我的 build.xml 文件:
<?xml version="1.0"?>
<!DOCTYPE project>
<project name="CRUD-portlet" basedir="." default="deploy">
<import file="../build-common-portlet.xml" />
<property file="build.properties"/>
</project>