0

我只想通过 gwt 项目创建一个 gwt 组合。然后将此复合材料制成罐子。然后想在我的liferay项目的lib文件夹中添加我的每个protlet都可以使用这个gwt组合。

我该怎么做?


到目前为止我做了什么:

  • 创建 gwt 复合,删除入口点并重新编写 .gwt.xml 并创建我的类扩展复合。
  • 然后创建罐子。
  • 然后复制 jar liferay lib 文件夹
  • 然后用jar附加源(java构建路径>库>选择jar并附加源意味着gwt复合项目)[我正在使用eclipse]。
  • 然后继承 portlet .gwt.xml 文件,如:
  • 然后创建复合类的实例并得到这个错误

[javac] Compiling 1 source file to /home/bglobal/liferay-sdk/portlets/data-grid-portlet/docroot/WEB-INF/classes
[javac] /home/bglobal/liferay-sdk/portlets/data-grid-portlet/docroot/WEB-INF/src/com/prolexic/portlet/datagrid/client/DataGridServiceEntryPoint.java:9: package com.prolexic.commonCompositeWidget.client does not exist
[javac] import com.prolexic.commonCompositeWidget.client.CommonCompositeWidget;
[javac] ^
[javac] /home/bglobal/liferay-sdk/portlets/data-grid-portlet/docroot/WEB-INF/src/com/prolexic/portlet/datagrid/client/DataGridServiceEntryPoint.java:17: cannot find symbol
[javac] symbol : class CommonCompositeWidget
[javac] location: class com.prolexic.portlet.datagrid.client.DataGridServiceEntryPoint
[javac] CommonCompositeWidget mycomposite = new CommonCompositeWidget("This is the GWT Composite portlet.");
[javac] ^
[javac] /home/bglobal/liferay-sdk/portlets/data-grid-portlet/docroot/WEB-INF/src/com/prolexic/portlet/datagrid/client/DataGridServiceEntryPoint.java:17: cannot find symbol
[javac] symbol : class CommonCompositeWidget
[javac] location: class com.prolexic.portlet.datagrid.client.DataGridServiceEntryPoint
[javac] CommonCompositeWidget mycomposite = new CommonCompositeWidget("This is the GWT Composite portlet.");
[javac] ^
[javac] 3 errors

4

1 回答 1

0

Gwt 也需要源代码才能在其他项目中使用。因此,在构建 gwt 复合之后,还要在 jar 中包含源文件。然后将其复制到 lib 文件夹中。然后按照这个

  • 右键单击项目
  • 点击构建路径
  • 单击配置构建路径
  • 在库中添加 jar
  • 并按顺序选择jar并导出
  • 在 .gwt.xml 文件中添加继承

上面的 jar 有一个 .gwt.xml 文件,因为它是 gwt 项目,否则创建一个 .gwt.xml 文件并在其中包含源路径。

(这两个项目都是 GWT,那么您可以直接在 build bath 中添加项目并在 liferay 项目的 .gwt.xml 中继承)

如果您不想在 GWT 项目中使用它,然后配置为 maven 然后构建项目,那么您将获得 jar 并在其他项目中重用它

于 2013-02-14T06:43:44.337 回答