0

我想开始开发新的 kura 包,所以我克隆了 github/eclipse/kura 存储库,并一步一步地按照本指南进行操作。事实上,我在写这篇文章时正在重复这些步骤。

这是我想问的问题,

1) Maven 版本:在文档中,建议使用 Maven 3.0.5,它说 Maven 3.1.0 有错误。当前的 Maven 版本是 3.3.9。我还是应该使用 3.0.5 还是可以使用最新版本?(我用的是3.0.5)

2)构建目标平台:我在目标平台文件夹中运行“mvn clean install”命令。这是输出,

mvn clean install
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for                                                                                                               org.eclipse.kura:org.usb4java:bundle:1.0.0
[WARNING] 'dependencies.dependency.systemPath' for org.usb4java:org.usb4java:jar                                                                                                               should not point at files within the project directory, ${basedir}/src/lib/usb4                                                                                                              java-1.2.0.jar will be unresolvable by dependent projects @ line 41, column 25
[WARNING] 'dependencies.dependency.systemPath' for org.usb4java:org.usb4java.lin                                                                                                              ux-arm:jar should not point at files within the project directory, ${basedir}/sr                                                                                                              c/lib/libusb4java-1.2.0-linux-arm.jar will be unresolvable by dependent projects                                                                                                               @ line 49, column 25
[WARNING] 'dependencies.dependency.systemPath' for org.usb4java:org.usb4java.lin                                                                                                              ux-x86_64:jar should not point at files within the project directory, ${basedir}                                                                                                              /src/lib/libusb4java-1.2.0-linux-x86_64.jar will be unresolvable by dependent pr                                                                                                              ojects @ line 57, column 25
[WARNING] 'dependencies.dependency.systemPath' for org.usb4java:org.usb4java.lin                                                                                                              ux-x86:jar should not point at files within the project directory, ${basedir}/sr                                                                                                              c/lib/libusb4java-1.2.0-linux-x86.jar will be unresolvable by dependent projects                                                                                                               @ line 65, column 25
[WARNING] 'dependencies.dependency.systemPath' for org.usb4java:org.usb4java.osx                                                                                                              -x86:jar should not point at files within the project directory, ${basedir}/src/                                                                                                              lib/libusb4java-1.2.0-osx-x86.jar will be unresolvable by dependent projects @ l                                                                                                              ine 73, column 25
[WARNING] 'dependencies.dependency.systemPath' for org.usb4java:org.usb4java.osx                                                                                                              -x86_64:jar should not point at files within the project directory, ${basedir}/s                                                                                                              rc/lib/libusb4java-1.2.0-osx-x86_64.jar will be unresolvable by dependent projec                                                                                                              ts @ line 81, column 25
[WARNING] 'dependencies.dependency.systemPath' for org.usb4java:org.usb4java.win                                                                                                              dows-x86_64:jar should not point at files within the project directory, ${basedi                                                                                                              r}/src/lib/libusb4java-1.2.0-windows-x86_64.jar will be unresolvable by dependen                                                                                                              t projects @ line 90, column 25
[WARNING] 'dependencies.dependency.systemPath' for org.usb4java:org.usb4java.win                                                                                                              dows-x86:jar should not point at files within the project directory, ${basedir}/                                                                                                              src/lib/libusb4java-1.2.0-windows-x86.jar will be unresolvable by dependent proj                                                                                                              ects @ line 98, column 25
[WARNING]
[WARNING] Some problems were encountered while building the effective model for                                                                                                               org.eclipse.kura:usb4java-javax:bundle:1.0.0
[WARNING] 'dependencies.dependency.systemPath' for javax.usb:usb-api:jar should                                                                                                               not point at files within the project directory, ${basedir}/src/lib/usb-api-1.0.                                                                                                              2.jar will be unresolvable by dependent projects @ line 32, column 25
[WARNING] 'dependencies.dependency.systemPath' for usb4java-javax:org.usb4java.j                                                                                                              avax:jar should not point at files within the project directory, ${basedir}/src/                                                                                                              lib/usb4java-javax-1.2.0.jar will be unresolvable by dependent projects @ line 4                                                                                                              0, column 25
[WARNING]
[WARNING] Some problems were encountered while building the effective model for                                                                                                               org.eclipse.kura:p2-repo-common:pom:1.0.0
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found d                                                                                                              uplicate declaration of plugin org.apache.maven.plugins:maven-antrun-plugin @ li                                                                                                              ne 194, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for                                                                                                               org.eclipse.kura:p2-repo-equinox_3.8.1:pom:1.0.0
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found d                                                                                                              uplicate declaration of plugin org.apache.maven.plugins:maven-antrun-plugin @ li                                                                                                              ne 95, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten t                                                                                                              he stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support buildin                                                                                                              g such malformed projects.
[WARNING]

