Hi,

On Wed, May 13, 2009 at 4:57 PM, Bertrand Delacretaz
<bdelacre...@apache.org> wrote:
> Using a text file to define bundles makes it easy for people to
> exchange configurations, as the text file fully defines the
> application assembly, based on the bundles URLs and digests.

See below for a somewhat related experiment I recently did for
launching Apache Tika using Maven 2 as the launch engine. Running "mvn
-f tika.xml exec:java" would download all the required jars, set up
the correct classpath and launch the configured main class.

The interesting thing here is that the only essential part of the
script below are the Maven coordinates of the tika-app jar. With a
little bit of scripting you could boil the startup command down to
something like "mvnrun org.apache.tika tika-app 0.4-SNAPSHOT" with no
Tika-specific configuration files required. And such a tool could be
used to download and launch any runnable jar (and the full set of
dependencies) in the Maven repository.

Of course this doesn't do any of the OSGi stuff, but as you mention,
the OSGi startup could well be handled as a second stage.

BR,

Jukka Zitting


tika.xml
========
<project xmlns="http://maven.apache.org/POM/4.0.0";
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                             http://maven.apache.org/maven-v4_0_0.xsd ">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.example</groupId>
  <artifactId>application</artifactId>
  <version>SNAPSHOT</version>
  <packaging>pom</packaging>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>java</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <mainClass>org.apache.tika.gui.TikaGUI</mainClass>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.apache.tika</groupId>
      <artifactId>tika-app</artifactId>
      <version>0.4-SNAPSHOT</version>
    </dependency>
  </dependencies>

</project>

Reply via email to