vvsh
vvsh

Reputation: 105

Create several jar files from single project using maven

I have a project with the following packages:

net.vvsh.database
net.vvsh.database.driver
net.vvsh.database.exception
net.vvsh.database.pool
...

in package "net.vvsh.database.driver" there are packages:

net.vvsh.database.driver.mysql
net.vvsh.database.driver.h2

And I have dependencies for mysql and h2 accordingly.

I want to generate 3 jar files using maven:

  1. first jar file contains all packages except ..mysql and ..h2
  2. second jar file contains package ..mysql and dependency for mysql (jar file)
  3. third jar file contains package ..h2 and dependency for h2 (jar file)

Thanks in advance.

Upvotes: 0

Views: 117

Answers (1)

MrD
MrD

Reputation: 1275

Somehow, it is possible to get more JAR-files from a single maven module. But it is not recommended. In addition, your requirements sound like an example for a multi-module project: 2 driver modules with their own dependencies defined and your main-application using these drinvers.

Upvotes: 2

Related Questions