我想开始开发新的kura包,所以我克隆了github/eclipse/kura存储库,并一步一步地遵循this指南。事实上,我在写这篇文章的时候也在重复这些步骤。
这是我想问的问题,
1) Maven版本:文档中Maven 3.0.5建议,Maven 3.1.0有误。当前的Maven版本是3.3.9。我还是应该使用3.0.5,或者我可以使用最新版本?(我用的是3.0.5)
2)搭建目标平台:在目录target-platform文件夹下运行mvn全新安装命令。这是输出,
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的核心组件。
可以支持构建日志;
[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我正在遵循官方文件,在这一点上发生了失败。由于这个错误与英特尔-爱迪生有关(我将使用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 ),Maven2Eclipse安装,eGit安装,Eclipse重启。
导入现有的Maven项目,

Team>Share Project>Git (我认为这现在是自动化的)目标平台设置。文档说,应该没有错误,但我有,' distrib :jat: 1.1.0‘我注意到,distrib版本1.4.0 says,所以我将org.eclipse.kura.qa/pom.xml distrib依赖项从1.1.0改为1.4.0.SNAPSHOT,

Maven >更新项目
瞧,工作区中没有更多的错误了。我们开始吧,
我想为我的树莓派开发一个捆绑包。我想使用串口通信,所以我想要开放的org.eclipse.kura.example.serial.publisher项目。我打开MANIFEST.MF,我检查了导入的包,右击发现未使用的依赖项,有两个包未使用。

我想将这个serialpublisher项目导出为一个插件,“右键单击项目>导出>插件开发>可部署插件和片段”,出现错误,这是日志。
http://pastebin.com/SKyikwPm
我被困在这一点上,在Eclipse工作空间中,没有错误,只有6个警告。但我不能导出示例项目。当我按照eclipse github io页面上的入门指南操作时,我设法将项目导出为可部署的插件。为什么我不能导出这个例子,我不知道。我在这上面浪费了两天时间。如果你给我什么建议,我会很高兴的。
诚挚的问候。
发布于 2015-12-23 16:35:32
清单中似乎有未解析的依赖项。
查看"Hello World“示例,特别是”添加依赖项“和”解析依赖项->清单“部分。
发布于 2016-04-05 05:22:59
是否在target-definition项目中打开kura-equinox_3.8.1.target文件并单击Set as Target Platform
顺便说一句,你不需要整个Kura仓库来开发你自己的仓库。您只需将“user_workspace_archive_1.x.0.zip”导入到您的工作区,然后执行上述操作。然后你就可以开始开发了。
希望这能解决你的问题,干杯。
https://stackoverflow.com/questions/33890807
复制相似问题