[INFO] Executed tasks
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] target-platform ................................... SUCCESS [0.171s]
[INFO] Java API for working with Human Interface USB Devices (HID)  SUCCESS [2.550s]
[INFO] usb4java .......................................... SUCCESS [0.688s]
[INFO] usb4java-javax .................................... SUCCESS [0.478s]
[INFO] Serial Device based on SODA DK comm ............... SUCCESS [0.931s]
[INFO] p2-repo-common .................................... SUCCESS [2.870s]
[INFO] p2-repo-equinox_3.8.1 ............................. SUCCESS [2.872s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.076s
[INFO] Finished at: Tue Nov 24 10:49:01 EET 2015
[INFO] Final Memory: 28M/306M
[INFO] ------------------------------------------------------------------------

(省略了其他信息日志。)

日志显示成功,但有一些与 usb4java 相关的警告。我应该解决这个警告还是忽略它们?

3)构建核心组件

我构建了支持 CAN 和 WEB UI 的核心组件。

CAN 支持内置日志;

[INFO]
[INFO] --- tycho-p2-plugin:0.20.0:update-local-index (default-update-local-index) @ org.eclipse.kura.protocol.can.test ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] kura .............................................. SUCCESS [20.192s]
[INFO] Kura Target Definition ............................ SUCCESS [0.274s]
[INFO] org.eclipse.kura.api .............................. SUCCESS [10.218s]
[INFO] org.eclipse.kura.test ............................. SUCCESS [0.464s]
[INFO] org.eclipse.kura.core ............................. SUCCESS [0.718s]
[INFO] org.eclipse.kura.core.certificates ................ SUCCESS [0.396s]
[INFO] org.eclipse.kura.core.cloud ....................... SUCCESS [0.643s]
[INFO] org.eclipse.kura.core.comm ........................ SUCCESS [0.338s]
[INFO] org.eclipse.kura.core.configuration ............... SUCCESS [0.510s]
[INFO] org.eclipse.kura.core.crypto ...................... SUCCESS [0.294s]
[INFO] org.eclipse.kura.core.deployment .................. SUCCESS [0.582s]
[INFO] org.eclipse.kura.core.log ......................... SUCCESS [0.350s]
[INFO] org.eclipse.kura.core.net ......................... SUCCESS [0.469s]
[INFO] org.eclipse.kura.deployment.agent ................. SUCCESS [0.354s]
[INFO] org.eclipse.kura.deployment.customizer ............ SUCCESS [0.382s]
[INFO] org.eclipse.kura.deployment.customizer.upgrade .... SUCCESS [0.356s]
[INFO] org.eclipse.kura.deployment.update ................ SUCCESS [0.243s]
[INFO] org.eclipse.kura.linux.bluetooth .................. SUCCESS [0.422s]
[INFO] org.eclipse.kura.linux.clock ...................... SUCCESS [0.367s]
[INFO] org.eclipse.kura.linux.command .................... SUCCESS [0.312s]
[INFO] org.eclipse.kura.linux.gpio ....................... SUCCESS [0.421s]
[INFO] org.eclipse.kura.linux.net ........................ SUCCESS [0.812s]
[INFO] org.eclipse.kura.linux.net.test ................... SUCCESS [0.334s]
[INFO] org.eclipse.kura.linux.position ................... SUCCESS [0.366s]
[INFO] org.eclipse.kura.linux.status ..................... SUCCESS [0.379s]
[INFO] org.eclipse.kura.linux.usb ........................ SUCCESS [0.349s]
[INFO] org.eclipse.kura.linux.watchdog ................... SUCCESS [0.389s]
[INFO] org.eclipse.kura.net.admin ........................ SUCCESS [0.914s]
[INFO] org.eclipse.kura.protocol.modbus .................. SUCCESS [2.538s]
[INFO] org.eclipse.kura.protocol.modbus.test ............. SUCCESS [0.326s]
[INFO] org.eclipse.kura.emulator ......................... SUCCESS [0.449s]
[INFO] org.eclipse.kura.emulator.gpio .................... SUCCESS [0.331s]
[INFO] org.eclipse.kura.core.test ........................ SUCCESS [0.593s]
[INFO] examples .......................................... SUCCESS [0.142s]
[INFO] org.eclipse.kura.demo.heater ...................... SUCCESS [0.306s]
[INFO] org.eclipse.kura.demo.modbus ...................... SUCCESS [0.318s]
[INFO] org.eclipse.kura.example.project .................. SUCCESS [0.403s]
[INFO] org.eclipse.kura.example.publisher ................ SUCCESS [0.329s]
[INFO] org.eclipse.kura.example.serial.publisher ......... SUCCESS [0.361s]
[INFO] org.eclipse.kura.example.gpio ..................... SUCCESS [0.324s]
[INFO] org.eclipse.kura.example.ble.tisensortag .......... SUCCESS [0.375s]
[INFO] org.eclipse.kura.example.beacon ................... SUCCESS [0.268s]
[INFO] org.eclipse.kura.protocol.can ..................... SUCCESS [2.750s]
[INFO] org.eclipse.kura.protocol.can.test ................ SUCCESS [0.304s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:01.882s
[INFO] Finished at: Tue Nov 24 10:53:02 EET 2015
[INFO] Final Memory: 68M/912M
[INFO] ------------------------------------------------------------------------

WEB UI 支持内置日志;

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] kura .............................................. SUCCESS [0.527s]
[INFO] org.eclipse.kura.web .............................. SUCCESS [1:58.386s]
[INFO] distrib ........................................... FAILURE [26.423s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:25.708s
[INFO] Finished at: Tue Nov 24 10:56:25 EET 2015
[INFO] Final Memory: 40M/235M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (intel-edison-jars) on project distrib: An Ant BuildException has occured: The following error occurred while executing this line:
[ERROR] C:\Users\Gohm\git\kura\kura\distrib\src\main\ant\build_equinox_distrib.xml:496: Execute failed: java.io.IOException: Cannot run program "C:\Users\Gohm\git\kura\kura\distrib\target\..\src\main\sh\create_installer.sh" (in directory "C:\Users\Gohm\git\kura\kura\distrib"): CreateProcess error=193, %1 is not a valid Win32 application
[ERROR] around Ant part ...<ant antfile="C:\Users\Gohm\git\kura\kura\distrib/src/main/ant/build_equinox_distrib.xml" target="dist-linux"/>... @ 15:114 in C:\Users\Gohm\git\kura\kura\distrib\target\antrun\build-main.xml
[ERROR] -> [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/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :distrib

我正在关注官方文档,此时发生了故障。由于与intel-edison有关的错误(我将使用RaspberryPi),因此我忽略了该问题并继续。

4) Eclipse 工作区准备

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] kura .............................................. SUCCESS [0.188s]
[INFO] Kura Target Definition ............................ SUCCESS [0.003s]
[INFO] org.eclipse.kura.api .............................. SUCCESS [0.069s]
[INFO] org.eclipse.kura.test ............................. SUCCESS [0.005s]
[INFO] org.eclipse.kura.core ............................. SUCCESS [0.005s]
[INFO] org.eclipse.kura.core.certificates ................ SUCCESS [0.004s]
[INFO] org.eclipse.kura.core.cloud ....................... SUCCESS [0.004s]
[INFO] org.eclipse.kura.core.comm ........................ SUCCESS [0.003s]
[INFO] org.eclipse.kura.core.configuration ............... SUCCESS [0.003s]
[INFO] org.eclipse.kura.core.crypto ...................... SUCCESS [0.004s]
[INFO] org.eclipse.kura.core.deployment .................. SUCCESS [0.003s]
[INFO] org.eclipse.kura.core.log ......................... SUCCESS [0.005s]
[INFO] org.eclipse.kura.core.net ......................... SUCCESS [0.005s]
[INFO] org.eclipse.kura.deployment.agent ................. SUCCESS [0.005s]
[INFO] org.eclipse.kura.deployment.customizer ............ SUCCESS [0.004s]
[INFO] org.eclipse.kura.deployment.customizer.upgrade .... SUCCESS [0.011s]
[INFO] org.eclipse.kura.deployment.update ................ SUCCESS [0.004s]
[INFO] org.eclipse.kura.linux.bluetooth .................. SUCCESS [0.005s]
[INFO] org.eclipse.kura.linux.clock ...................... SUCCESS [0.005s]
[INFO] org.eclipse.kura.linux.command .................... SUCCESS [0.005s]
[INFO] org.eclipse.kura.linux.gpio ....................... SUCCESS [0.005s]
[INFO] org.eclipse.kura.linux.net ........................ SUCCESS [0.005s]
[INFO] org.eclipse.kura.linux.net.test ................... SUCCESS [0.003s]
[INFO] org.eclipse.kura.linux.position ................... SUCCESS [0.004s]
[INFO] org.eclipse.kura.linux.status ..................... SUCCESS [0.003s]
[INFO] org.eclipse.kura.linux.usb ........................ SUCCESS [0.002s]
[INFO] org.eclipse.kura.linux.watchdog ................... SUCCESS [0.003s]
[INFO] org.eclipse.kura.net.admin ........................ SUCCESS [0.004s]
[INFO] org.eclipse.kura.protocol.modbus .................. SUCCESS [0.003s]
[INFO] org.eclipse.kura.protocol.modbus.test ............. SUCCESS [0.003s]
[INFO] org.eclipse.kura.emulator ......................... SUCCESS [0.003s]
[INFO] org.eclipse.kura.emulator.gpio .................... SUCCESS [0.002s]
[INFO] org.eclipse.kura.core.test ........................ SUCCESS [0.006s]
[INFO] examples .......................................... SUCCESS [0.002s]
[INFO] org.eclipse.kura.demo.heater ...................... SUCCESS [0.003s]
[INFO] org.eclipse.kura.demo.modbus ...................... SUCCESS [0.003s]
[INFO] org.eclipse.kura.example.project .................. SUCCESS [1.695s]
[INFO] org.eclipse.kura.example.publisher ................ SUCCESS [0.047s]
[INFO] org.eclipse.kura.example.serial.publisher ......... SUCCESS [0.005s]
[INFO] org.eclipse.kura.example.gpio ..................... SUCCESS [0.041s]
[INFO] org.eclipse.kura.example.ble.tisensortag .......... SUCCESS [0.042s]
[INFO] org.eclipse.kura.example.beacon ................... SUCCESS [0.041s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.844s
[INFO] Finished at: Tue Nov 24 11:00:21 EET 2015
[INFO] Final Memory: 54M/649M
[INFO] ------------------------------------------------------------------------



[INFO] Executed tasks
[INFO]
[INFO] <<< maven-eclipse-plugin:2.10:eclipse (default-cli) @ distrib <<<
[INFO]
[INFO] --- maven-eclipse-plugin:2.10:eclipse (default-cli) @ distrib ---
[INFO] Using Eclipse Workspace: C:\Users\Gohm\git
[WARNING] Workspace defines a VM that does not contain a valid jre/lib/rt.jar: C:\Program Files\Java\jre1.8.0_60
[INFO] no substring wtp server match.
[INFO] Using as WTP server : Pivotal tc Server Developer Edition (Runtime) v3.1
[INFO] Adding default classpath container: org.eclipse.jdt.launching.JRE_CONTAINER
[INFO] Resource directory's path matches an existing source directory. Resources have been merged with the source directory src/main/resources
[INFO] Resource directory's path matches an existing source directory. Resources have been merged with the source directory src/main/resources
[INFO] Resource directory's path matches an existing source directory. Resources have been merged with the source directory src/main/resources
[INFO] Resource directory's path matches an existing source directory. Resources have been merged with the source directory src/main/resources
[INFO] Resource directory's path matches an existing source directory. Resources have been merged with the source directory src/main/resources
[INFO] Resource directory's path matches an existing source directory. Resources have been merged with the source directory src/main/resources
[INFO] Resource directory's path matches an existing source directory. Resources have been merged with the source directory src/main/resources
[INFO] Resource directory's path matches an existing source directory. Resources have been merged with the source directory src/main/resources
[INFO] Resource directory's path matches an existing source directory. Resources have been merged with the source directory src/main/resources
[INFO] Resource directory's path matches an existing source directory. Resources have been merged with the source directory src/main/resources
[INFO] Not writing settings - defaults suffice
[INFO] Wrote Eclipse project for "distrib" to C:\Users\Gohm\git\kura\kura\distrib.
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] kura .............................................. SUCCESS [0.455s]
[INFO] distrib ........................................... SUCCESS [11.016s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.917s
[INFO] Finished at: Tue Nov 24 11:01:26 EET 2015
[INFO] Final Memory: 22M/315M
[INFO] ------------------------------------------------------------------------

现在我认为一切都很好,我继续配置 Eclipse,(我正在使用 Eclipse Mars),

透视图:Java(不是 Java EE),已安装 Maven 2 Eclipse,已安装 eGit,Eclipse 已重新启动。

导入现有的 Maven 项目, 在此处输入图像描述

团队>共享项目>Git(我认为现在这是自动化的)目标平台集。文件说,应该没有错误,但我有,'distrib:jat:1.1.0' 我注意到,distrib 版本 1.4.0.SNAPSHOT,所以我更改了 org.eclipse.kura.qa/pom.xml distrib 依赖项从 1.1.0 到 1.4.0.SNAPSHOT,

在此处输入图像描述

Maven > 更新项目

瞧,工作区中不再有错误。现在我们开始,

我想为我的 Raspberry Pi 开发一个捆绑包。我想使用串行通信,所以我想打开 org.eclipse.kura.example.serial.publisher 项目。我打开 MANIFEST.MF,我检查了 Imported Packages,右键单击并找到未使用的依赖项,有两个未使用的包。 在此处输入图像描述

我想将此serialpublisher项目导出为插件,“右键单击项目>导出>插件开发>可部署插件和片段”,出现错误,这是日志,

http://pastebin.com/SKyikwPm

我被困在这一点上,在 Eclipse 工作区中,只有 6 个警告没有错误。但我无法导出示例项目。当我按照 eclipse github io 页面上的入门指南进行操作时,我设法将项目导出为可部署的插件。为什么我不能导出这个例子,我不知道。我为此损失了两天。如果你有什么建议我会appriciate。

此致。

4

2 回答 2

0

您是否在项目中打开kura-equinox_3.8.1.target文件target-definition并单击Set as Target Platform

顺便说一句,您不需要整个 Kura 存储库来开发自己的存储库。您只需要将“user_workspace_archive_1.x.0.zip”导入您的工作区并执行上述操作。然后就可以开始开发了。

希望这能解决你的问题,干杯。

于 2016-04-04T21:22:58.897 回答
0

清单中似乎存在未解决的依赖关系。

查看“ Hello World ”示例,尤其是“添加依赖项”和“解决依赖项->清单”部分。

于 2015-12-23T08:35:31.980 回答