库拉存储库新建构建问题(项目依赖项错误)

时间:2015-11-24 10:11:37

标签: java eclipse maven eclipse-plugin kura

我想开始开发新的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 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] ------------------------------------------------------------------------

(其他INFO日志被忽略。)

日志显示SUCCESS但是有一些与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项目, enter image description here

团队&gt;分享项目&gt; 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,< / p>

enter image description here

Maven&gt;更新项目

Voila,工作区中没有错误。我们走了,

我想为我的Raspberry Pi开发一个包。我想使用串行通信,所以我想打开org.eclipse.kura.example.serial.publisher项目。我打开MANIFEST.MF,我检查了导入的软件包,右键单击并查找未使用的依赖项,有两个软件包未使用。 enter image description here

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

http://pastebin.com/SKyikwPm

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

最诚挚的问候。

2 个答案:

答案 0 :(得分:0)

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

检查“Hello World”示例,尤其是“添加依赖项”和“解析依赖项 - &gt;清单”部分。

答案 1 :(得分:0)

您是否打开kura-equinox_3.8.1.target项目中的target-definition文件,然后点击Set as Target Platform

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

希望这能解决你的问题,欢呼。