How to set up a package development environment (Eclipse Equinox Maven)

I am trying to set up an eclipse environment for package development (with maven-bundle-plugin-bnd) and run and debug what equinox links from eclipse

I created sample packages with the org.apache.felix maven-bundle-plugin and can install and run those packages from eclipse equinox,
but every time I need to run "setup file: C: \ path \ bundle1.jar", "install file: C: \ path \ bundle2.jar "which is causing the pain. I was looking for a run configuration but it only launches and runs (plugins) projects in workspaces, not maven projects.

What I did was create a maven project and add dependencies (bundle1, bundle2, etc.) and add the maven-dependency plugin to copy all the dependent packages in one folder (another problem is using equimox-_ to determine the version of packages but maven uses "-" as delimiter), if i don't uncheck the version in equinox standalone app i need to provide package version in config.ini file but i don't want it, is this the correct way to solve this problem?

<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>  

      

To summarize, I have packages in a folder that is generated with the org.apache.felix maven-bundle-plugin, how can I run and debug them from eclipse?

+2


source to share


2 answers


I wouldn't say this is the "correct" solution, but it might work for you.

The antrun plugin can be used to modify dependencies to replace the final hyphen with an underscore, so the dependency plugin is not needed to remove the version.



My regex is rusty, but from a little testing comes the following configuration to apply the required name change to the files in the bundleDependency directory.

<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>

      

+1


source


I wrote a tool called auto-builder ( http://code.google.com/p/auto-builder ). It analyzes PDE-based projects and generates Ant build files; it supports transient closure on dependencies and all that jazz.

I posted a review: http://empty-set.net/?p=9 . I wrote this because the Maven tools I played with when integrated with the PDE didn't "just work". Basically, I wanted to do the encoding in PDE and have a Hudson based CID without any problem in between.



Generating Ant files is good because it gives you all the benefits of a declarative build tool, but it leaves you with a procedural description of what it does.

I am looking for additional PDE based projects to test it out. There are several RFC-0112 Bundle repositories and I have the code to download the dependencies. If anyone is interested, I can integrate dependency loading using auto-builder.

0


source







All Articles