让Maven下载完整的opendaylight源代码

时间:2014-10-21 13:29:34

标签: eclipse maven debugging m2eclipse opendaylight

我试图通过附加eclipse调试器来调试我的opendaylight模块。不幸的是,eclipse无法找到由maven管理的几个依赖项的源文件。

我已经尝试过"下载源代码"来自日食m2插件的动作,以及我运行

mvn eclipse:eclipse -DdownloadSources=true

以上导致了一些来源的下载。奇怪的是,仍然缺少一些东西。在我的具体情况下,我需要 sal.implementation 工件的来源,以便分析 FlowProgrammerService

在我的项目的.pom文件中,sal.implementation未列为依赖项,但在" Import-Package"

<build>
<plugins>
  <plugin>
    <groupId>org.apache.felix</groupId>
    <artifactId>maven-bundle-plugin</artifactId>
    <version>2.3.6</version>
    <extensions>true</extensions>
    <configuration>
      <instructions>
        <Import-Package>
          org.opendaylight.controller.sal.core,
          org.opendaylight.controller.sal.utils,
          org.opendaylight.controller.sal.packet,
          org.opendaylight.controller.sal.match,
          org.opendaylight.controller.sal.action,
          org.opendaylight.controller.sal.flowprogrammer,
          org.opendaylight.controller.switchmanager,
          org.apache.felix.dm,
          org.osgi.service.component,
          org.slf4j,
          org.eclipse.osgi.framework.console,
          org.osgi.framework
        </Import-Package>
        <Export-Package>
          org.opendaylight.controller.tutorial_L2_forwarding
        </Export-Package>
        <Bundle-Activator>
          org.opendaylight.controller.tutorial_L2_forwarding.internal.Activator
        </Bundle-Activator>
      </instructions>
      <manifestLocation>${project.basedir}/META-INF</manifestLocation>
    </configuration>
  </plugin>
</plugins>

只有distribution / opendaylight / pom.xml将sal.implementation列为依赖项。

...
<dependency>
  <groupId>org.opendaylight.controller</groupId>
  <artifactId>sal.implementation</artifactId>
</dependency>
...

现在,我如何告诉maven下载这些额外的来源?是否有一种不同的方式以eclipse可以处理它的方式附加这些源?

1 个答案:

答案 0 :(得分:0)

您可以安装JBoss Tools Maven集成功能,它基本上增强了m2e的自动源查找机制。见http://tools.jboss.org/features/maven.html#enhanced-source-lookup-mechanism