使用Maven Tycho构建OSGi捆绑时的NPE

时间:2014-07-10 12:46:02

标签: eclipse maven osgi tycho

我想要使用Maven Tycho构建几个OSGi-bundle。虽然可以毫无问题地解决前4个bundle的依赖关系,但Tycho在第5个时候退出了以下神秘异常:

[INFO] Resolving dependencies of MavenProject: my.parent:my.module:0.0.1-SNAPSHOT @ D:\Path\To\Project\pom.xml
[WARNING] The following locally built units have been used to resolve project dependencies:
[WARNING]   my-other-module/0.0.1.201407011334
[INFO] Resolving class path of MavenProject: my.parent:my.module:0.0.1-SNAPSHOT @ D:\Path\To\Project\pom.xml
[ERROR] Internal error: java.lang.NullPointerException -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.NullPointerException
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:167)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.NullPointerException
    at org.eclipse.tycho.core.osgitools.OsgiBundleProject.resolveClassPath(OsgiBundleProject.java:187)
    at org.eclipse.tycho.core.resolver.DefaultTychoDependencyResolver.resolveProject(DefaultTychoDependencyResolver.java:122)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:75)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
    ... 11 more

以下是该捆绑包的MANIFEST.MF(Import-Package部分):

Import-Package: my.other.module.package;version="[0.0,1)",
 org.apache.commons.lang3.builder;version="[3.3,4)",
 org.dozer;version="[5.5,6)",
 org.osgi.service.blueprint;version="[1.0.0,2.0.0)"

解决存储库中的依赖关系不应该是一个问题,因为从eclipse中启动包可以正常工作。

有趣的方面:​​我正在使用Windows 7x64。在我的同事用Linux上它运行良好。

我不确定从哪里开始发现错误 - 例外并没有真正给出提示,所以我很欣赏每一个提示。如果您需要进一步的信息,我很乐意澄清。

0 个答案:

没有答案