maven-dependency-plugin icon indicating copy to clipboard operation
maven-dependency-plugin copied to clipboard

[MDEP-485] unpack-dependencies should be able to use subdirectories per classifier

Open jira-importer opened this issue 10 years ago • 2 comments

Dirk Rudolph opened MDEP-485 and commented

When using classifiers to build environment specific artefacts, aggregating them to for example a single deployment unit (in my case its an rpm file, using the rpm plugin) would be easier when there would be a configuration option to unpack all dependencies to a subdirectory per classifier.

<configuration>
 <useSubDirectoryPerClassifier>true</useSubDirectoryPerClassifier>
</configuration>

In this case we could easily unpack all dependencies build for development environment to a single place. Adding a new artefact would require adding a dependency and not changing the plugin configuration for the build of the deployment unit.


Affects: 2.10

jira-importer avatar Apr 23 '15 12:04 jira-importer

Karl Heinz Marbaise commented

Can you create a full example and describe more in detail how you imagine the result would be? Best is to attach such example to this issue ?

jira-importer avatar Apr 30 '15 21:04 jira-importer

Dirk Rudolph commented

Sure, creating a complete example would be as much work as providing a patch I think. So I will describe our scenario here.

We are building multi tenant applications with different application components and create a deployment unit (we are using osgi, so its a collection of bundles) including them all. This can be easily done because they don't differ for different environments and also don't need to be repacked for the deployment scenario we use.

Additionally we build environment specific configurations using property replacement with properties defined in versioned environment descriptions. Those artefacts we build using the assembly plugin and manage them using classifiers. So there are multiple tenants with there configurations for multiple environments that need to be aggregated to a single deployment unit to reduce complexity for the operations team and CI.

tenant_a/

  • app (jar)
  • conf (loval-zip, dev-zip, prod-zip ...)

tenant_b/

  • app (jar)
  • conf (loval-zip, dev-zip, prod-zip ...)

tenant_c/

  • app (jar)
  • conf (loval-zip, dev-zip, prod-zip ...)

deployments/

  • local (aggregated-apps.jar, aggregated-conf.zip)
  • dev (aggregated-apps.jar, aggregated-conf.zip)

As the assemblies are shared between the tenants, they also share the same classifiers and the configurations are in the same filesystem structure not conflicting with each other. So it would be nice to be able to unpack all of the configurations for one environment (= one classifier) to one directory using the dependency plugin in the same way it is possible to extract them per artefact. Well a nice to have would be being able to fail the build, when there are conflicting files.

What do you think. Does this makes sense?

jira-importer avatar May 01 '15 18:05 jira-importer