繁体   English   中英

如何设置捆绑包开发环境(Eclipse Equinox Maven)

[英]How to setup bundle development environment (Eclipse Equinox Maven)

我正在尝试设置eclipse环境以开发捆绑包(使用maven-bundle-plugin-bnd)并运行和调试从Eclipse捆绑春分点

我使用org.apache.felix maven-bundle-plugin创建了示例捆绑包,可以从Eclipse春分点安装和启动该捆绑包,
但是每次我需要运行“安装文件:C:\\ path \\ bundle1.jar”,“安装文件:C:\\ path \\ bundle2.jar”时,都会引起痛苦。 我搜索了运行配置,但它仅安装并启动(插入)项目,而不是Maven项目。

我所做的是创建maven项目并添加依赖项(bundle1,bundle2等。)并添加了maven-dependency-plugin以将所有依赖的包复制到一个文件夹中(另一个问题是春分使用“ _”定界符确定包的版本,但是maven使用“-”作为分隔符)如果我不剥离独立的春分应用程序中的版本,我需要在config.ini文件中提供捆绑软件的版本,但我不想要,解决此问题的正确方法是吗?

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-dependencies</id>
            <phase>package</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>${bundleDirectory}</outputDirectory>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
              <stripVersion>true</stripVersion>
            </configuration>
          </execution>
        </executions>
      </plugin>  

总结一下,我在org.apache.felix maven-bundle-plugin创建的文件夹中有捆绑包,如何从Eclipse中运行和调试它们?

我不会说这是一个“适当的”解决方案,但它可能对您有用。

antrun插件可用于修改依赖项,以用下划线替换最终的连字符,因此,依赖项插件无需剥离版本。

我的正则表达式很生锈,但是经过一点测试,下面的配置似乎将所需的名称更改应用于bundleDependency目录中的文件。

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-dependency-plugin</artifactId>
  <executions>
    <execution>
      <id>copy-dependencies</id>
      <phase>package</phase>
      <goals>
        <goal>copy-dependencies</goal>
      </goals>
      <configuration>
        <outputDirectory>${bundleDirectory}</outputDirectory>
        <overWriteReleases>false</overWriteReleases>
        <overWriteSnapshots>true</overWriteSnapshots>
      </configuration>
    </execution>
  </executions>
</plugin>
<plugin>
  <artifactId>maven-antrun-plugin</artifactId>
  <version>1.3</version>
  <executions>
    <execution>
      <phase>package</phase>
      <configuration>
        <tasks>
          <!-- move within same directory is preferred method for a rename-->
          <move todir="${bundleDirectory}">
            <fileset dir="${bundleDirectory}"/>
            <mapper type="regexp" from="([a-zA-Z0-9\.-]+)(-)([0-9\.]+.jar)" 
              to="\1_\3"/>
          </move>
        </tasks>
      </configuration>
      <goals>
        <goal>run</goal>
      </goals>
    </execution>
  </executions>
  <dependencies>
   <dependency>
     <groupId>ant</groupId>
     <artifactId>ant-nodeps</artifactId>
     <version>1.6.5</version>
   </dependency>
  </dependencies>
</plugin>

我编写了一个名为auto-builder的工具( http://code.google.com/p/auto-builder )。 它会检查基于PDE的项目并生成Ant构建文件。 它支持对依赖项和所有爵士乐的传递闭包。

我张贴了一篇文章: http : //empty-set.net/?p=9 我之所以写它是因为与PDE集成时,我玩过的Maven工具不能“正常工作”。基本上,我想在PDE中进行编码,并且希望拥有一个基于Hudson的CI,而不会在此之间大惊小怪。

生成Ant文件很不错,因为它为您提供了声明式构建工具的所有优点,但它为您提供了有关其工作的过程说明。

我正在寻找更多基于PDE的项目对其进行测试。 周围有几个RFC-0112捆绑存储库,我有一些用于下载依赖项的代码。 如果有人感兴趣,那么我可以将依赖项下载与自动构建器集成在一起。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM