Maven multi module support

Hello folks

i’m in the process of snapping Apache Tika which is a Java based app.

The build is controlled by Maven and is a multi module project where maven tells it to build from the parent and the parent then builds a bunch of submodules.

Anyway, long story short, the build works, but then doesn’t find any jars because they are distributed amongst a bunch of submodules target directories. Is it possible to define where snapcraft should be looking for built jar files? because if it assumes ${toplevel}/target it will break on 75% of the maven based projects I work with.

https://github.com/apache/tika here is the source code, you can see how its 1 top level pom, then a bunch of other modules that build their own jars.

Thanks

Tom

@sergiusens @elopio Who’s our Java parts go-to person?

Hello @tom!

We don’t have a java expert, so the feedback you can give us to improve the plugin will be very useful.

It sounds like you can use the install keyword to copy your jars to the $SNAPCRAFT_INSTALL directory. But I will take a look at tika.

pura vida

I’m sorry it took so long.

There’s an (undocumented) option called maven-targets. @tom would this work for you?

 maven-targets:
  - tika-java7
  - tika-langdetect
  - tika-bundle
  - tika-xmp
  - tika-translate
  - tika-parsers
  - tika-core
  - tika-serialization
  - tika-app
  - tika-eval
  - tika-batch
  - tika-dl
  - tika-example
  - tika-server

Sorry folks, missed the reply, yeah looks like maven-targets would do the job, I’ll test it out, thanks!