[osmosis-dev] Osmosis plugin development and integration tests

Nicolas Colomer ncolomer at ymail.com
Sun Jan 27 19:06:39 GMT 2013


Hi Brett and thank you a lot for your answer,

Your guidance helped me solve the problem!
FYI, I am using Maven as dependency and build system.

For future readers, here is how I did:

   - Make sure needed Osmosis modules are in your classpath (for instance,
   the osmosis-core-0.41.jar)
   - Add module's external dependencies (for instance, those extracted from
   core's build.gradle<https://github.com/openstreetmap/osmosis/blob/master/core/build.gradle>
   ):
      - net.sf.jpf:jpf:1.5<http://search.maven.org/#artifactdetails%7Cnet.sf.jpf%7Cjpf%7C1.5%7Cjar>
      - org.codehaus.woodstox:woodstox-core-lgpl:4.1.4<http://search.maven.org/#artifactdetails%7Corg.codehaus.woodstox%7Cwoodstox-core-lgpl%7C4.1.4%7Cjar>
      - org.codehaus.woodstox:stax2-api:3.1.1<http://search.maven.org/#artifactdetails%7Corg.codehaus.woodstox%7Cstax2-api%7C3.1.1%7Cjar>
      - org.apache.commons:commons-compress:1.4.1<http://search.maven.org/#artifactdetails%7Corg.apache.commons%7Ccommons-compress%7C1.4.1%7Cjar>
      - xerces:xercesImpl:2.9.1<http://search.maven.org/#artifactdetails%7Cxerces%7CxercesImpl%7C2.9.1%7Cjar>
   - Add an osmosis-plugins.conf file in your classpath, with namespaces to
   your PluginLoader(s)


2013/1/24 Brett Henderson <brett at bretth.com>

> Hi Nicolas,
>
> On 12 January 2013 09:33, Nicolas Colomer <ncolomer at ymail.com> wrote:
>
>
>
>> So I tried to reproduce these tests but I face some class loading issue
>> (always the same Exception, even for simple commands that involve only xml
>> reading / writing):
>>
>> java.lang.NoClassDefFoundError: org/java/plugin/PluginLifecycleException
>>         at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:80)
>>         at
>>
>
> It looks like you're missing a required library.
>
> This class is located in the jpf (Java Plugin Framework) library which is
> included as a dependency of the core project.  If you're including the core
> project/lib as a dependency then you should automatically get jpf as a
> transitive dependency.
>
> Are you using gradle to build your project?
>
>
>>
>> Do you have any idea to solve this?
>> How declare and load my plugin programmatically so that I can use it via
>> command parameters? Do I have to add some resources in my classpath (as
>> for
>> Osmosis, when you declare pluginLoader class in the
>> $OSMOSIS_HOME/config/osmosis-plugins.conf file)?
>>
>
> Your project will need an osmosis-plugins.conf file containing the name of
> your plugin loader class, but otherwise that should be all you need so long
> as you have all the necessary jars available on your classpath.
>
> Brett
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/osmosis-dev/attachments/20130127/51874302/attachment.html>


More information about the osmosis-dev mailing list